diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2012-07-11 00:39:17 +0800 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2012-08-03 15:55:18 +0800 |
commit | 3551c6b1b8a44189e718126996dc6de65d1a9765 (patch) | |
tree | c6e6b718bd4a97bf7b4dfe90a14ae4dfa79f1f3b | |
parent | 80177fba115c1d9c4833d108094b6c90aaaf879d (diff) | |
download | gsoc2013-epiphany-3551c6b1b8a44189e718126996dc6de65d1a9765.tar gsoc2013-epiphany-3551c6b1b8a44189e718126996dc6de65d1a9765.tar.gz gsoc2013-epiphany-3551c6b1b8a44189e718126996dc6de65d1a9765.tar.bz2 gsoc2013-epiphany-3551c6b1b8a44189e718126996dc6de65d1a9765.tar.lz gsoc2013-epiphany-3551c6b1b8a44189e718126996dc6de65d1a9765.tar.xz gsoc2013-epiphany-3551c6b1b8a44189e718126996dc6de65d1a9765.tar.zst gsoc2013-epiphany-3551c6b1b8a44189e718126996dc6de65d1a9765.zip |
ephy-embed-single: Port disk cache to Webit2
From the API point of view, we only need to use WebKit2 to clear the
cache.
https://bugzilla.gnome.org/show_bug.cgi?id=679684
-rw-r--r-- | embed/ephy-embed-single.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/embed/ephy-embed-single.c b/embed/ephy-embed-single.c index fbea9bcfc..96c98e38b 100644 --- a/embed/ephy-embed-single.c +++ b/embed/ephy-embed-single.c @@ -53,7 +53,9 @@ struct _EphyEmbedSinglePrivate { GHashTable *form_auth_data; +#ifndef HAVE_WEBKIT2 SoupCache *cache; +#endif }; static void ephy_embed_single_init (EphyEmbedSingle *single); @@ -186,12 +188,14 @@ ephy_embed_single_dispose (GObject *object) { EphyEmbedSinglePrivate *priv = EPHY_EMBED_SINGLE (object)->priv; +#ifndef HAVE_WEBKIT2 if (priv->cache) { soup_cache_flush (priv->cache); soup_cache_dump (priv->cache); g_object_unref (priv->cache); priv->cache = NULL; } +#endif G_OBJECT_CLASS (ephy_embed_single_parent_class)->dispose (object); } @@ -329,6 +333,7 @@ ephy_permission_manager_iface_init (EphyPermissionManagerIface *iface) iface->list = impl_permission_manager_list; } +#ifndef HAVE_WEBKIT2 static void cache_size_cb (GSettings *settings, char *key, @@ -337,6 +342,7 @@ cache_size_cb (GSettings *settings, int new_cache_size = g_settings_get_int (settings, key); soup_cache_set_max_size (single->priv->cache, new_cache_size * 1024 * 1024 /* in bytes */); } +#endif #ifdef HAVE_WEBKIT2 static void @@ -515,7 +521,11 @@ ephy_embed_single_initialize (EphyEmbedSingle *single) void ephy_embed_single_clear_cache (EphyEmbedSingle *single) { +#ifdef HAVE_WEBKIT2 + webkit_web_context_clear_cache (webkit_web_context_get_default ()); +#else soup_cache_clear (single->priv->cache); +#endif } /** |