Changeset 240346 in webkit


Ignore:
Timestamp:
Jan 23, 2019 10:44:34 AM (5 years ago)
Author:
Brent Fulgham
Message:

REGRESSION (r240243): CrashTracer: WebKitTestRunnerApp at com.apple.WebKit: WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const + 32
https://bugs.webkit.org/show_bug.cgi?id=193723
<rdar://problem/47476802>

Reviewed by David Kilzer.

The new code added in r240243 could attempt to submit telemetry after the relevant
WebResourceLoadStatisticsStore was destroyed. We should guard against this possibility.

  • NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:

(WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r240343 r240346  
     12019-01-23  Brent Fulgham  <bfulgham@apple.com>
     2
     3        REGRESSION (r240243): CrashTracer: WebKitTestRunnerApp at com.apple.WebKit: WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const + 32
     4        https://bugs.webkit.org/show_bug.cgi?id=193723
     5        <rdar://problem/47476802>
     6
     7        Reviewed by David Kilzer.
     8
     9        The new code added in r240243 could attempt to submit telemetry after the relevant
     10        WebResourceLoadStatisticsStore was destroyed. We should guard against this possibility.
     11
     12        * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
     13        (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
     14
    1152019-01-23  Antti Koivisto  <antti@apple.com>
    216
  • trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp

    r240243 r240346  
    242242   
    243243    // Dispatch on the main thread to make sure the WebPageProxy we're using doesn't go away.
    244     RunLoop::main().dispatch([sortedPrevalentResources = WTFMove(sortedPrevalentResources), sortedPrevalentResourcesWithoutUserInteraction = WTFMove(sortedPrevalentResourcesWithoutUserInteraction), prevalentResourcesDaysSinceUserInteraction = WTFMove(prevalentResourcesDaysSinceUserInteraction), &resourceLoadStatisticsStore] () {
     244    RunLoop::main().dispatch([sortedPrevalentResources = WTFMove(sortedPrevalentResources), sortedPrevalentResourcesWithoutUserInteraction = WTFMove(sortedPrevalentResourcesWithoutUserInteraction), prevalentResourcesDaysSinceUserInteraction = WTFMove(prevalentResourcesDaysSinceUserInteraction), resourceLoadStatisticsStore = makeWeakPtr(resourceLoadStatisticsStore)] () {
     245        if (!resourceLoadStatisticsStore)
     246            return;
     247
    245248        auto webPageProxy = WebPageProxy::nonEphemeralWebPageProxy();
    246249        if (!webPageProxy) {
    247250            if (notifyPagesWhenTelemetryWasCaptured)
    248                 notifyPages(0, 0, 0, resourceLoadStatisticsStore.store());
     251                notifyPages(0, 0, 0, resourceLoadStatisticsStore->store());
    249252            return;
    250253        }
    251254       
    252255        if (notifyPagesWhenTelemetryWasCaptured) {
    253             notifyPages(sortedPrevalentResources, sortedPrevalentResourcesWithoutUserInteraction, prevalentResourcesDaysSinceUserInteraction.size(), resourceLoadStatisticsStore.store());
     256            notifyPages(sortedPrevalentResources, sortedPrevalentResourcesWithoutUserInteraction, prevalentResourcesDaysSinceUserInteraction.size(), resourceLoadStatisticsStore->store());
    254257            // The notify pages function is for testing so we don't need to do an actual submission.
    255258            return;
     
    264267            webPageProxy->logDiagnosticMessageWithValue(DiagnosticLoggingKeys::resourceLoadStatisticsTelemetryKey(), "medianPrevalentResourcesWithUserInteractionDaysSinceUserInteraction"_s, median(prevalentResourcesDaysSinceUserInteraction), significantFiguresForLoggedValues, ShouldSample::No);
    265268       
    266         submitTopLists(sortedPrevalentResources, sortedPrevalentResourcesWithoutUserInteraction, resourceLoadStatisticsStore.store());
     269        submitTopLists(sortedPrevalentResources, sortedPrevalentResourcesWithoutUserInteraction, resourceLoadStatisticsStore->store());
    267270    });
    268271}
Note: See TracChangeset for help on using the changeset viewer.