From 3551c6b1b8a44189e718126996dc6de65d1a9765 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Tue, 10 Jul 2012 18:39:17 +0200 Subject: 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 --- embed/ephy-embed-single.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 } /** -- cgit v1.2.3