Add telemetry to track storage access API adoption
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Jan 2018 22:00:58 +0000 (22:00 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Jan 2018 22:00:58 +0000 (22:00 +0000)
commitf29a197e8c632034769a37a13e1052d3903830ee
tree045631b4d1cbfb666b4f84ce4b5d85d964b1d97c
parent4ce34b8bfc2f571da8e8a315c72e77ef38a161f3
Add telemetry to track storage access API adoption
https://bugs.webkit.org/show_bug.cgi?id=182197
<rdar://problem/35803309>

Reviewed by Chris Dumez.
Source/WebCore:

Part 1: Add telemetry for the user interaction case

This patch adds telemetry to track how frequently third-party cookies are
used in a first party context due to user interaction. This will help
understand cases where the new Storage Access API can help, and to help
us understand if we have considered relevant use cases in its design.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setTimeToLivePartitionFree): Let the observer
know the first party interaction duration.
(WebCore::ResourceLoadObserver::wasAccessedWithinInteractionWindow const): Added.
(WebCore::ResourceLoadObserver::logFrameNavigation): Note when a third party
resource is accessed as a first party due to user interaction.
(WebCore::ResourceLoadObserver::logSubresourceLoading): Ditto.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::encode const): Handle new fields.
(WebCore::ResourceLoadStatistics::decode): Ditto.
* loader/ResourceLoadStatistics.h:

Source/WebKit:

Part 1: Add telemetry for the user interaction case

This patch adds telemetry to track how frequently third-party cookies are
used in a first party context due to user interaction. This will help
understand cases where the new Storage Access API can help, and to help
us understand if we have considered relevant use cases in its design.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
(WebKit::sortedPrevalentResourceTelemetry): Update for new telemetry.
(WebKit::submitTopList): Update for new data types.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess): Handle the partitioning time
passed from the UIProcess.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/loader/ResourceLoadObserver.cpp
Source/WebCore/loader/ResourceLoadObserver.h
Source/WebCore/loader/ResourceLoadStatistics.cpp
Source/WebCore/loader/ResourceLoadStatistics.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebProcessCreationParameters.cpp
Source/WebKit/Shared/WebProcessCreationParameters.h
Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Source/WebKit/UIProcess/WebResourceLoadStatisticsTelemetry.cpp
Source/WebKit/WebProcess/WebProcess.cpp