Changeset 260390 in webkit


Ignore:
Timestamp:
Apr 20, 2020 1:04:49 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

When SpeculativeLoadManager is destroyed, properly clean up its PendingFrameLoads
https://bugs.webkit.org/show_bug.cgi?id=210759
<rdar://problem/62056856>

Patch by Alex Christensen <achristensen@webkit.org> on 2020-04-20
Reviewed by Darin Adler.

Recent work on the resourceLoadStatistics layout tests increased the amount we swap out the WebsiteDataStore.
When this happens, the NetworkSession is eventually destroyed in the NetworkProcess, sometimes when running the next test.
An assertion was firing in the PendingFrameLoad destructor because it hadn't been marked as complete when it was destroyed.
Rather than remove the assertion, when we destroy the SpeculativeLoadManager (which only happens when a WebsiteDataStore
is destroyed) during a speculative pending frame load, just mark the pending frame load as complete because it is being cancelled.
Marking the pending frame load as complete can tell the SpeculativeLoadManager to mutate m_pendingFrameLoads, which we don't want
to do while iterating, so copy the RefPtrs into a Vector first then iterate that to get them all.

This fixes an assertion that was sometimes hit in http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-database.html
but only after running other tests that had initiated speculative pending frame loads. This was ostensibly started by r260322 but is quite unrelated.

  • NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:

(WebKit::NetworkCache::SpeculativeLoadManager::~SpeculativeLoadManager):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r260387 r260390  
     12020-04-20  Alex Christensen  <achristensen@webkit.org>
     2
     3        When SpeculativeLoadManager is destroyed, properly clean up its PendingFrameLoads
     4        https://bugs.webkit.org/show_bug.cgi?id=210759
     5        <rdar://problem/62056856>
     6
     7        Reviewed by Darin Adler.
     8
     9        Recent work on the resourceLoadStatistics layout tests increased the amount we swap out the WebsiteDataStore.
     10        When this happens, the NetworkSession is eventually destroyed in the NetworkProcess, sometimes when running the next test.
     11        An assertion was firing in the PendingFrameLoad destructor because it hadn't been marked as complete when it was destroyed.
     12        Rather than remove the assertion, when we destroy the SpeculativeLoadManager (which only happens when a WebsiteDataStore
     13        is destroyed) during a speculative pending frame load, just mark the pending frame load as complete because it is being cancelled.
     14        Marking the pending frame load as complete can tell the SpeculativeLoadManager to mutate m_pendingFrameLoads, which we don't want
     15        to do while iterating, so copy the RefPtrs into a Vector first then iterate that to get them all.
     16
     17        This fixes an assertion that was sometimes hit in http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-database.html
     18        but only after running other tests that had initiated speculative pending frame loads.  This was ostensibly started by r260322 but is quite unrelated.
     19
     20        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
     21        (WebKit::NetworkCache::SpeculativeLoadManager::~SpeculativeLoadManager):
     22
    1232020-04-20  Stephan Szabo  <stephan.szabo@sony.com>
    224
  • trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp

    r260031 r260390  
    268268SpeculativeLoadManager::~SpeculativeLoadManager()
    269269{
     270    for (auto& pendingFrameLoad : copyToVector(m_pendingFrameLoads.values())) {
     271        if (pendingFrameLoad)
     272            pendingFrameLoad->markLoadAsCompleted();
     273    }
    270274}
    271275
Note: See TracChangeset for help on using the changeset viewer.