<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[283504] trunk/Source/WebKit</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/283504">283504</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2021-10-04 10:38:45 -0700 (Mon, 04 Oct 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Enable PCM debug mode per WebsiteDataStore instead of process-global
https://bugs.webkit.org/show_bug.cgi?id=231096

Reviewed by Kate Cheney.

This will make it so we don't need to restart the network process in order to enable or disable debug mode.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::setPrivateClickMeasurementDebugMode):
(WebKit::NetworkProcess::privateClickMeasurementDebugModeEnabled const): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
(WebKit::NetworkSession::setPrivateClickMeasurementDebugMode):
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::privateClickMeasurementDebugModeEnabled const):
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementClientImpl.cpp:
(WebKit::PCM::ClientImpl::debugModeEnabled const):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::setPrivateClickMeasurementDebugMode):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::experimentalFeatureEnabled):
(WebKit::WebsiteDataStore::platformSetNetworkParameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setPrivateClickMeasurementDebugMode):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcesscpp">trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcessh">trunk/Source/WebKit/NetworkProcess/NetworkProcess.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcessmessagesin">trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcessCreationParameterscpp">trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcessCreationParametersh">trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkSessioncpp">trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkSessionh">trunk/Source/WebKit/NetworkProcess/NetworkSession.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkSessionCreationParameterscpp">trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkSessionCreationParametersh">trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementClientImplcpp">trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementClientImpl.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessCocoaWebProcessPoolCocoamm">trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessNetworkNetworkProcessProxycpp">trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessNetworkNetworkProcessProxyh">trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebsiteDataCocoaWebsiteDataStoreCocoamm">trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebsiteDataWebsiteDataStorecpp">trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (283503 => 283504)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-10-04 16:46:54 UTC (rev 283503)
+++ trunk/Source/WebKit/ChangeLog       2021-10-04 17:38:45 UTC (rev 283504)
</span><span class="lines">@@ -1,3 +1,44 @@
</span><ins>+2021-10-04  Alex Christensen  <achristensen@webkit.org>
+
+        Enable PCM debug mode per WebsiteDataStore instead of process-global
+        https://bugs.webkit.org/show_bug.cgi?id=231096
+
+        Reviewed by Kate Cheney.
+
+        This will make it so we don't need to restart the network process in order to enable or disable debug mode.
+
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::initializeNetworkProcess):
+        (WebKit::NetworkProcess::setPrivateClickMeasurementDebugMode):
+        (WebKit::NetworkProcess::privateClickMeasurementDebugModeEnabled const): Deleted.
+        * NetworkProcess/NetworkProcess.h:
+        * NetworkProcess/NetworkProcess.messages.in:
+        * NetworkProcess/NetworkProcessCreationParameters.cpp:
+        (WebKit::NetworkProcessCreationParameters::encode const):
+        (WebKit::NetworkProcessCreationParameters::decode):
+        * NetworkProcess/NetworkProcessCreationParameters.h:
+        * NetworkProcess/NetworkSession.cpp:
+        (WebKit::NetworkSession::NetworkSession):
+        (WebKit::NetworkSession::setPrivateClickMeasurementDebugMode):
+        * NetworkProcess/NetworkSession.h:
+        (WebKit::NetworkSession::privateClickMeasurementDebugModeEnabled const):
+        * NetworkProcess/NetworkSessionCreationParameters.cpp:
+        (WebKit::NetworkSessionCreationParameters::encode const):
+        (WebKit::NetworkSessionCreationParameters::decode):
+        * NetworkProcess/NetworkSessionCreationParameters.h:
+        * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementClientImpl.cpp:
+        (WebKit::PCM::ClientImpl::debugModeEnabled const):
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
+        * UIProcess/Network/NetworkProcessProxy.cpp:
+        (WebKit::NetworkProcessProxy::setPrivateClickMeasurementDebugMode):
+        * UIProcess/Network/NetworkProcessProxy.h:
+        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+        (WebKit::experimentalFeatureEnabled):
+        (WebKit::WebsiteDataStore::platformSetNetworkParameters):
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::setPrivateClickMeasurementDebugMode):
+
</ins><span class="cx"> 2021-10-04  Jean-Yves Avenard  <jya@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Vorbis decoder can't be instantiated - follow up on Bug 230742
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (283503 => 283504)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp    2021-10-04 16:46:54 UTC (rev 283503)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp       2021-10-04 17:38:45 UTC (rev 283504)
</span><span class="lines">@@ -346,7 +346,6 @@
</span><span class="cx">     setCacheModel(parameters.cacheModel);
</span><span class="cx"> 
</span><span class="cx">     setPrivateClickMeasurementEnabled(parameters.enablePrivateClickMeasurement);
</span><del>-    setPrivateClickMeasurementDebugMode(parameters.enablePrivateClickMeasurementDebugMode);
</del><span class="cx">     m_ftpEnabled = parameters.ftpEnabled;
</span><span class="cx"> 
</span><span class="cx">     for (auto& supplement : m_supplements.values())
</span><span class="lines">@@ -1352,26 +1351,12 @@
</span><span class="cx">     return m_privateClickMeasurementEnabled;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkProcess::setPrivateClickMeasurementDebugMode(bool enabled)
</del><ins>+void NetworkProcess::setPrivateClickMeasurementDebugMode(PAL::SessionID sessionID, bool enabled)
</ins><span class="cx"> {
</span><del>-    if (m_privateClickMeasurementDebugModeEnabled == enabled)
-        return;
-
-    m_privateClickMeasurementDebugModeEnabled = enabled;
-
-    String message = enabled ? "[Private Click Measurement] Turned Debug Mode on."_s : "[Private Click Measurement] Turned Debug Mode off."_s;
-    for (auto& networkConnectionToWebProcess : m_webProcessConnections.values()) {
-        if (networkConnectionToWebProcess->sessionID().isEphemeral())
-            continue;
-        networkConnectionToWebProcess->broadcastConsoleMessage(MessageSource::PrivateClickMeasurement, MessageLevel::Info, message);
-    }
</del><ins>+    if (auto* networkSession = this->networkSession(sessionID))
+        networkSession->setPrivateClickMeasurementDebugMode(enabled);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool NetworkProcess::privateClickMeasurementDebugModeEnabled() const
-{
-    return m_privateClickMeasurementDebugModeEnabled;
-}
-
</del><span class="cx"> void NetworkProcess::preconnectTo(PAL::SessionID sessionID, WebPageProxyIdentifier webPageProxyID, WebCore::PageIdentifier webPageID, const URL& url, const String& userAgent, WebCore::StoredCredentialsPolicy storedCredentialsPolicy, std::optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain, LastNavigationWasAppInitiated lastNavigationWasAppInitiated)
</span><span class="cx"> {
</span><span class="cx">     LOG(Network, "(NetworkProcess) Preconnecting to URL %s (storedCredentialsPolicy %i)", url.string().utf8().data(), (int)storedCredentialsPolicy);
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.h (283503 => 283504)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.h      2021-10-04 16:46:54 UTC (rev 283503)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.h 2021-10-04 17:38:45 UTC (rev 283504)
</span><span class="lines">@@ -285,8 +285,7 @@
</span><span class="cx"> 
</span><span class="cx">     void setPrivateClickMeasurementEnabled(bool);
</span><span class="cx">     bool privateClickMeasurementEnabled() const;
</span><del>-    void setPrivateClickMeasurementDebugMode(bool);
-    bool privateClickMeasurementDebugModeEnabled() const;
</del><ins>+    void setPrivateClickMeasurementDebugMode(PAL::SessionID, bool);
</ins><span class="cx"> 
</span><span class="cx">     using CacheStorageRootPathCallback = CompletionHandler<void(String&&)>;
</span><span class="cx">     void cacheStorageRootPath(PAL::SessionID, CacheStorageRootPathCallback&&);
</span><span class="lines">@@ -620,7 +619,6 @@
</span><span class="cx">     HashMap<WebCore::PageIdentifier, Vector<WebCore::UserContentURLPattern>> m_extensionCORSDisablingPatterns;
</span><span class="cx"> 
</span><span class="cx">     bool m_privateClickMeasurementEnabled { true };
</span><del>-    bool m_privateClickMeasurementDebugModeEnabled { false };
</del><span class="cx">     bool m_ftpEnabled { false };
</span><span class="cx"> 
</span><span class="cx">     HashMap<PAL::SessionID, Ref<NetworkStorageManager>> m_storageManagers;
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in (283503 => 283504)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in    2021-10-04 16:46:54 UTC (rev 283503)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in       2021-10-04 17:38:45 UTC (rev 283504)
</span><span class="lines">@@ -146,7 +146,7 @@
</span><span class="cx">     SetThirdPartyCNAMEDomainForTesting(PAL::SessionID sessionID, WebCore::RegistrableDomain domain) -> () Async
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    SetPrivateClickMeasurementDebugMode(bool debugMode)
</del><ins>+    SetPrivateClickMeasurementDebugMode(PAL::SessionID sessionID, bool debugMode)
</ins><span class="cx"> 
</span><span class="cx">     SetSessionIsControlledByAutomation(PAL::SessionID sessionID, bool controlled);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcessCreationParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp (283503 => 283504)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp  2021-10-04 16:46:54 UTC (rev 283503)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp     2021-10-04 17:38:45 UTC (rev 283504)
</span><span class="lines">@@ -71,7 +71,6 @@
</span><span class="cx">     encoder << urlSchemesRegisteredAsNoAccess;
</span><span class="cx"> 
</span><span class="cx">     encoder << enablePrivateClickMeasurement;
</span><del>-    encoder << enablePrivateClickMeasurementDebugMode;
</del><span class="cx">     encoder << ftpEnabled;
</span><span class="cx">     encoder << websiteDataStoreParameters;
</span><span class="cx"> }
</span><span class="lines">@@ -145,8 +144,6 @@
</span><span class="cx"> 
</span><span class="cx">     if (!decoder.decode(result.enablePrivateClickMeasurement))
</span><span class="cx">         return false;
</span><del>-    if (!decoder.decode(result.enablePrivateClickMeasurementDebugMode))
-        return false;
</del><span class="cx">     if (!decoder.decode(result.ftpEnabled))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcessCreationParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h (283503 => 283504)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h    2021-10-04 16:46:54 UTC (rev 283503)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h       2021-10-04 17:38:45 UTC (rev 283504)
</span><span class="lines">@@ -87,7 +87,6 @@
</span><span class="cx">     Vector<String> urlSchemesRegisteredAsNoAccess;
</span><span class="cx"> 
</span><span class="cx">     bool enablePrivateClickMeasurement { true };
</span><del>-    bool enablePrivateClickMeasurementDebugMode { false };
</del><span class="cx">     bool ftpEnabled { false };
</span><span class="cx"> 
</span><span class="cx">     Vector<WebsiteDataStoreParameters> websiteDataStoreParameters;
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkSessioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp (283503 => 283504)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp    2021-10-04 16:46:54 UTC (rev 283503)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp       2021-10-04 17:38:45 UTC (rev 283504)
</span><span class="lines">@@ -117,6 +117,7 @@
</span><span class="cx">     , m_standaloneApplicationDomain(parameters.resourceLoadStatisticsParameters.standaloneApplicationDomain)
</span><span class="cx"> #endif
</span><span class="cx">     , m_privateClickMeasurement(managerOrProxy(*this, networkProcess, parameters))
</span><ins>+    , m_privateClickMeasurementDebugModeEnabled(parameters.enablePrivateClickMeasurementDebugMode)
</ins><span class="cx">     , m_broadcastChannelRegistry(makeUniqueRef<NetworkBroadcastChannelRegistry>())
</span><span class="cx">     , m_testSpeedMultiplier(parameters.testSpeedMultiplier)
</span><span class="cx">     , m_allowsServerPreconnect(parameters.allowsServerPreconnect)
</span><span class="lines">@@ -420,6 +421,17 @@
</span><span class="cx">     privateClickMeasurement().setPCMFraudPreventionValuesForTesting(WTFMove(unlinkableToken), WTFMove(secretToken), WTFMove(signature), WTFMove(keyID));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void NetworkSession::setPrivateClickMeasurementDebugMode(bool enabled)
+{
+    if (m_privateClickMeasurementDebugModeEnabled == enabled)
+        return;
+
+    m_privateClickMeasurementDebugModeEnabled = enabled;
+
+    auto message = enabled ? "[Private Click Measurement] Turned Debug Mode on."_s : "[Private Click Measurement] Turned Debug Mode off."_s;
+    m_networkProcess->broadcastConsoleMessage(sessionID(), MessageSource::PrivateClickMeasurement, MessageLevel::Info, message);
+}
+
</ins><span class="cx"> void NetworkSession::firePrivateClickMeasurementTimerImmediatelyForTesting()
</span><span class="cx"> {
</span><span class="cx">     privateClickMeasurement().startTimerImmediatelyForTesting();
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkSessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkSession.h (283503 => 283504)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkSession.h      2021-10-04 16:46:54 UTC (rev 283503)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSession.h 2021-10-04 17:38:45 UTC (rev 283504)
</span><span class="lines">@@ -175,6 +175,8 @@
</span><span class="cx"> 
</span><span class="cx">     NetworkLoadScheduler& networkLoadScheduler();
</span><span class="cx">     PCM::ManagerInterface& privateClickMeasurement() { return m_privateClickMeasurement.get(); }
</span><ins>+    void setPrivateClickMeasurementDebugMode(bool);
+    bool privateClickMeasurementDebugModeEnabled() const { return m_privateClickMeasurementDebugModeEnabled; }
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     AppPrivacyReportTestingData& appPrivacyReportTestingData() { return m_appPrivacyReportTestingData; }
</span><span class="lines">@@ -215,6 +217,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     bool m_isStaleWhileRevalidateEnabled { false };
</span><span class="cx">     UniqueRef<PCM::ManagerInterface> m_privateClickMeasurement;
</span><ins>+    bool m_privateClickMeasurementDebugModeEnabled { false };
</ins><span class="cx">     std::optional<WebCore::PrivateClickMeasurement> m_ephemeralMeasurement;
</span><span class="cx">     bool m_isRunningEphemeralMeasurementTest { false };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkSessionCreationParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp (283503 => 283504)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp  2021-10-04 16:46:54 UTC (rev 283503)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp     2021-10-04 17:38:45 UTC (rev 283504)
</span><span class="lines">@@ -89,6 +89,7 @@
</span><span class="cx">     encoder << useNetworkLoader;
</span><span class="cx">     encoder << allowsHSTSWithUntrustedRootCertificate;
</span><span class="cx">     encoder << pcmMachServiceName;
</span><ins>+    encoder << enablePrivateClickMeasurementDebugMode;
</ins><span class="cx">     encoder << resourceLoadStatisticsParameters;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -305,6 +306,11 @@
</span><span class="cx">     decoder >> pcmMachServiceName;
</span><span class="cx">     if (!pcmMachServiceName)
</span><span class="cx">         return std::nullopt;
</span><ins>+    
+    std::optional<bool> enablePrivateClickMeasurementDebugMode;
+    decoder >> enablePrivateClickMeasurementDebugMode;
+    if (!enablePrivateClickMeasurementDebugMode)
+        return std::nullopt;
</ins><span class="cx"> 
</span><span class="cx">     std::optional<ResourceLoadStatisticsParameters> resourceLoadStatisticsParameters;
</span><span class="cx">     decoder >> resourceLoadStatisticsParameters;
</span><span class="lines">@@ -361,6 +367,7 @@
</span><span class="cx">         , WTFMove(*useNetworkLoader)
</span><span class="cx">         , WTFMove(*allowsHSTSWithUntrustedRootCertificate)
</span><span class="cx">         , WTFMove(*pcmMachServiceName)
</span><ins>+        , WTFMove(*enablePrivateClickMeasurementDebugMode)
</ins><span class="cx">         , WTFMove(*resourceLoadStatisticsParameters)
</span><span class="cx">     }};
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkSessionCreationParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h (283503 => 283504)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h    2021-10-04 16:46:54 UTC (rev 283503)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h       2021-10-04 17:38:45 UTC (rev 283504)
</span><span class="lines">@@ -104,6 +104,7 @@
</span><span class="cx">     bool useNetworkLoader { false };
</span><span class="cx">     bool allowsHSTSWithUntrustedRootCertificate { false };
</span><span class="cx">     String pcmMachServiceName;
</span><ins>+    bool enablePrivateClickMeasurementDebugMode { false };
</ins><span class="cx"> 
</span><span class="cx">     ResourceLoadStatisticsParameters resourceLoadStatisticsParameters;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessPrivateClickMeasurementPrivateClickMeasurementClientImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementClientImpl.cpp (283503 => 283504)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementClientImpl.cpp 2021-10-04 16:46:54 UTC (rev 283503)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementClientImpl.cpp    2021-10-04 17:38:45 UTC (rev 283504)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> bool ClientImpl::debugModeEnabled() const
</span><span class="cx"> {
</span><span class="cx">     return m_networkSession
</span><del>-        && m_networkProcess->privateClickMeasurementDebugModeEnabled()
</del><ins>+        && m_networkSession->privateClickMeasurementDebugModeEnabled()
</ins><span class="cx">         && !m_networkSession->sessionID().isEphemeral();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessCocoaWebProcessPoolCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (283503 => 283504)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm       2021-10-04 16:46:54 UTC (rev 283503)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm  2021-10-04 17:38:45 UTC (rev 283504)
</span><span class="lines">@@ -557,13 +557,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     parameters.enablePrivateClickMeasurement = ![defaults objectForKey:WebPreferencesKey::privateClickMeasurementEnabledKey()] || [defaults boolForKey:WebPreferencesKey::privateClickMeasurementEnabledKey()];
</span><del>-#if PLATFORM(MAC)
-    NSString *format = @"Experimental%@";
-#else
-    NSString *format = @"WebKitExperimental%@";
-#endif
-    parameters.enablePrivateClickMeasurementDebugMode = [defaults boolForKey:[NSString stringWithFormat:format, WebPreferencesKey::privateClickMeasurementDebugModeEnabledKey().createCFString().get()]];
-    
</del><span class="cx">     parameters.ftpEnabled = [defaults objectForKey:WebPreferencesKey::ftpEnabledKey()] && [defaults boolForKey:WebPreferencesKey::ftpEnabledKey()];
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessNetworkNetworkProcessProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (283503 => 283504)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp    2021-10-04 16:46:54 UTC (rev 283503)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp       2021-10-04 17:38:45 UTC (rev 283504)
</span><span class="lines">@@ -1255,12 +1255,12 @@
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INTELLIGENT_TRACKING_PREVENTION)
</span><span class="cx"> 
</span><del>-void NetworkProcessProxy::setPrivateClickMeasurementDebugMode(bool debugMode)
</del><ins>+void NetworkProcessProxy::setPrivateClickMeasurementDebugMode(PAL::SessionID sessionID, bool debugMode)
</ins><span class="cx"> {
</span><span class="cx">     if (!canSendMessage())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    send(Messages::NetworkProcess::SetPrivateClickMeasurementDebugMode(debugMode), 0);
</del><ins>+    send(Messages::NetworkProcess::SetPrivateClickMeasurementDebugMode(sessionID, debugMode), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkProcessProxy::sendProcessWillSuspendImminentlyForTesting()
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessNetworkNetworkProcessProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (283503 => 283504)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h      2021-10-04 16:46:54 UTC (rev 283503)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h 2021-10-04 17:38:45 UTC (rev 283504)
</span><span class="lines">@@ -205,7 +205,7 @@
</span><span class="cx">     void setDomainsWithCrossPageStorageAccess(HashMap<TopFrameDomain, SubResourceDomain>&&, CompletionHandler<void()>&&);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    void setPrivateClickMeasurementDebugMode(bool);
</del><ins>+    void setPrivateClickMeasurementDebugMode(PAL::SessionID, bool);
</ins><span class="cx">     
</span><span class="cx">     void synthesizeAppIsBackground(bool background);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebsiteDataCocoaWebsiteDataStoreCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (283503 => 283504)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm 2021-10-04 16:46:54 UTC (rev 283503)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm    2021-10-04 17:38:45 UTC (rev 283504)
</span><span class="lines">@@ -92,6 +92,16 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+static bool experimentalFeatureEnabled(const String& key)
+{
+#if PLATFORM(MAC)
+    NSString *format = @"Experimental%@";
+#else
+    NSString *format = @"WebKitExperimental%@";
+#endif
+    return [[NSUserDefaults standardUserDefaults] boolForKey:[NSString stringWithFormat:format, static_cast<NSString *>(key)]];
+}
+
</ins><span class="cx"> void WebsiteDataStore::platformSetNetworkParameters(WebsiteDataStoreParameters& parameters)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies));
</span><span class="lines">@@ -192,6 +202,8 @@
</span><span class="cx"> 
</span><span class="cx">     parameters.uiProcessCookieStorageIdentifier = m_uiProcessCookieStorageIdentifier;
</span><span class="cx"> 
</span><ins>+    parameters.networkSessionParameters.enablePrivateClickMeasurementDebugMode = experimentalFeatureEnabled(WebPreferencesKey::privateClickMeasurementDebugModeEnabledKey());
+
</ins><span class="cx">     if (!cookieFile.isEmpty()) {
</span><span class="cx">         if (auto handle = SandboxExtension::createHandleForReadWriteDirectory(FileSystem::parentPath(cookieFile)))
</span><span class="cx">             parameters.cookieStoragePathExtensionHandle = WTFMove(*handle);
</span><span class="lines">@@ -198,18 +210,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if HAVE(CFNETWORK_ALTERNATIVE_SERVICE) || HAVE(NETWORK_LOADER)
-static bool experimentalFeatureEnabled(const String& key)
-{
-#if PLATFORM(MAC)
-    NSString *format = @"Experimental%@";
-#else
-    NSString *format = @"WebKitExperimental%@";
-#endif
-    return [[NSUserDefaults standardUserDefaults] boolForKey:[NSString stringWithFormat:format, static_cast<NSString *>(key)]];
-}
-#endif
-
</del><span class="cx"> bool WebsiteDataStore::http3Enabled()
</span><span class="cx"> {
</span><span class="cx"> #if HAVE(CFNETWORK_ALTERNATIVE_SERVICE)
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebsiteDataWebsiteDataStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp (283503 => 283504)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp   2021-10-04 16:46:54 UTC (rev 283503)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp      2021-10-04 17:38:45 UTC (rev 283504)
</span><span class="lines">@@ -1904,7 +1904,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebsiteDataStore::setPrivateClickMeasurementDebugMode(bool enabled)
</span><span class="cx"> {
</span><del>-    networkProcess().setPrivateClickMeasurementDebugMode(enabled);
</del><ins>+    networkProcess().setPrivateClickMeasurementDebugMode(sessionID(), enabled);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
</span></span></pre>
</div>
</div>

</body>
</html>