[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: http://svn.webkit.org/repository/webkit/trunk@86016 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed