[GTK] Add webkit_cookie_manager_set_persistent_storage() to WebKit2 GTK+ API
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Jul 2012 08:12:52 +0000 (08:12 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Jul 2012 08:12:52 +0000 (08:12 +0000)
commitc0c78fbd1d5cc70f3789cd85325dd2c3e23bf1da
tree63580d679eee05b83b66d5909900e09da54f2efa
parent349d73429b89c536470d42feb556b1754eb5f85b
[GTK] Add webkit_cookie_manager_set_persistent_storage() to WebKit2 GTK+ API
https://bugs.webkit.org/show_bug.cgi?id=83016

Reviewed by Martin Robinson.

Source/WebCore:

* platform/network/soup/CookieStorageSoup.cpp:
(WebCore::soupCookiesChanged): Do not notify about changes in
other cookie jars than the current one.

Source/WebKit2:

Add a custom implementation of SoupCookieJarSqlite based on
libsoup code but using WebCore SQLite classes. SoupCookieJarSqlite
is part of libsoup-gnome, it's not a lot of code and it doesn't
change often, so it's better to simply have our own implementation
instead of making this important feature depend on an optional
dependency. There are plans to move the implementation to libsoup,
if that eventually happens we will remove our code to use libsoup
directly.

* GNUmakefile.am: Add new dirs to include path.
* GNUmakefile.list.am: Add new files to compilation.
* PlatformEfl.cmake: Ditto.
* Shared/soup/SoupCookiePersistentStorageType.h: Added.
* UIProcess/API/gtk/WebKitCookieManager.cpp:
(webkit_cookie_manager_set_persistent_storage): Set a persistent
storage for cookies.
* UIProcess/API/gtk/WebKitCookieManager.h:
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols
* UIProcess/API/gtk/tests/TestCookieManager.cpp:
(testCookieManagerPersistentStorage):
(serverCallback):
(beforeAll):
(afterAll):
* UIProcess/WebCookieManagerProxy.h:
(WebCookieManagerProxy): Add setCookiePersistentStorage() method
when using soup.
* UIProcess/soup/WebCookieManagerProxySoup.cpp: Added.
(WebKit::WebCookieManagerProxy::setCookiePersistentStorage): Send
SetCookiePersistentStorage message to the web process.
* WebProcess/Cookies/WebCookieManager.h:
(WebCookieManager): Add setCookiePersistentStorage() method when
using soup.
* WebProcess/Cookies/WebCookieManager.messages.in: Add
SetCookiePersistentStorage message when using soup.
* WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
(WebKit::WebCookieManager::setCookiePersistentStorage): Create a
new cookie jar for the given filename and storage type and add it
to the soup session.
* WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp: Added.
(webkitSoupCookieJarSqliteOpenDatabase): Open SQLite database.
(webkitSoupCookieJarSqliteCreateTable): Create moz_cookies if it
doesn't exist.
(webkitSoupCookieJarSqliteLoad): Load the initial set of cookies
from the database.
(webkitSoupCookieJarSqliteInsertCookie): Insert a new cookie into
the database.
(webkitSoupCookieJarSqliteDeleteCookie): Delete an exising cookie
from the database.
(webkitSoupCookieJarSqliteChanged): Insert/delete cookies
depending on the change.
(webkitSoupCookieJarSqliteFinalize):
(webkit_soup_cookie_jar_sqlite_init):
(webkit_soup_cookie_jar_sqlite_class_init):
(webkitSoupCookieJarSqliteNew):
* WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.h: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/network/soup/CookieStorageSoup.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/GNUmakefile.am
Source/WebKit2/GNUmakefile.list.am
Source/WebKit2/PlatformEfl.cmake
Source/WebKit2/Shared/soup/SoupCookiePersistentStorageType.h [new file with mode: 0644]
Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.h
Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
Source/WebKit2/UIProcess/API/gtk/tests/TestCookieManager.cpp
Source/WebKit2/UIProcess/WebCookieManagerProxy.h
Source/WebKit2/UIProcess/soup/WebCookieManagerProxySoup.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/Cookies/WebCookieManager.h
Source/WebKit2/WebProcess/Cookies/WebCookieManager.messages.in
Source/WebKit2/WebProcess/Cookies/soup/WebCookieManagerSoup.cpp
Source/WebKit2/WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.h [new file with mode: 0644]