aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2012-07-12 17:35:28 +0800
committerCarlos Garcia Campos <carlosgc@gnome.org>2012-07-13 18:02:55 +0800
commit86d659967dac6e46d639729ce8a3571d87591310 (patch)
treee98602b070b53b94d4880fe34934baf786ab659d /embed
parenteeeba03717a64d0750ccccdecae756f61260e087 (diff)
downloadgsoc2013-epiphany-86d659967dac6e46d639729ce8a3571d87591310.tar.gz
gsoc2013-epiphany-86d659967dac6e46d639729ce8a3571d87591310.tar.zst
gsoc2013-epiphany-86d659967dac6e46d639729ce8a3571d87591310.zip
Port persistent cookies to WebKit2
https://bugzilla.gnome.org/show_bug.cgi?id=679369
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-embed-single.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/embed/ephy-embed-single.c b/embed/ephy-embed-single.c
index da4704206..fbea9bcfc 100644
--- a/embed/ephy-embed-single.c
+++ b/embed/ephy-embed-single.c
@@ -406,18 +406,27 @@ ephy_embed_single_initialize (EphyEmbedSingle *single)
{
#ifdef HAVE_WEBKIT2
WebKitWebContext *web_context;
+ WebKitCookieManager *cookie_manager;
+ char *filename;
char *cookie_policy;
- /* TODO: Network features */
+ /* TODO: SoupCache, SSL, favicons */
web_context = webkit_web_context_get_default ();
+ /* Store cookies in moz-compatible SQLite format */
+ cookie_manager = webkit_web_context_get_cookie_manager (web_context);
+ filename = g_build_filename (ephy_dot_dir (), "cookies.sqlite", NULL);
+ webkit_cookie_manager_set_persistent_storage (cookie_manager, filename,
+ WEBKIT_COOKIE_PERSISTENT_STORAGE_SQLITE);
+ g_free (filename);
+
cookie_policy = g_settings_get_string (EPHY_SETTINGS_WEB,
EPHY_PREFS_WEB_COOKIES_POLICY);
- ephy_embed_prefs_set_cookie_accept_policy (webkit_web_context_get_cookie_manager (web_context),
- cookie_policy);
+ ephy_embed_prefs_set_cookie_accept_policy (cookie_manager, cookie_policy);
g_free (cookie_policy);
+ /* about: URIs handler */
webkit_web_context_register_uri_scheme (web_context,
EPHY_ABOUT_SCHEME,
about_request_cb,