Improve NetworkResourceLoader logging so it can be used for 'setCookiesFromDOM'
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Feb 2018 20:03:48 +0000 (20:03 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Feb 2018 20:03:48 +0000 (20:03 +0000)
commit5f41390735fba6bb7be72756f1d4c0ec4969f12c
tree48451ffc1fd2d8475892f201a3f557c1e7b60f1a
parentf18ca32f6e8097f93bfe26a91d73e575fb1ac09f
Improve NetworkResourceLoader logging so it can be used for 'setCookiesFromDOM'
https://bugs.webkit.org/show_bug.cgi?id=182455
<rdar://problem/36626601>

Reviewed by Chris Dumez.

Source/WebCore:

After this refactoring, a convenience method I added in r227860 is no longer needed.
This patch removes this dead code.

* platform/network/NetworkStorageSession.h: Export 'cookieStoragePartition' so it can
be used in WebKit.
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::hasStorageAccessForFrame): Deleted unused method.

Source/WebKit:

Refactor "logCookieInformation" so that it can be used for resource loads and DOM cookie
manipulation. Place the generally useful logic in a static method that can be invoked
from other places in the NetworkProcess.

Call the new refactored method from NetworkConnectionToWebProcess::setCookiesFromDOM so
we can perform logging there as well.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Call the new logging method
(when enabled).
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::shouldLogCookieInformation): Changed to static method.
(WebKit::escapeForJSON): Made a static function so it could be shared between multiple
methods.
(WebKit::NetworkResourceLoader::logCookieInformation const): Refactor into two methods.
(WebKit::NetworkResourceLoader::logCookieInformation): Ditto.
(WebKit::NetworkResourceLoader::shouldLogCookieInformation const): Deleted.
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Switch to user-enabled release logging
to track partitioning and blocking behavior.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/network/NetworkStorageSession.h
Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit/NetworkProcess/NetworkResourceLoader.h
Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm