summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2013-02-19 17:13:51 +0100
committerCarlos Garcia Campos <carlosgc@gnome.org>2013-02-21 09:05:16 +0100
commit8ec71c6a3b9f2ab3f10b1eef201f758bdb44e21f (patch)
treef2680267526abbd776b8a9b0181357e3dcd00454
parent892b1d2649776dac118622a59cf827c7f1b51811 (diff)
downloadepiphany-8ec71c6a3b9f2ab3f10b1eef201f758bdb44e21f.tar.gz
web-extension: Use a different service name for every web process extension
-rw-r--r--embed/ephy-embed-shell.c6
-rw-r--r--embed/web-extension/ephy-web-extension.c6
-rw-r--r--src/ephy-main.c5
3 files changed, 15 insertions, 2 deletions
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 7f48f7c2e..e5aa18ef0 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -697,14 +697,18 @@ ephy_embed_shell_get_web_extension_proxy (EphyEmbedShell *shell)
priv = shell->priv;
if (!priv->web_extension) {
+ char *service_name;
+
+ service_name = g_strdup_printf ("%s-%u", EPHY_WEB_EXTENSION_SERVICE_NAME, getpid ());
priv->web_extension = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
NULL,
- EPHY_WEB_EXTENSION_SERVICE_NAME,
+ service_name,
EPHY_WEB_EXTENSION_OBJECT_PATH,
EPHY_WEB_EXTENSION_INTERFACE,
NULL,
NULL);
+ g_free (service_name);
}
return priv->web_extension;
diff --git a/embed/web-extension/ephy-web-extension.c b/embed/web-extension/ephy-web-extension.c
index 1650026a3..8eb93e8a7 100644
--- a/embed/web-extension/ephy-web-extension.c
+++ b/embed/web-extension/ephy-web-extension.c
@@ -159,11 +159,15 @@ bus_acquired_cb (GDBusConnection *connection,
G_MODULE_EXPORT void
webkit_web_extension_initialize (WebKitWebExtension *extension)
{
+ char *service_name;
+
+ service_name = g_strdup_printf ("%s-%s", EPHY_WEB_EXTENSION_SERVICE_NAME, g_getenv ("EPHY_WEB_EXTENSION_ID"));
g_bus_own_name (G_BUS_TYPE_SESSION,
- EPHY_WEB_EXTENSION_SERVICE_NAME,
+ service_name,
G_BUS_NAME_OWNER_FLAGS_NONE,
bus_acquired_cb,
NULL, NULL,
g_object_ref (extension),
(GDestroyNotify)g_object_unref);
+ g_free (service_name);
}
diff --git a/src/ephy-main.c b/src/ephy-main.c
index 7c38fd952..1ec4b4b05 100644
--- a/src/ephy-main.c
+++ b/src/ephy-main.c
@@ -229,6 +229,7 @@ main (int argc,
EphyShell *ephy_shell;
int status;
EphyFileHelpersFlags flags;
+ char *pid_str;
#ifdef ENABLE_NLS
/* Initialize the i18n stuff */
@@ -459,6 +460,10 @@ main (int argc,
}
#ifdef HAVE_WEBKIT2
+ pid_str = g_strdup_printf ("%u", getpid ());
+ g_setenv ("EPHY_WEB_EXTENSION_ID", pid_str, TRUE);
+ g_free (pid_str);
+
/* Set the web extensions dir ASAP before the process is launched */
webkit_web_context_set_web_extensions_directory (webkit_web_context_get_default (),
EPHY_WEB_EXTENSIONS_DIR);