Add ability to configure document.cookie lifetime cap through user defaults
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Nov 2018 04:50:03 +0000 (04:50 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Nov 2018 04:50:03 +0000 (04:50 +0000)
commite7c7fe809a0393b1a58b116a4e59b22e6ad6225f
treed7384fabc17c09c7932c1897e802028d2ddcd3ec
parent10c9306dff1fde987b1627945e82f78d339cbefa
Add ability to configure document.cookie lifetime cap through user defaults
https://bugs.webkit.org/show_bug.cgi?id=191480
<rdar://problem/45240871>

Reviewed by Chris Dumez.

Source/WebCore:

No new tests. Existing test makes sure we don't regress.

This change makes the capped lifetime in seconds configurable through
user defaults.

* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
(WebCore::NetworkStorageSession::setShouldCapLifetimeForClientSideCookies): Deleted.
    Renamed setAgeCapForClientSideCookies().
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::filterCookies):
(WebCore::NetworkStorageSession::setCookiesFromDOM const):

Source/WebKit:

This change makes the capped lifetime in seconds configurable through
user defaults.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setAgeCapForClientSideCookies):
(WebKit::NetworkProcess::setShouldCapLifetimeForClientSideCookies): Deleted.
    Renamed setAgeCapForClientSideCookies().
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
(WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
(WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies):
(WebKit::NetworkProcessProxy::setShouldCapLifetimeForClientSideCookies): Deleted.
    Renamed setAgeCapForClientSideCookies().
(WebKit::NetworkProcessProxy::didSetShouldCapLifetimeForClientSideCookies): Deleted.
    Renamed didSetAgeCapForClientSideCookies().
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::setAgeCapForClientSideCookies):
(WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap):
(WebKit::ResourceLoadStatisticsMemoryStore::didCreateNetworkProcess):
    New function that handles all the things that need to be done when a network
    process has been created.
* UIProcess/ResourceLoadStatisticsMemoryStore.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::didCreateNetworkProcess):
    Now just calls the corresponding function on its memory store where all the
    configuration parameters are available.
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
(WebKit::WebsiteDataStore::setShouldCapLifetimeForClientSideCookies): Deleted.
    Renamed setAgeCapForClientSideCookies().
* UIProcess/WebsiteData/WebsiteDataStore.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238063 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/network/NetworkStorageSession.h
Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp
Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkProcess.cpp
Source/WebKit/NetworkProcess/NetworkProcess.h
Source/WebKit/NetworkProcess/NetworkProcess.messages.in
Source/WebKit/UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm
Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in
Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.cpp
Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.h
Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp
Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h