Add optional logging of per-resource cookie information
authorkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Dec 2017 17:53:49 +0000 (17:53 +0000)
committerkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Dec 2017 17:53:49 +0000 (17:53 +0000)
commit7eb475251a5ac522a84ca12a4426f4f5fe800c73
tree61ef6452ce66a1900072f36e853e03db8f1d0296
parent32dcb85720cd79b92d1b67336d6e428f3d39ad0b
Add optional logging of per-resource cookie information
https://bugs.webkit.org/show_bug.cgi?id=180883
<rdar://problem/35802295>

Reviewed by Brent Fulgham.

In order to support the tracking of the efficacy of Intelligent
Tracking Protection, add some logging of the cookie information
associated with each loaded resource. This logging is off by default
and is enabled with `defaults write -g WebKitLogCookieInformation
-bool true`.

Source/WebCore:

No new tests -- no new user functionality added. Only new logging has
been added.

* platform/Cookie.h:
(WebCore::Cookie::Cookie):
(WebCore::Cookie::isNull const):
(WebCore::Cookie::encode const):
(WebCore::Cookie::decode):
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::canonicalCookieTime):
(WebCore::cookieCreatedTime):
(WebCore::cookieExpirationTime):
(WebCore::getRawCookies):
* platform/network/cocoa/CookieCocoa.mm:
(WebCore::cookieCreated):
(WebCore::Cookie::Cookie):
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::getRawCookies):

Source/WebKit:

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::shouldLogCookieInformation const):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::sendResultForCacheEntry):
(WebKit::NetworkResourceLoader::shouldLogCookieInformation const):
(WebKit::NetworkResourceLoader::logCookieInformation const):
* NetworkProcess/NetworkResourceLoader.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226226 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/Cookie.h
Source/WebCore/platform/network/cf/CookieJarCFNet.cpp
Source/WebCore/platform/network/cocoa/CookieCocoa.mm
Source/WebCore/platform/network/soup/CookieJarSoup.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkProcess.cpp
Source/WebKit/NetworkProcess/NetworkProcess.h
Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp
Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h
Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit/NetworkProcess/NetworkResourceLoader.h
Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm