diff options
author | Xan Lopez <xan@igalia.com> | 2012-08-10 00:29:11 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-08-10 00:29:11 +0800 |
commit | f5a70c9a7c7fe5470b30cf556fe0f3938c4eb1e6 (patch) | |
tree | 264f2d174638d75be3ecce304519beadfdc6e849 /embed | |
parent | 692a7e79e8d92dca2d26a3e68fc7177e1afe5021 (diff) | |
download | gsoc2013-epiphany-f5a70c9a7c7fe5470b30cf556fe0f3938c4eb1e6.tar.gz gsoc2013-epiphany-f5a70c9a7c7fe5470b30cf556fe0f3938c4eb1e6.tar.zst gsoc2013-epiphany-f5a70c9a7c7fe5470b30cf556fe0f3938c4eb1e6.zip |
ephy-embed-single: make the http disk cache respect private mode
By storing its data in the temporary profile instead of the user cache
dir.
https://bugzilla.gnome.org/show_bug.cgi?id=681147
Diffstat (limited to 'embed')
-rw-r--r-- | embed/ephy-embed-single.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/embed/ephy-embed-single.c b/embed/ephy-embed-single.c index 96c98e38b..515f05a72 100644 --- a/embed/ephy-embed-single.c +++ b/embed/ephy-embed-single.c @@ -417,7 +417,6 @@ ephy_embed_single_initialize (EphyEmbedSingle *single) char *cookie_policy; /* TODO: SoupCache, SSL, favicons */ - web_context = webkit_web_context_get_default (); /* Store cookies in moz-compatible SQLite format */ @@ -446,6 +445,7 @@ ephy_embed_single_initialize (EphyEmbedSingle *single) char *favicon_db_path; EphyEmbedSinglePrivate *priv = single->priv; SoupSessionFeature *requester; + EphyEmbedShellMode mode; /* Initialise nspluginwrapper's plugins if available */ if (g_file_test (NSPLUGINWRAPPER_SETUP, G_FILE_TEST_EXISTS) != FALSE) @@ -474,8 +474,12 @@ ephy_embed_single_initialize (EphyEmbedSingle *single) /* Use GNOME proxy settings through libproxy */ soup_session_add_feature_by_type (session, SOUP_TYPE_PROXY_RESOLVER_GNOME); + mode = ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()); + /* WebKitSoupCache */ - cache_dir = g_build_filename (g_get_user_cache_dir (), g_get_prgname (), NULL); + cache_dir = g_build_filename (mode == EPHY_EMBED_SHELL_MODE_PRIVATE ? + ephy_dot_dir () : g_get_user_cache_dir (), + g_get_prgname (), NULL); priv->cache = soup_cache_new (cache_dir, SOUP_CACHE_SINGLE_USER); g_free (cache_dir); @@ -500,7 +504,7 @@ ephy_embed_single_initialize (EphyEmbedSingle *single) are not using a private session, otherwise we want any new password to expire when we exit *and* we don't want to use any existing password in the keyring */ - if (ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) != EPHY_EMBED_SHELL_MODE_PRIVATE) + if (mode != EPHY_EMBED_SHELL_MODE_PRIVATE) soup_session_add_feature_by_type (session, SOUP_TYPE_PASSWORD_MANAGER_GNOME); #endif |