[Windows WebKit2] Use cookies set in WebKit1
authorjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 8 May 2011 00:49:26 +0000 (00:49 +0000)
committerjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 8 May 2011 00:49:26 +0000 (00:49 +0000)
commit2f6fcba53614d5451254685031eb21c92928b1e4
tree73e6cbd5e2004a29927aa412f746abef254ae81f
parentb15ff75095269926571fa75b10c3fd258b694e02
[Windows WebKit2] Use cookies set in WebKit1
https://bugs.webkit.org/show_bug.cgi?id=60274

Reviewed by Steve Falkenburg.

Source/WebCore:

Share the default storage session between the UI and Web Processes.

* platform/network/cf/CookieStorageCFNet.cpp:
(WebCore::defaultSessionCookieStorage):
Keep track of the default storage session cookie storage.
(WebCore::currentCookieStorage):
Call defaultCookieStorage to get the default cookie storage.
(WebCore::defaultCookieStorage):
If there is a default storage session cookie storage, prefer that over getting the default
cookie storage. In the Web Process, asking CFNetwork for the default cookie storage directly
without specifying a storage session will not get the cookie storage being shared by the UI
and Web Processes.

* platform/network/ResourceHandle.h:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::willSendRequest):
Make sure to set the current storage session on any requests used by the Web
Process before CFNetwork has to do anything with them, in order for CFNetwork to avoid
doing anything with the Web Process's default storage session (which is not the one shared
with the UI Process).
(WebCore::makeFinalRequest):
Ditto.
(WebCore::ResourceHandle::willSendRequest):
Ditto.
(WebCore::ResourceHandle::currentStorageSession):
If there is a Private Browsing storage session, return that.
If not, on Windows return the default storage session that is being shared with the UI
Process and on Mac return 0.
(WebCore::defaultCFURLStorageSession):
(WebCore::ResourceHandle::setDefaultStorageSession):
(WebCore::ResourceHandle::defaultStorageSession):

* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::doUpdatePlatformRequest):
Make sure to set the current storage session on any requests used by the Web
Process before CFNetwork has to do anything with them, in order for CFNetwork to avoid
doing anything with the Web Process's default storage session (which is not the one shared
with the UI Process).

Source/WebKit/win:

* WebView.cpp:
(WebView::setCacheModel):
Pass 0 to wkCopyFoundationCacheDirectory so that it uses the default session.

Source/WebKit2:

Share the default storage session between the UI and Web Processes.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
Add a parameter for a serialized default storage session, used only on Windows.

* Shared/win/WebCoreArgumentCodersWin.cpp:
(CoreIPC::decodeResourceRequest):
Make sure to set the current storage session on any requests used by the Web
Process before CFNetwork has to do anything with them, in order for CFNetwork to avoid
doing anything with the Web Process's default storage session.

* UIProcess/win/WebContextWin.cpp:
(WebKit::WebContext::platformInitializeWebProcess):
Serialize the default storage session in the UI Process and add it to the
WebProcessCreationParameters.

* WebProcess/WebPage/win/WebPageWin.cpp:
(WebKit::cachedResponseForURL):
Use the cache associated with the current storage session and make sure the request has the
current storage session set on it before doing anything with it.

* WebProcess/win/WebProcessWin.cpp:
(WebKit::WebProcess::platformSetCacheModel):
Use the default storage session.
(WebKit::WebProcess::platformClearResourceCaches):
Ditto.
(WebKit::WebProcess::platformInitializeWebProcess):
Deserialize the default storage session passed in by the UI Process and hand it to the
ResourceHandle.

WebKitLibraries:

* win/include/WebKitSystemInterface/WebKitSystemInterface.h:
* win/lib/WebKitSystemInterface.lib:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@86016 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/network/ResourceHandle.h
Source/WebCore/platform/network/cf/CookieStorageCFNet.cpp
Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebProcessCreationParameters.cpp
Source/WebKit2/Shared/WebProcessCreationParameters.h
Source/WebKit2/Shared/win/WebCoreArgumentCodersWin.cpp
Source/WebKit2/UIProcess/win/WebContextWin.cpp
Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp
Source/WebKit2/WebProcess/win/WebProcessWin.cpp
WebKitLibraries/ChangeLog
WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
WebKitLibraries/win/lib/WebKitSystemInterface.lib