Bug 229770

Summary: Move PCM::Store ownership from WebResourceLoadStatisticsStore to PrivateClickMeasurementManager
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: katherine_cheney, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=229807
Attachments:
Description Flags
Patch
none
Patch none

Description Alex Christensen 2021-09-01 14:25:26 PDT
Move PCM::Store ownership from WebResourceLoadStatisticsStore to PrivateClickMeasurementManager
Comment 1 Alex Christensen 2021-09-01 14:26:28 PDT
Created attachment 437067 [details]
Patch
Comment 2 Kate Cheney 2021-09-01 15:06:02 PDT
Comment on attachment 437067 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437067&action=review

Looks good except for the recreateResourceLoadStatistics function that no longer deletes the PCM database, we should probably rename it and instead recreate the PCM store to simulate a browser restart.

> Source/WebKit/NetworkProcess/NetworkSession.cpp:213
>      destroyResourceLoadStatistics([this, weakThis = makeWeakPtr(*this), completionHandler = WTFMove(completionHandler)] () mutable {

This seems like it might cause layout test issues. I used recreateResourceLoadStatistics to simulate a session restart in https://bugs.webkit.org/show_bug.cgi?id=219134, specifically for http/tests/privateClickMeasurement/expired-ad-click-gets-removed-on-session-start.html and http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start.html. We might need to rename it to simulatePrivateClickMeasurementSessionRestart and instead recreate the PCM database to keep these tests doing what they are supposed to do.
Comment 3 Alex Christensen 2021-09-01 15:34:32 PDT
Created attachment 437074 [details]
Patch
Comment 4 EWS 2021-09-01 16:26:57 PDT
Committed r281886 (241216@main): <https://commits.webkit.org/241216@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 437074 [details].
Comment 5 Radar WebKit Bug Importer 2021-09-01 16:27:25 PDT
<rdar://problem/82650844>