Resource Load Statistics: More efficient network process messaging + Fix bug in user...
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Mar 2017 21:50:50 +0000 (21:50 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Mar 2017 21:50:50 +0000 (21:50 +0000)
commit6294eee92f4f8cedef24a6cc3e8ebd878cf1aca9
tree3913156668d68318a818982072658dba6e13be61
parent01dc5eaebf89868f9eff61567d725bb0066dd1e4
Resource Load Statistics: More efficient network process messaging + Fix bug in user interaction reporting
https://bugs.webkit.org/show_bug.cgi?id=169506

Reviewed by Alex Christensen.

Source/WebCore:

Covered by previous test which now follows the code path more closely to when reporting
happens in the web process.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
    No longer explicitly calls ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
    Instead just calls ResourceLoadStatisticsStore::fireDataModificationHandler().
(WebCore::ResourceLoadObserver::logUserInteraction):
    Updated to call the new ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
(WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler):
    Now takes two vectors – domainsToRemove and domainsToAdd.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::toString):
    Added boolean field isMarkedForCookiePartitioning.
(WebCore::ResourceLoadStatistics::merge):
    Added boolean field isMarkedForCookiePartitioning.
* loader/ResourceLoadStatistics.h:
    Added boolean field isMarkedForCookiePartitioning.
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
    Now marks statistics with isMarkedForCookiePartitioning before sending them off to
    ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
(WebCore::ResourceLoadStatisticsStore::setShouldPartitionCookiesCallback):
    Now accepts a handler with two vectors.
(WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
    Now the only exported version of this function is the one without arguments.
    The one internal to WebCore accepts two vectors – domainsToRemove and domainsToAdd.
    The exported one generates the two vectors and then calls the internal one.
(WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
    No longer explicitly calls ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
* loader/ResourceLoadStatisticsStore.h:
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts):
    Now takes two vectors – domainsToRemove and domainsToAdd.

Source/WebKit2:

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
    Now takes two vectors – domainsToRemove and domainsToAdd.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
    The message now takes two vectors – domainsToRemove and domainsToAdd.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
    Now takes two vectors – domainsToRemove and domainsToAdd.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
    The message now takes two vectors – domainsToRemove and domainsToAdd.
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
    Now converts to the two vectors needed by
    WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler().
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::classifyResource):
    No longer explicitly calls ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
(WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
    Changed the order of two blocks to not build a vector if we are to return early.
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
    Now calls WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler().
(WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
    Now takes a handler with two vectors – domainsToRemove and domainsToAdd.
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
    Now takes two vectors – domainsToRemove and domainsToAdd.
(WebKit::WebsiteDataStore::registerSharedResourceLoadObserver):
    Now submits a handler that takes two vectors – domainsToRemove and domainsToAdd.
* UIProcess/WebsiteData/WebsiteDataStore.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213871 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
Source/WebCore/ChangeLog
Source/WebCore/loader/ResourceLoadObserver.cpp
Source/WebCore/loader/ResourceLoadObserver.h
Source/WebCore/loader/ResourceLoadStatistics.cpp
Source/WebCore/loader/ResourceLoadStatistics.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