Repository navigation
Commit dc64f9a
Pouneh Bahrami
[PCM] Support local (non-private-relay) debug mode and Internet (private-relayed) debug modes
https://bugs.webkit.org/show_bug.cgi?id=326422
rdar://178674757
Reviewed by Charlie Wolfe.
Currently, Safari exposes a Developer setting for “Enable Private Click Measurement debug mode”.
This mode changes PCM’s behavior in two ways:
1. It reduces the amount of time that reports are pending, from “a couple days” to “15 seconds”
2. It bypasses the requirement that reports are sent over private relay
(1) is important for testing, but
(2) means that we can’t easily create a test that ensures that reports are sent using private relay.
Let’s create a second debug mode option that controls whether we enforce proxying by private relay.
Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/EventAttribution.mm
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebKit/NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setPrivateClickMeasurementPrivateRelayEnforcement):
* Source/WebKit/NetworkProcess/NetworkProcess.h:
* Source/WebKit/NetworkProcess/NetworkProcess.messages.in:
* Source/WebKit/NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
(WebKit::NetworkSession::setPrivateClickMeasurementPrivateRelayEnforcement):
* Source/WebKit/NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::privateClickMeasurementPrivateRelayEnforcementEnabled const):
* Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h:
* Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.serialization.in:
* Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementClient.h:
* Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementClientImpl.cpp:
(WebKit::PCM::ClientImpl::privateRelayEnforcementEnabled const):
* Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementClientImpl.h:
* Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDaemonClient.cpp:
(WebKit::PCM::DaemonClient::privateRelayEnforcementEnabled const):
* Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDaemonClient.h:
* Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp:
(WebKit::PrivateClickMeasurementManager::getTokenPublicKey):
(WebKit::PrivateClickMeasurementManager::configureForTokenSigning):
(WebKit::PrivateClickMeasurementManager::setPrivateRelayEnforcementIsEnabled):
(WebKit::PrivateClickMeasurementManager::fireConversionRequestImpl):
(WebKit::PrivateClickMeasurementManager::shouldBypassPrivateRelay const):
* Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h:
* Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.cpp:
(WebKit::PCM::messageTypeSendsReply):
(WebKit::PCM::handlePCMMessageSetPrivateRelayEnforcementIsEnabled):
(WebKit::PCM::decodeMessageAndSendToManager):
* Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.h:
* Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.serialization.in:
* Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.cpp:
(WebKit::PCM::ManagerProxy::setPrivateRelayEnforcementIsEnabled):
* Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.h:
* Source/WebKit/NetworkProcess/PrivateClickMeasurement/cocoa/PrivateClickMeasurementConnectionCocoa.mm:
(WebKit::PCM::Connection::newConnectionWasInitialized const):
* Source/WebKit/Shared/EntryPointUtilities/Cocoa/Daemon/PCMDaemonConnectionSet.h:
* Source/WebKit/Shared/EntryPointUtilities/Cocoa/Daemon/PCMDaemonConnectionSet.mm:
(WebKit::PCM::DaemonConnectionSet::add):
(WebKit::PCM::DaemonConnectionSet::remove):
(WebKit::PCM::DaemonConnectionSet::setConnectedNetworkProcessHasDebugModeEnabled):
(WebKit::PCM::DaemonConnectionSet::setConnectedNetworkProcessHasPrivateRelayEnforcementEnabled):
(WebKit::PCM::DaemonConnectionSet::privateRelayEnforcementEnabled const):
* Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _setPrivateClickMeasurementPrivateRelayEnforcementEnabled:]):
* Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::setPrivateClickMeasurementPrivateRelayEnforcement):
* Source/WebKit/UIProcess/Network/NetworkProcessProxy.h:
* Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::platformSetNetworkParameters):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setPrivateClickMeasurementPrivateRelayEnforcement):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/EventAttribution.mm:
(TestWebKitAPI::TEST(PrivateClickMeasurement, DaemonPrivateRelayEnforcement)):
(TestWebKitAPI::TEST(PrivateClickMeasurement, NetworkProcessPrivateRelayEnforcement)):
(TestWebKitAPI::runPCMTestInDebugModeAndWaitForConsoleMessage):
(TestWebKitAPI::TEST(PrivateClickMeasurement, DebugModeBypassesPrivateRelayByDefault)):
(TestWebKitAPI::TEST(PrivateClickMeasurement, DebugModeWithPrivateRelayEnforcement)):
Canonical link: https://commits.webkit.org/323862@main1 parent 5c6d0f2 commit dc64f9a
30 files changed
Lines changed: 274 additions & 24 deletions
File tree
- Source
- WTF/Scripts/Preferences
- WebKit
- NetworkProcess
- PrivateClickMeasurement
- cocoa
- UIProcess
- API/Cocoa
- Network
- WebsiteData
- Cocoa
- Tools/TestWebKitAPI/Tests/WebKit/WKWebView
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4950 | 4950 | | |
4951 | 4951 | | |
4952 | 4952 | | |
| 4953 | + | |
| 4954 | + | |
| 4955 | + | |
| 4956 | + | |
| 4957 | + | |
| 4958 | + | |
| 4959 | + | |
| 4960 | + | |
4953 | 4961 | | |
4954 | 4962 | | |
4955 | 4963 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1775 | 1775 | | |
1776 | 1776 | | |
1777 | 1777 | | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
1778 | 1784 | | |
1779 | 1785 | | |
1780 | 1786 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| 338 | + | |
338 | 339 | | |
339 | 340 | | |
340 | 341 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
184 | 185 | | |
185 | 186 | | |
186 | 187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
| |||
720 | 721 | | |
721 | 722 | | |
722 | 723 | | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
723 | 733 | | |
724 | 734 | | |
725 | 735 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| 291 | + | |
| 292 | + | |
291 | 293 | | |
292 | 294 | | |
293 | 295 | | |
| |||
392 | 394 | | |
393 | 395 | | |
394 | 396 | | |
| 397 | + | |
395 | 398 | | |
396 | 399 | | |
397 | 400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
| |||
0 commit comments