[Windows WebKit2] Use cookies set in WebKit1
authorjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 May 2011 23:49:04 +0000 (23:49 +0000)
committerjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 May 2011 23:49:04 +0000 (23:49 +0000)
commit209d4654392bb201949046a95457beb69f79ae28
treeab10493421339933dd2110659f399f1199bc1642
parent462c03ad2b2596845efb30699fcc91f06c1c150d
[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):
Only encode the session parameter if it is valid.
(WebKit::WebProcessCreationParameters::decode):
Don't try to decode a null session data.
* 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:

Take 3 after rolling out KB2465367 from my system.

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@86285 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