Title: [270852] trunk/Source/WebKit
Revision
270852
Author
[email protected]
Date
2020-12-15 10:27:57 -0800 (Tue, 15 Dec 2020)

Log Message

CrashTracer: com.apple.WebKit.Networking at WebKit: WTF::Detail::CallableWrapper<WebKit::PrivateClickMeasurementManager::firePendingAttributionRequests()
https://bugs.webkit.org/show_bug.cgi?id=219860
<rdar://problem/72254207>

Reviewed by Alex Christensen.

Followup patch to add missing completion handlers. This also moves the
check for a null m_networkSession variable to the existing
PrivateClickMeasurementManager::featureEnabled() function for
simplicity.

* NetworkProcess/PrivateClickMeasurementManager.cpp:
(WebKit::PrivateClickMeasurementManager::storeUnattributed):
(WebKit::PrivateClickMeasurementManager::attribute):
(WebKit::PrivateClickMeasurementManager::clearSentAttributions):
(WebKit::PrivateClickMeasurementManager::updateTimerLastFired):
(WebKit::PrivateClickMeasurementManager::firePendingAttributionRequests):
(WebKit::PrivateClickMeasurementManager::clear):
(WebKit::PrivateClickMeasurementManager::clearForRegistrableDomain):
(WebKit::PrivateClickMeasurementManager::clearExpired):
(WebKit::PrivateClickMeasurementManager::toString const):
(WebKit::PrivateClickMeasurementManager::markAllUnattributedAsExpiredForTesting):
(WebKit::PrivateClickMeasurementManager::featureEnabled const):
(WebKit::PrivateClickMeasurementManager::markAttributedPrivateClickMeasurementsAsExpiredForTesting):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (270851 => 270852)


--- trunk/Source/WebKit/ChangeLog	2020-12-15 18:16:50 UTC (rev 270851)
+++ trunk/Source/WebKit/ChangeLog	2020-12-15 18:27:57 UTC (rev 270852)
@@ -1,3 +1,30 @@
+2020-12-15  Kate Cheney  <[email protected]>
+
+        CrashTracer: com.apple.WebKit.Networking at WebKit: WTF::Detail::CallableWrapper<WebKit::PrivateClickMeasurementManager::firePendingAttributionRequests()
+        https://bugs.webkit.org/show_bug.cgi?id=219860
+        <rdar://problem/72254207>
+
+        Reviewed by Alex Christensen.
+
+        Followup patch to add missing completion handlers. This also moves the
+        check for a null m_networkSession variable to the existing 
+        PrivateClickMeasurementManager::featureEnabled() function for
+        simplicity.
+
+        * NetworkProcess/PrivateClickMeasurementManager.cpp:
+        (WebKit::PrivateClickMeasurementManager::storeUnattributed):
+        (WebKit::PrivateClickMeasurementManager::attribute):
+        (WebKit::PrivateClickMeasurementManager::clearSentAttributions):
+        (WebKit::PrivateClickMeasurementManager::updateTimerLastFired):
+        (WebKit::PrivateClickMeasurementManager::firePendingAttributionRequests):
+        (WebKit::PrivateClickMeasurementManager::clear):
+        (WebKit::PrivateClickMeasurementManager::clearForRegistrableDomain):
+        (WebKit::PrivateClickMeasurementManager::clearExpired):
+        (WebKit::PrivateClickMeasurementManager::toString const):
+        (WebKit::PrivateClickMeasurementManager::markAllUnattributedAsExpiredForTesting):
+        (WebKit::PrivateClickMeasurementManager::featureEnabled const):
+        (WebKit::PrivateClickMeasurementManager::markAttributedPrivateClickMeasurementsAsExpiredForTesting):
+
 2020-12-15  Simon Fraser  <[email protected]>
 
         Add batching to WebPreferences updates

Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp (270851 => 270852)


--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp	2020-12-15 18:16:50 UTC (rev 270851)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp	2020-12-15 18:27:57 UTC (rev 270852)
@@ -78,9 +78,6 @@
     }
 
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
-    if (!m_networkSession)
-        return;
-
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
         resourceLoadStatistics->insertPrivateClickMeasurement(WTFMove(attribution), PrivateClickMeasurementAttributionType::Unattributed);
 #endif
@@ -121,7 +118,7 @@
 void PrivateClickMeasurementManager::attribute(const SourceSite& sourceSite, const AttributeOnSite& attributeOnSite, AttributionTriggerData&& attributionTriggerData)
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
-    if (!m_networkSession)
+    if (!featureEnabled())
         return;
 
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics()) {
@@ -200,7 +197,7 @@
 void PrivateClickMeasurementManager::clearSentAttributions(Vector<PrivateClickMeasurement>&& sentConversions)
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
-    if (!m_networkSession)
+    if (!featureEnabled())
         return;
 
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
@@ -211,7 +208,7 @@
 void PrivateClickMeasurementManager::updateTimerLastFired()
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
-    if (!m_networkSession)
+    if (!featureEnabled())
         return;
 
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
@@ -222,7 +219,7 @@
 void PrivateClickMeasurementManager::firePendingAttributionRequests()
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
-    if (!m_networkSession)
+    if (!featureEnabled())
         return;
 
     auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics();
@@ -265,7 +262,7 @@
     m_firePendingAttributionRequestsTimer.stop();
 
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
-    if (!m_networkSession)
+    if (!featureEnabled())
         return;
 
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
@@ -276,7 +273,7 @@
 void PrivateClickMeasurementManager::clearForRegistrableDomain(const RegistrableDomain& domain)
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
-    if (!m_networkSession)
+    if (!featureEnabled())
         return;
 
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
@@ -287,7 +284,7 @@
 void PrivateClickMeasurementManager::clearExpired()
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
-    if (!m_networkSession)
+    if (!featureEnabled())
         return;
 
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
@@ -298,12 +295,17 @@
 void PrivateClickMeasurementManager::toString(CompletionHandler<void(String)>&& completionHandler) const
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
-    if (!m_networkSession)
+    if (!featureEnabled()) {
+        completionHandler("\nNo stored Private Click Measurement data.\n"_s);
         return;
+    }
 
-    if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
+    if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics()) {
         resourceLoadStatistics->privateClickMeasurementToString(WTFMove(completionHandler));
+        return;
+    }
 #endif
+    completionHandler("\nNo stored Private Click Measurement data.\n"_s);
 }
 
 void PrivateClickMeasurementManager::setConversionURLForTesting(URL&& testURL)
@@ -317,7 +319,7 @@
 void PrivateClickMeasurementManager::markAllUnattributedAsExpiredForTesting()
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
-    if (!m_networkSession)
+    if (!featureEnabled())
         return;
 
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
@@ -327,7 +329,7 @@
 
 bool PrivateClickMeasurementManager::featureEnabled() const
 {
-    return m_networkProcess->privateClickMeasurementEnabled() && !m_sessionID.isEphemeral();
+    return m_networkSession && m_networkProcess->privateClickMeasurementEnabled() && !m_sessionID.isEphemeral();
 }
 
 bool PrivateClickMeasurementManager::debugModeEnabled() const
@@ -338,8 +340,10 @@
 void PrivateClickMeasurementManager::markAttributedPrivateClickMeasurementsAsExpiredForTesting(CompletionHandler<void()>&& completionHandler)
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
-    if (!m_networkSession)
+    if (!featureEnabled()) {
+        completionHandler();
         return;
+    }
 
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics()) {
         resourceLoadStatistics->markAttributedPrivateClickMeasurementsAsExpiredForTesting(WTFMove(completionHandler));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to