Stop using CookiesStrategy
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2019 23:31:33 +0000 (23:31 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2019 23:31:33 +0000 (23:31 +0000)
commit70be3c2fd97c10d494791aeb24a4be9c298db1f1
tree7bae794fb89d4fe965ccb2e39ae4a690b31d9c50
parent786820668193d38c928eaf14445569a3699eb727
Stop using CookiesStrategy
https://bugs.webkit.org/show_bug.cgi?id=161106

Reviewed by Don Olmstead and Antti Koivisto.

Source/WebCore:

CookiesStrategy is process-global and makes it difficult to switch NetworkStorageSession from having a process-global map.
Instead, use a CookieJar object in the WebProcess.  This has the additional benefit of making it more clear which code
is used in the WebProcess and which code is used in the NetworkProcess.

* Modules/beacon/NavigatorBeacon.cpp:
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::processBuffer):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::clientHandshakeRequest const):
(WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const):
* WebCore.xcodeproj/project.pbxproj:
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::requestStyleSheet):
* dom/Document.cpp:
(WebCore::Document::cookie):
(WebCore::Document::setCookie):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerGetRawCookies const):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::getCookies):
(WebCore::InspectorPageAgent::deleteCookie):
* loader/CookieJar.cpp:
(WebCore::CookieJar::shouldIncludeSecureCookies):
(WebCore::CookieJar::sameSiteInfo):
(WebCore::CookieJar::create):
(WebCore::CookieJar::cookies const):
(WebCore::CookieJar::cookieRequestHeaderFieldProxy):
(WebCore::CookieJar::setCookies):
(WebCore::CookieJar::cookiesEnabled const):
(WebCore::CookieJar::cookieRequestHeaderFieldValue const):
(WebCore::CookieJar::getRawCookies const):
(WebCore::CookieJar::deleteCookie):
(WebCore::shouldIncludeSecureCookies): Deleted.
(WebCore::sameSiteInfo): Deleted.
(WebCore::cookies): Deleted.
(WebCore::cookieRequestHeaderFieldProxy): Deleted.
(WebCore::setCookies): Deleted.
(WebCore::cookiesEnabled): Deleted.
(WebCore::cookieRequestHeaderFieldValue): Deleted.
(WebCore::getRawCookies): Deleted.
(WebCore::deleteCookie): Deleted.
* loader/CookieJar.h:
* loader/EmptyClients.cpp:
(WebCore::pageConfigurationWithEmptyClients):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):
* loader/cache/CachedApplicationManifest.cpp:
(WebCore::CachedApplicationManifest::CachedApplicationManifest):
* loader/cache/CachedApplicationManifest.h:
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
* loader/cache/CachedCSSStyleSheet.h:
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::CachedFont):
* loader/cache/CachedFont.h:
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::CachedImage):
* loader/cache/CachedImage.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::CachedRawResource):
* loader/cache/CachedRawResource.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
(WebCore::CachedResource::setResponse):
(WebCore::CachedResource::varyHeaderValuesMatch):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::cookieJar const):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::createResource):
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::revalidateResource):
(WebCore::CachedResourceLoader::loadResource):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedSVGDocument.cpp:
(WebCore::CachedSVGDocument::CachedSVGDocument):
* loader/cache/CachedSVGDocument.h:
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::CachedSVGFont):
* loader/cache/CachedSVGFont.h:
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::CachedScript):
* loader/cache/CachedScript.h:
* loader/cache/CachedTextTrack.cpp:
(WebCore::CachedTextTrack::CachedTextTrack):
* loader/cache/CachedTextTrack.h:
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
* loader/cache/CachedXSLStyleSheet.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::addImageToCache):
* loader/cache/MemoryCache.h:
* page/Navigator.cpp:
(WebCore::Navigator::cookieEnabled const):
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::cookieJar):
* page/PageConfiguration.cpp:
(WebCore::PageConfiguration::PageConfiguration):
* page/PageConfiguration.h:
* platform/CookiesStrategy.h: Removed.
* platform/PlatformStrategies.h:
(WebCore::PlatformStrategies::cookiesStrategy): Deleted.
* platform/network/CacheValidation.cpp:
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::collectVaryingRequestHeaders):
(WebCore::verifyVaryingRequestHeaders):
* platform/network/CacheValidation.h:
* platform/network/CookieRequestHeaderFieldProxy.h:
* platform/network/cf/NetworkStorageSessionCFNetWin.cpp:
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
* platform/network/curl/ResourceHandleCurl.cpp:
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::updateSnapshot):
* testing/Internals.cpp:
(WebCore::Internals::getCookies const):

Source/WebKit:

* NetworkProcess/NetworkProcessPlatformStrategies.cpp:
(WebKit::NetworkProcessPlatformStrategies::createCookiesStrategy): Deleted.
* NetworkProcess/NetworkProcessPlatformStrategies.h:
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
* Scripts/webkit/messages.py:
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::getCookiesForFrame):
(WebKit::WebAutomationSessionProxy::deleteCookie):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::cookiesForURL):
(WebKit::PluginView::setCookiesForURL):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::createCookiesStrategy): Deleted.
(WebKit::WebPlatformStrategies::cookiesForDOM): Deleted.
(WebKit::WebPlatformStrategies::setCookiesFromDOM): Deleted.
(WebKit::WebPlatformStrategies::cookiesEnabled): Deleted.
(WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): Deleted.
(WebKit::WebPlatformStrategies::getRawCookies): Deleted.
(WebKit::WebPlatformStrategies::deleteCookie): Deleted.
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
* WebProcess/WebPage/WebCookieJar.cpp: Added.
(WebKit::WebCookieJar::cookies const):
(WebKit::WebCookieJar::setCookies):
(WebKit::WebCookieJar::cookiesEnabled const):
(WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
(WebKit::WebCookieJar::getRawCookies const):
(WebKit::WebCookieJar::deleteCookie):
* WebProcess/WebPage/WebCookieJar.h: Added.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldAttachDrawingAreaOnPageTransition):

Source/WebKitLegacy/mac:

* Misc/WebCache.mm:
(+[WebCache addImageToCache:forURL:forFrame:]):
* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::getCookies):
(WebKit::NetscapePluginInstanceProxy::setCookies):
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView getVariable:forURL:value:length:]):
(-[WebNetscapePluginView setVariable:forURL:value:length:]):
* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::createCookiesStrategy): Deleted.
(WebPlatformStrategies::cookiesForDOM): Deleted.
(WebPlatformStrategies::setCookiesFromDOM): Deleted.
(WebPlatformStrategies::cookiesEnabled): Deleted.
(WebPlatformStrategies::cookieRequestHeaderFieldValue): Deleted.
(WebPlatformStrategies::getRawCookies): Deleted.
(WebPlatformStrategies::deleteCookie): Deleted.
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):

Source/WebKitLegacy/win:

* Plugins/PluginView.cpp:
(WebCore::PluginView::getValueForURL):
(WebCore::PluginView::setValueForURL):
* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::createBlobRegistry):
(WebPlatformStrategies::createCookiesStrategy): Deleted.
(WebPlatformStrategies::cookiesForDOM): Deleted.
(WebPlatformStrategies::setCookiesFromDOM): Deleted.
(WebPlatformStrategies::cookiesEnabled): Deleted.
(WebPlatformStrategies::cookieRequestHeaderFieldValue): Deleted.
(WebPlatformStrategies::getRawCookies): Deleted.
(WebPlatformStrategies::deleteCookie): Deleted.
* WebCoreSupport/WebPlatformStrategies.h:
* WebView.cpp:
(WebView::initWithFrame):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
81 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/beacon/NavigatorBeacon.cpp
Source/WebCore/Modules/websockets/WebSocketChannel.cpp
Source/WebCore/Modules/websockets/WebSocketHandshake.cpp
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/StyleRuleImport.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/inspector/agents/InspectorPageAgent.cpp
Source/WebCore/loader/CookieJar.cpp
Source/WebCore/loader/CookieJar.h
Source/WebCore/loader/EmptyClients.cpp
Source/WebCore/loader/ImageLoader.cpp
Source/WebCore/loader/cache/CachedApplicationManifest.cpp
Source/WebCore/loader/cache/CachedApplicationManifest.h
Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp
Source/WebCore/loader/cache/CachedCSSStyleSheet.h
Source/WebCore/loader/cache/CachedFont.cpp
Source/WebCore/loader/cache/CachedFont.h
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/loader/cache/CachedImage.h
Source/WebCore/loader/cache/CachedRawResource.cpp
Source/WebCore/loader/cache/CachedRawResource.h
Source/WebCore/loader/cache/CachedResource.cpp
Source/WebCore/loader/cache/CachedResource.h
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/loader/cache/CachedResourceLoader.h
Source/WebCore/loader/cache/CachedSVGDocument.cpp
Source/WebCore/loader/cache/CachedSVGDocument.h
Source/WebCore/loader/cache/CachedSVGFont.cpp
Source/WebCore/loader/cache/CachedSVGFont.h
Source/WebCore/loader/cache/CachedScript.cpp
Source/WebCore/loader/cache/CachedScript.h
Source/WebCore/loader/cache/CachedTextTrack.cpp
Source/WebCore/loader/cache/CachedTextTrack.h
Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp
Source/WebCore/loader/cache/CachedXSLStyleSheet.h
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/loader/cache/MemoryCache.h
Source/WebCore/page/Navigator.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/PageConfiguration.cpp
Source/WebCore/page/PageConfiguration.h
Source/WebCore/platform/CookiesStrategy.h [deleted file]
Source/WebCore/platform/PlatformStrategies.h
Source/WebCore/platform/network/CacheValidation.cpp
Source/WebCore/platform/network/CacheValidation.h
Source/WebCore/platform/network/CookieRequestHeaderFieldProxy.h
Source/WebCore/platform/network/cf/NetworkStorageSessionCFNetWin.cpp
Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm
Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp
Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp
Source/WebCore/testing/Internals.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkProcessPlatformStrategies.cpp
Source/WebKit/NetworkProcess/NetworkProcessPlatformStrategies.h
Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp
Source/WebKit/Scripts/webkit/messages.py
Source/WebKit/Sources.txt
Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp
Source/WebKit/WebProcess/Plugins/PluginView.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.h
Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp [new file with mode: 0644]
Source/WebKit/WebProcess/WebPage/WebCookieJar.h [new file with mode: 0644]
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/Misc/WebCache.mm
Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.h
Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm
Source/WebKitLegacy/mac/WebView/WebView.mm
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/Plugins/PluginView.cpp
Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.h
Source/WebKitLegacy/win/WebView.cpp