Skip to content
  • alexis.menard@openbossa.org's avatar
    [Qt] [WK2] Implement a persistent cookie storage. · 0da27b38
    alexis.menard@openbossa.org authored
    https://bugs.webkit.org/show_bug.cgi?id=65309
    
    Reviewed by Chang Shu.
    
    Source/WebCore:
    
    Implement a cookie storage for the Qt port on WebKit2.
    The implementation is using a SQLite database to store the cookies
    and restore them. It uses a static object as CookieJar is not an
    object but a set of global functions. The actual saving/restoring is on
    the WebProcess side where our network stack lives.
    
    Existing tests cover the new implementation. Unfortunately there is one
    case that we can't easily simulate : login in a website, make sure that the webprocess
    is not running and then going back to this website and see that we are logged.
    
    * WebCore.pri:
    * WebCore.pro:
    * platform/qt/CookieJarQt.cpp:
    (WebCore::getHostnamesWithCookies):
    (WebCore::deleteCookiesForHostname):
    (WebCore::deleteAllCookies):
    (WebCore::SharedCookieJarQt::shared):
    (WebCore::SharedCookieJarQt::create):
    (WebCore::SharedCookieJarQt::destroy):
    (WebCore::SharedCookieJarQt::getHostnamesWithCookies):
    (WebCore::SharedCookieJarQt::deleteCookiesForHostname):
    (WebCore::SharedCookieJarQt::deleteAllCookies):
    (WebCore::SharedCookieJarQt::SharedCookieJarQt):
    (WebCore::SharedCookieJarQt::~SharedCookieJarQt):
    (WebCore::SharedCookieJarQt::setCookiesFromUrl):
    (WebCore::SharedCookieJarQt::ensureDatabaseTable):
    (WebCore::SharedCookieJarQt::loadCookies):
    * platform/qt/CookieJarQt.h: Added.
    
    Source/WebKit2:
    
    Add parameter to the WebProcess creation to specify where cookies should be saved.
    It also use the new cookie storage implementation and set it to our network stack
    so cookies are used when using it.
    
    * Shared/WebProcessCreationParameters.cpp:
    (WebKit::WebProcessCreationParameters::encode):
    (WebKit::WebProcessCreationParameters::decode):
    * Shared/WebProcessCreationParameters.h:
    * UIProcess/qt/WebContextQt.cpp:
    (WebKit::WebContext::platformInitializeWebProcess):
    * WebProcess/qt/WebProcessQt.cpp:
    (WebKit::WebProcess::platformInitializeWebProcess):
    (WebKit::WebProcess::platformTerminate):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95568 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    0da27b38