diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2013-03-28 22:56:23 +0800 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2013-04-05 17:43:21 +0800 |
commit | efccc1eac4ac4e15fd4f5695d27a85c7d25c3cc6 (patch) | |
tree | 0c77cd96faff179f977cf25ff375c241a7320414 /src | |
parent | 921cc71d8092e41f5d8cec0c652d14059c9fb6a8 (diff) | |
download | gsoc2013-epiphany-efccc1eac4ac4e15fd4f5695d27a85c7d25c3cc6.tar gsoc2013-epiphany-efccc1eac4ac4e15fd4f5695d27a85c7d25c3cc6.tar.gz gsoc2013-epiphany-efccc1eac4ac4e15fd4f5695d27a85c7d25c3cc6.tar.bz2 gsoc2013-epiphany-efccc1eac4ac4e15fd4f5695d27a85c7d25c3cc6.tar.lz gsoc2013-epiphany-efccc1eac4ac4e15fd4f5695d27a85c7d25c3cc6.tar.xz gsoc2013-epiphany-efccc1eac4ac4e15fd4f5695d27a85c7d25c3cc6.tar.zst gsoc2013-epiphany-efccc1eac4ac4e15fd4f5695d27a85c7d25c3cc6.zip |
Unify all web context setup in EphyEmbedShell on primary instance startup
Cookies, web extension and custom URI handlers were initialized in
ephy_embed_shell_init(), so they were always called even for secondary
instances. All other initializations were in ephy_shell_startup so that
it only happens for the primary instance. Move all the code to
ephy_embed_shell_startup to make sure everything happens at the same
time and only for the primary instance.
https://bugzilla.gnome.org/show_bug.cgi?id=696020
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/ephy-shell.c | 46 |
2 files changed, 0 insertions, 47 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 0b38aa816..290ca0fb0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -86,7 +86,6 @@ libephymain_la_CPPFLAGS = \ -DLOADER_DIR=\""$(pkglibdir)/$(EPIPHANY_MAJOR)/loaders"\" \ -DDATADIR=\""$(pkgdatadir)"\" \ -DGNOMELOCALEDIR=\"$(datadir)/locale\" \ - -DEPHY_WEB_EXTENSIONS_DIR=\""$(libdir)/epiphany/$(EPIPHANY_MAJOR)/web-extensions"\" \ $(AM_CPPFLAGS) if WITH_WEBKIT2 diff --git a/src/ephy-shell.c b/src/ephy-shell.c index 9b3a9012e..bfb6d7a4a 100644 --- a/src/ephy-shell.c +++ b/src/ephy-shell.c @@ -27,7 +27,6 @@ #include "ephy-bookmarks-import.h" #include "ephy-debug.h" #include "ephy-embed-container.h" -#include "ephy-embed-prefs.h" #include "ephy-embed-utils.h" #include "ephy-file-helpers.h" #include "ephy-gui.h" @@ -223,52 +222,16 @@ static GActionEntry app_normal_mode_entries[] = { { "reopen-closed-tab", reopen_closed_tab, NULL, NULL, NULL }, }; -#ifdef HAVE_WEBKIT2 -static void -ephy_shell_setup_environment (EphyShell *shell) -{ - EphyEmbedShellMode mode = ephy_embed_shell_get_mode (EPHY_EMBED_SHELL (shell)); - char *pid_str; - - pid_str = g_strdup_printf ("%u", getpid ()); - g_setenv ("EPHY_WEB_EXTENSION_ID", pid_str, TRUE); - g_setenv ("EPHY_DOT_DIR", ephy_dot_dir (), TRUE); - if (EPHY_EMBED_SHELL_MODE_HAS_PRIVATE_PROFILE (mode)) - g_setenv ("EPHY_PRIVATE_PROFILE", "1", TRUE); - g_free (pid_str); -} -#endif - static void ephy_shell_startup (GApplication* application) { EphyEmbedShellMode mode; -#ifdef HAVE_WEBKIT2 - char *disk_cache_dir; -#endif G_APPLICATION_CLASS (ephy_shell_parent_class)->startup (application); /* We're not remoting; start our services */ mode = ephy_embed_shell_get_mode (EPHY_EMBED_SHELL (application)); -#ifdef HAVE_WEBKIT2 - ephy_shell_setup_environment (EPHY_SHELL (application)); - /* 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); - - /* Disk Cache */ - disk_cache_dir = g_build_filename (EPHY_EMBED_SHELL_MODE_HAS_PRIVATE_PROFILE (mode) ? - ephy_dot_dir () : g_get_user_cache_dir (), - g_get_prgname (), NULL); - webkit_web_context_set_disk_cache_directory (webkit_web_context_get_default (), - disk_cache_dir); - g_free (disk_cache_dir); -#endif - - ephy_embed_prefs_init (); - if (mode != EPHY_EMBED_SHELL_MODE_APPLICATION) { GtkBuilder *builder; @@ -299,14 +262,6 @@ ephy_shell_startup (GApplication* application) } static void -ephy_shell_shutdown (GApplication* application) -{ - G_APPLICATION_CLASS (ephy_shell_parent_class)->shutdown (application); - - ephy_embed_prefs_shutdown (); -} - -static void session_load_cb (GObject *object, GAsyncResult *result, gpointer user_data) @@ -536,7 +491,6 @@ ephy_shell_class_init (EphyShellClass *klass) object_class->constructed = ephy_shell_constructed; application_class->startup = ephy_shell_startup; - application_class->shutdown = ephy_shell_shutdown; application_class->activate = ephy_shell_activate; application_class->before_emit = ephy_shell_before_emit; application_class->add_platform_data = ephy_shell_add_platform_data; |