Support ITP on a per-session basis (198923)
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Aug 2019 18:14:43 +0000 (18:14 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Aug 2019 18:14:43 +0000 (18:14 +0000)
commitd34ef1e9c32dc9796e5c5335bf57e78a643e27b6
tree128a384d223b8366cfd89374c81e80bcc101655d
parentf753aafe87ec3a440b780714a0e5b01d2583b39d
Support ITP on a per-session basis (198923)
https://bugs.webkit.org/show_bug.cgi?id=198923

Patch by Kate Cheney <katherine_cheney@apple.com> on 2019-08-23
Reviewed by Chris Dumez.

Source/WebCore:

This patch updated the data structure used to collect resource load
statistics in order to support ITP data collection on a per session
basis. Each sessionID is stored as a key-value pair with its own map
of ResourceLoadStatistics.

It also updated the statisticsForURL function call to perform lookups
of URL data based on sessionID.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setStatisticsUpdatedCallback):
(WebCore::ResourceLoadObserver::shouldLog const):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::ResourceLoadObserver::logFontLoad):
(WebCore::ResourceLoadObserver::logCanvasRead):
(WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
(WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
(WebCore::ResourceLoadObserver::logScreenAPIAccessed):
(WebCore::ResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
(WebCore::ResourceLoadObserver::statisticsForURL):
(WebCore::ResourceLoadObserver::takeStatistics):
(WebCore::ResourceLoadObserver::clearState):
* loader/ResourceLoadObserver.h:
* testing/Internals.cpp:
(WebCore::Internals::resourceLoadStatisticsForURL):

Source/WebKit:

The original implementation of resourceLoadStatisticsUpdated
did not allow for ITP on a per session basis due to the sessionID
not being passed to the resourceLoadStatisticsUpdated function.
This patch allows access of the correct networkSession by passing
all resourceLoadStatistics in a new data structure of key-value
pairs, where the sessionID is the key.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* WebProcess/WebProcess.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249056 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/loader/ResourceLoadObserver.cpp
Source/WebCore/loader/ResourceLoadObserver.h
Source/WebCore/testing/Internals.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in
Source/WebKit/WebProcess/WebProcess.cpp