Bug 210759

Summary: When SpeculativeLoadManager is destroyed, properly clean up its PendingFrameLoads
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, cgarcia, darin, ews-watchlist, jacob_uphoff, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=210768
Attachments:
Description Flags
Patch
none
Patch none

Description Alex Christensen 2020-04-20 12:15:02 PDT
When SpeculativeLoadManager is destroyed, properly clean up its PendingFrameLoads
Comment 1 Alex Christensen 2020-04-20 12:21:06 PDT
Created attachment 396999 [details]
Patch
Comment 2 Alex Christensen 2020-04-20 12:21:09 PDT
<rdar://problem/62056856>
Comment 3 Darin Adler 2020-04-20 12:28:33 PDT
Comment on attachment 396999 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=396999&action=review

> Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:274
> +    Vector<RefPtr<PendingFrameLoad>> pendingFrameLoads;
> +    pendingFrameLoads.reserveInitialCapacity(m_pendingFrameLoads.size());
> +    for (auto& pendingFrameLoad : m_pendingFrameLoads.values())
> +        pendingFrameLoads.uncheckedAppend(pendingFrameLoad);
> +    for (auto& pendingFrameLoad : pendingFrameLoads) {

You should be able to write this instead and get exactly the same effect:

    for (auto& pendingFrameLoad : copyToVector(m_pendingFrameLoads.values()))
Comment 4 Alex Christensen 2020-04-20 12:30:11 PDT
Created attachment 397002 [details]
Patch
Comment 5 Alex Christensen 2020-04-20 12:35:08 PDT
Comment on attachment 397002 [details]
Patch

Aha!  That's the idiom I was looking for.
Comment 6 EWS 2020-04-20 13:04:54 PDT
Committed r260390: <https://trac.webkit.org/changeset/260390>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 397002 [details].
Comment 7 Alex Christensen 2020-04-20 13:16:34 PDT
*** Bug 210744 has been marked as a duplicate of this bug. ***
Comment 8 Alex Christensen 2020-05-08 13:05:43 PDT
Reverted in http://trac.webkit.org/r261405