Title: [270802] trunk/Source/WebKit
Revision
270802
Author
[email protected]
Date
2020-12-14 12:58:48 -0800 (Mon, 14 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.

No new tests, this should fix a crash.

m_networkSession is a weakPtr. We should check that the object it
references exists before trying to use it.

* 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::markAttributedPrivateClickMeasurementsAsExpiredForTesting):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (270801 => 270802)


--- trunk/Source/WebKit/ChangeLog	2020-12-14 20:55:27 UTC (rev 270801)
+++ trunk/Source/WebKit/ChangeLog	2020-12-14 20:58:48 UTC (rev 270802)
@@ -1,3 +1,29 @@
+2020-12-14  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.
+
+        No new tests, this should fix a crash.
+
+        m_networkSession is a weakPtr. We should check that the object it
+        references exists before trying to use it.
+
+        * 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::markAttributedPrivateClickMeasurementsAsExpiredForTesting):
+
 2020-12-14  Tim Horton  <[email protected]>
 
         Adopt symbol image API instead of SPI in WKPDFHUDView

Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp (270801 => 270802)


--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp	2020-12-14 20:55:27 UTC (rev 270801)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp	2020-12-14 20:58:48 UTC (rev 270802)
@@ -78,6 +78,9 @@
     }
 
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
+    if (!m_networkSession)
+        return;
+
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
         resourceLoadStatistics->insertPrivateClickMeasurement(WTFMove(attribution), PrivateClickMeasurementAttributionType::Unattributed);
 #endif
@@ -118,6 +121,9 @@
 void PrivateClickMeasurementManager::attribute(const SourceSite& sourceSite, const AttributeOnSite& attributeOnSite, AttributionTriggerData&& attributionTriggerData)
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
+    if (!m_networkSession)
+        return;
+
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics()) {
         resourceLoadStatistics->attributePrivateClickMeasurement(sourceSite, attributeOnSite, WTFMove(attributionTriggerData), [this] (auto optionalSecondsUntilSend) {
             if (optionalSecondsUntilSend) {
@@ -194,6 +200,9 @@
 void PrivateClickMeasurementManager::clearSentAttributions(Vector<PrivateClickMeasurement>&& sentConversions)
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
+    if (!m_networkSession)
+        return;
+
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
         resourceLoadStatistics->clearSentAttributions(WTFMove(sentConversions));
 #endif
@@ -202,6 +211,9 @@
 void PrivateClickMeasurementManager::updateTimerLastFired()
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
+    if (!m_networkSession)
+        return;
+
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
         resourceLoadStatistics->updateTimerLastFired();
 #endif
@@ -210,6 +222,9 @@
 void PrivateClickMeasurementManager::firePendingAttributionRequests()
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
+    if (!m_networkSession)
+        return;
+
     auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics();
     if (!resourceLoadStatistics)
         return;
@@ -250,6 +265,9 @@
     m_firePendingAttributionRequestsTimer.stop();
 
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
+    if (!m_networkSession)
+        return;
+
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
         resourceLoadStatistics->clearPrivateClickMeasurement();
 #endif
@@ -258,6 +276,9 @@
 void PrivateClickMeasurementManager::clearForRegistrableDomain(const RegistrableDomain& domain)
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
+    if (!m_networkSession)
+        return;
+
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
         resourceLoadStatistics->clearPrivateClickMeasurementForRegistrableDomain(domain);
 #endif
@@ -266,6 +287,9 @@
 void PrivateClickMeasurementManager::clearExpired()
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
+    if (!m_networkSession)
+        return;
+
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
         resourceLoadStatistics->clearExpiredPrivateClickMeasurement();
 #endif
@@ -274,6 +298,9 @@
 void PrivateClickMeasurementManager::toString(CompletionHandler<void(String)>&& completionHandler) const
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
+    if (!m_networkSession)
+        return;
+
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
         resourceLoadStatistics->privateClickMeasurementToString(WTFMove(completionHandler));
 #endif
@@ -290,6 +317,9 @@
 void PrivateClickMeasurementManager::markAllUnattributedAsExpiredForTesting()
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
+    if (!m_networkSession)
+        return;
+
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
         resourceLoadStatistics->markAllUnattributedPrivateClickMeasurementAsExpiredForTesting();
 #endif
@@ -308,6 +338,9 @@
 void PrivateClickMeasurementManager::markAttributedPrivateClickMeasurementsAsExpiredForTesting(CompletionHandler<void()>&& completionHandler)
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
+    if (!m_networkSession)
+        return;
+
     if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics()) {
         resourceLoadStatistics->markAttributedPrivateClickMeasurementsAsExpiredForTesting(WTFMove(completionHandler));
         return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to