Changeset 247190 in webkit
- Timestamp:
- Jul 5, 2019 5:33:44 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r247188 r247190 1 2019-07-05 Chris Dumez <cdumez@apple.com> 2 3 Fix thread safety bug in WebResourceLoadStatisticsTelemetry::calculateAndSubmit() 4 https://bugs.webkit.org/show_bug.cgi?id=199536 5 6 Reviewed by Youenn Fablet. 7 8 The resourceLoadStatisticsStore is an object that is created / used / destroyed on the background 9 queue. It is therefore not safe to create a WeakPtr for it and use that WeakPtr on the main thread. 10 11 * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp: 12 (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): 13 1 14 2019-07-05 Michael Catanzaro <mcatanzaro@igalia.com> 2 15 -
trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp
r246034 r247190 239 239 240 240 // Dispatch on the main thread to make sure the WebPageProxy we're using doesn't go away. 241 RunLoop::main().dispatch([sortedPrevalentResources = WTFMove(sortedPrevalentResources), sortedPrevalentResourcesWithoutUserInteraction = WTFMove(sortedPrevalentResourcesWithoutUserInteraction), prevalentResourcesDaysSinceUserInteraction = WTFMove(prevalentResourcesDaysSinceUserInteraction), resourceLoadStatisticsStore = makeWeakPtr(resourceLoadStatisticsStore)] () { 242 if (!resourceLoadStatisticsStore) 243 return; 244 241 RunLoop::main().dispatch([sortedPrevalentResources = WTFMove(sortedPrevalentResources), sortedPrevalentResourcesWithoutUserInteraction = WTFMove(sortedPrevalentResourcesWithoutUserInteraction), prevalentResourcesDaysSinceUserInteraction = WTFMove(prevalentResourcesDaysSinceUserInteraction), store = makeRef(resourceLoadStatisticsStore.store())] () { 245 242 auto webPageProxy = WebPageProxy::nonEphemeralWebPageProxy(); 246 243 if (!webPageProxy) { 247 244 if (notifyPagesWhenTelemetryWasCaptured) 248 notifyPages(0, 0, 0, resourceLoadStatisticsStore->store());245 notifyPages(0, 0, 0, store); 249 246 return; 250 247 } 251 248 252 249 if (notifyPagesWhenTelemetryWasCaptured) { 253 notifyPages(sortedPrevalentResources, sortedPrevalentResourcesWithoutUserInteraction, prevalentResourcesDaysSinceUserInteraction.size(), resourceLoadStatisticsStore->store());250 notifyPages(sortedPrevalentResources, sortedPrevalentResourcesWithoutUserInteraction, prevalentResourcesDaysSinceUserInteraction.size(), store); 254 251 // The notify pages function is for testing so we don't need to do an actual submission. 255 252 return; … … 264 261 webPageProxy->logDiagnosticMessageWithValue(DiagnosticLoggingKeys::resourceLoadStatisticsTelemetryKey(), "medianPrevalentResourcesWithUserInteractionDaysSinceUserInteraction"_s, median(prevalentResourcesDaysSinceUserInteraction), significantFiguresForLoggedValues, ShouldSample::No); 265 262 266 submitTopLists(sortedPrevalentResources, sortedPrevalentResourcesWithoutUserInteraction, resourceLoadStatisticsStore->store());263 submitTopLists(sortedPrevalentResources, sortedPrevalentResourcesWithoutUserInteraction, store); 267 264 }); 268 265 }
Note: See TracChangeset
for help on using the changeset viewer.