Bug 210759 - When SpeculativeLoadManager is destroyed, properly clean up its PendingFrameLoads
Summary: When SpeculativeLoadManager is destroyed, properly clean up its PendingFrameL...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
: 210744 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-04-20 12:15 PDT by Alex Christensen
Modified: 2020-05-08 13:05 PDT (History)
6 users (show)

See Also:


Attachments
Patch (2.93 KB, patch)
2020-04-20 12:21 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (2.70 KB, patch)
2020-04-20 12:30 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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