[epiphany] ephy-embed-single: make the http disk cache respect private mode



commit f5a70c9a7c7fe5470b30cf556fe0f3938c4eb1e6
Author: Xan Lopez <xan igalia com>
Date:   Thu Aug 9 18:29:11 2012 +0200

    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

 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 96c98e3..515f05a 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
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]