⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 271184 in webkit


Ignore:
Timestamp:
Jan 5, 2021, 5:08:52 PM (6 years ago)
Author:
wilander@apple.com
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):

Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r271183 r271184  
     12021-01-05  John Wilander  <wilander@apple.com>
     2
     3        PCM: Experimental debug mode stops working after initial use
     4        https://bugs.webkit.org/show_bug.cgi?id=220336
     5        <rdar://problem/72398086>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        The existing experimental PCM debug mode uses
     10        RuntimeEnabledFeatures::sharedFeatures().privateClickMeasurementDebugModeEnabled()
     11        which is not correct in the network process. This makes the flag to lose its
     12        state after navigations in new tabs.
     13
     14        This patch moves the flag to be alongside the PCM feature flag in
     15        WebKit::NetworkProcess.
     16
     17        * NetworkProcess/NetworkProcess.cpp:
     18        (WebKit::NetworkProcess::setPrivateClickMeasurementDebugMode):
     19        (WebKit::NetworkProcess::privateClickMeasurementDebugModeEnabled const):
     20        * NetworkProcess/NetworkProcess.h:
     21        * NetworkProcess/PrivateClickMeasurementManager.cpp:
     22        (WebKit::PrivateClickMeasurementManager::debugModeEnabled const):
     23
    1242021-01-05  Kimmo Kinnunen  <kkinnunen@apple.com>
    225
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp

    r270723 r271184  
    13251325}
    13261326
    1327 void NetworkProcess::setPrivateClickMeasurementDebugMode(bool debugMode)
    1328 {
    1329     if (RuntimeEnabledFeatures::sharedFeatures().privateClickMeasurementDebugModeEnabled() == debugMode)
    1330         return;
    1331 
    1332     RuntimeEnabledFeatures::sharedFeatures().setPrivateClickMeasurementDebugModeEnabled(debugMode);
    1333 
    1334     String message = debugMode ? "[Private Click Measurement] Turned Debug Mode on."_s : "[Private Click Measurement] Turned Debug Mode off."_s;
     1327void NetworkProcess::setPrivateClickMeasurementDebugMode(bool enabled)
     1328{
     1329    if (m_privateClickMeasurementDebugModeEnabled == enabled)
     1330        return;
     1331
     1332    m_privateClickMeasurementDebugModeEnabled = enabled;
     1333
     1334    String message = enabled ? "[Private Click Measurement] Turned Debug Mode on."_s : "[Private Click Measurement] Turned Debug Mode off."_s;
    13351335    for (auto& networkConnectionToWebProcess : m_webProcessConnections.values()) {
    13361336        if (networkConnectionToWebProcess->sessionID().isEphemeral())
     
    13381338        networkConnectionToWebProcess->broadcastConsoleMessage(MessageSource::PrivateClickMeasurement, MessageLevel::Info, message);
    13391339    }
     1340}
     1341
     1342bool NetworkProcess::privateClickMeasurementDebugModeEnabled() const
     1343{
     1344    return m_privateClickMeasurementDebugModeEnabled;
    13401345}
    13411346
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.h

    r270723 r271184  
    280280    bool privateClickMeasurementEnabled() const;
    281281    void setPrivateClickMeasurementDebugMode(bool);
     282    bool privateClickMeasurementDebugModeEnabled() const;
    282283
    283284    using CacheStorageRootPathCallback = CompletionHandler<void(String&&)>;
     
    595596
    596597    bool m_privateClickMeasurementEnabled { true };
     598    bool m_privateClickMeasurementDebugModeEnabled { false };
    597599};
    598600
  • trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp

    r270852 r271184  
    335335bool PrivateClickMeasurementManager::debugModeEnabled() const
    336336{
    337     return RuntimeEnabledFeatures::sharedFeatures().privateClickMeasurementDebugModeEnabled() && !m_sessionID.isEphemeral();
     337    return m_networkProcess->privateClickMeasurementDebugModeEnabled() && !m_sessionID.isEphemeral();
    338338}
    339339
Note: See TracChangeset for help on using the changeset viewer.