Title: [271184] trunk/Source/WebKit
Revision
271184
Author
[email protected]
Date
2021-01-05 17:08:52 -0800 (Tue, 05 Jan 2021)

Log Message

PCM: Experimental debug mode stops working after initial use
https://bugs.webkit.org/show_bug.cgi?id=220336
<rdar://problem/72398086>

Reviewed by Brent Fulgham.

The existing experimental PCM debug mode uses
RuntimeEnabledFeatures::sharedFeatures().privateClickMeasurementDebugModeEnabled()
which is not correct in the network process. This makes the flag to lose its
state after navigations in new tabs.

This patch moves the flag to be alongside the PCM feature flag in
WebKit::NetworkProcess.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setPrivateClickMeasurementDebugMode):
(WebKit::NetworkProcess::privateClickMeasurementDebugModeEnabled const):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/PrivateClickMeasurementManager.cpp:
(WebKit::PrivateClickMeasurementManager::debugModeEnabled const):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (271183 => 271184)


--- trunk/Source/WebKit/ChangeLog	2021-01-06 00:44:51 UTC (rev 271183)
+++ trunk/Source/WebKit/ChangeLog	2021-01-06 01:08:52 UTC (rev 271184)
@@ -1,3 +1,26 @@
+2021-01-05  John Wilander  <[email protected]>
+
+        PCM: Experimental debug mode stops working after initial use
+        https://bugs.webkit.org/show_bug.cgi?id=220336
+        <rdar://problem/72398086>
+
+        Reviewed by Brent Fulgham.
+
+        The existing experimental PCM debug mode uses
+        RuntimeEnabledFeatures::sharedFeatures().privateClickMeasurementDebugModeEnabled()
+        which is not correct in the network process. This makes the flag to lose its
+        state after navigations in new tabs.
+
+        This patch moves the flag to be alongside the PCM feature flag in
+        WebKit::NetworkProcess.
+
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::setPrivateClickMeasurementDebugMode):
+        (WebKit::NetworkProcess::privateClickMeasurementDebugModeEnabled const):
+        * NetworkProcess/NetworkProcess.h:
+        * NetworkProcess/PrivateClickMeasurementManager.cpp:
+        (WebKit::PrivateClickMeasurementManager::debugModeEnabled const):
+
 2021-01-05  Kimmo Kinnunen  <[email protected]>
 
         WebKit IPC generator tests have duplicate receiver names, limiting the implementation

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (271183 => 271184)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2021-01-06 00:44:51 UTC (rev 271183)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2021-01-06 01:08:52 UTC (rev 271184)
@@ -1324,14 +1324,14 @@
     return m_privateClickMeasurementEnabled;
 }
 
-void NetworkProcess::setPrivateClickMeasurementDebugMode(bool debugMode)
+void NetworkProcess::setPrivateClickMeasurementDebugMode(bool enabled)
 {
-    if (RuntimeEnabledFeatures::sharedFeatures().privateClickMeasurementDebugModeEnabled() == debugMode)
+    if (m_privateClickMeasurementDebugModeEnabled == enabled)
         return;
 
-    RuntimeEnabledFeatures::sharedFeatures().setPrivateClickMeasurementDebugModeEnabled(debugMode);
+    m_privateClickMeasurementDebugModeEnabled = enabled;
 
-    String message = debugMode ? "[Private Click Measurement] Turned Debug Mode on."_s : "[Private Click Measurement] Turned Debug Mode off."_s;
+    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;
@@ -1339,6 +1339,11 @@
     }
 }
 
+bool NetworkProcess::privateClickMeasurementDebugModeEnabled() const
+{
+    return m_privateClickMeasurementDebugModeEnabled;
+}
+
 void NetworkProcess::preconnectTo(PAL::SessionID sessionID, WebPageProxyIdentifier webPageProxyID, WebCore::PageIdentifier webPageID, const URL& url, const String& userAgent, WebCore::StoredCredentialsPolicy storedCredentialsPolicy, Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain)
 {
     LOG(Network, "(NetworkProcess) Preconnecting to URL %s (storedCredentialsPolicy %i)", url.string().utf8().data(), (int)storedCredentialsPolicy);

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.h (271183 => 271184)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.h	2021-01-06 00:44:51 UTC (rev 271183)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.h	2021-01-06 01:08:52 UTC (rev 271184)
@@ -279,6 +279,7 @@
     void setPrivateClickMeasurementEnabled(bool);
     bool privateClickMeasurementEnabled() const;
     void setPrivateClickMeasurementDebugMode(bool);
+    bool privateClickMeasurementDebugModeEnabled() const;
 
     using CacheStorageRootPathCallback = CompletionHandler<void(String&&)>;
     void cacheStorageRootPath(PAL::SessionID, CacheStorageRootPathCallback&&);
@@ -594,6 +595,7 @@
     HashMap<WebCore::PageIdentifier, Vector<WebCore::UserContentURLPattern>> m_extensionCORSDisablingPatterns;
 
     bool m_privateClickMeasurementEnabled { true };
+    bool m_privateClickMeasurementDebugModeEnabled { false };
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp (271183 => 271184)


--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp	2021-01-06 00:44:51 UTC (rev 271183)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp	2021-01-06 01:08:52 UTC (rev 271184)
@@ -334,7 +334,7 @@
 
 bool PrivateClickMeasurementManager::debugModeEnabled() const
 {
-    return RuntimeEnabledFeatures::sharedFeatures().privateClickMeasurementDebugModeEnabled() && !m_sessionID.isEphemeral();
+    return m_networkProcess->privateClickMeasurementDebugModeEnabled() && !m_sessionID.isEphemeral();
 }
 
 void PrivateClickMeasurementManager::markAttributedPrivateClickMeasurementsAsExpiredForTesting(CompletionHandler<void()>&& completionHandler)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to