[epiphany] ephy-embed-single: Port disk cache to Webit2
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] ephy-embed-single: Port disk cache to Webit2
- Date: Fri, 3 Aug 2012 07:55:40 +0000 (UTC)
commit 3551c6b1b8a44189e718126996dc6de65d1a9765
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Tue Jul 10 18:39:17 2012 +0200
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 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/embed/ephy-embed-single.c b/embed/ephy-embed-single.c
index fbea9bc..96c98e3 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
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]