Resource Load Statistics: Clear network process cache when clearing store
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Apr 2017 17:05:04 +0000 (17:05 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Apr 2017 17:05:04 +0000 (17:05 +0000)
commit797ef12824fc533c45ec65b86dff60dded77ec5c
tree0ca02278be4d819008067ef9986db7394e7cb5a1
parent04a91d6ea405c29be3b3178589c605d22b888274
Resource Load Statistics: Clear network process cache when clearing store
https://bugs.webkit.org/show_bug.cgi?id=171256
<rdar://problem/31802347>

Reviewed by Brent Fulgham.

Source/WebCore:

Test that covers this code:
http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::clearInMemoryStore):
    Better name.
(WebCore::ResourceLoadObserver::logUserInteraction):
    Now passes on the boolean parameter clearFirst to
    ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
(WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler):
    Now takes and passes on the boolean parameter clearFirst to
    ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
(WebCore::ResourceLoadObserver::statisticsStore): Deleted.
    This getter violated abstraction. The way it was used
    is now solved through dedicated functions.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
    Now passes on the boolean parameter clearFirst to
    ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
(WebCore::ResourceLoadStatisticsStore::clearInMemory):
    Better name.
    Now triggers clearing of the associated network process cache.
(WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent):
    Now calls clearInMemory().
(WebCore::ResourceLoadStatisticsStore::setShouldPartitionCookiesCallback):
    Now expects a handler with the boolean parameter clearFirst.
(WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
    Now takes and passes on the boolean parameter clearFirst to
    m_shouldPartitionCookiesForDomainsHandler().
* loader/ResourceLoadStatisticsStore.h:
(WebCore::ResourceLoadStatisticsStore::clear): Deleted.
* platform/network/NetworkStorageSession.h:
    NetworkStorageSession::setShouldPartitionCookiesForHosts() now
    takes the boolean parameter clearFirst.
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts):
    Now clears m_topPrivatelyControlledDomainsForCookiePartitioning
    if the boolean parameter clearFirst is true.

Source/WebKit2:

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
    Now takes and passes on the boolean parameter clearFirst to
    WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts().
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
    The message ShouldPartitionCookiesForTopPrivatelyOwnedDomains now
    takes the boolean parameter clearFirst.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
    Now takes and passes on the boolean parameter clearFirst to
    Messages::NetworkProcess::ShouldPartitionCookiesForTopPrivatelyOwnedDomains.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
    The message ShouldPartitionCookiesForTopPrivatelyOwnedDomains now
    takes the boolean parameter clearFirst.
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
    Now uses the boolean parameter clearFirst when calling
    WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler().
(WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore):
    No longer uses the deleted store getter.
(WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
    No longer uses the deleted store getter.
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
    No sends the boolean parameter clearFirst to
    ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
(WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
    Now expects a handler with the boolean parameter clearFirst.
(WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
* UIProcess/WebResourceLoadStatisticsStore.h:
    Now uses the new WebCore::ResourceLoadObserver::clearInMemoryStore().
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
    Now takes and passes on the boolean parameter clearFirst in its
    message to the network process.
(WebKit::WebsiteDataStore::registerSharedResourceLoadObserver):
    Now expects a handler with the boolean parameter clearFirst.
* UIProcess/WebsiteData/WebsiteDataStore.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215741 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/loader/ResourceLoadObserver.cpp
Source/WebCore/loader/ResourceLoadObserver.h
Source/WebCore/loader/ResourceLoadStatisticsStore.cpp
Source/WebCore/loader/ResourceLoadStatisticsStore.h
Source/WebCore/platform/network/NetworkStorageSession.h
Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/NetworkProcess.cpp
Source/WebKit2/NetworkProcess/NetworkProcess.h
Source/WebKit2/NetworkProcess/NetworkProcess.messages.in
Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp
Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h
Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in
Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.cpp
Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp
Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.h
Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp
Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h