Bug 219853 - Remove FrameLoader::cancelAndClear
Summary: Remove FrameLoader::cancelAndClear
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Buis
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-12-14 07:11 PST by Rob Buis
Modified: 2020-12-17 14:11 PST (History)
6 users (show)

See Also:


Attachments
Patch (5.21 KB, patch)
2020-12-14 07:19 PST, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (2.97 KB, patch)
2020-12-15 07:46 PST, Rob Buis
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Buis 2020-12-14 07:11:18 PST
Remove FrameLoader::cancelAndClear.
Comment 1 Rob Buis 2020-12-14 07:19:53 PST
Created attachment 416154 [details]
Patch
Comment 2 Alex Christensen 2020-12-14 11:56:11 PST
Comment on attachment 416154 [details]
Patch

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

> Source/WebCore/page/Frame.h:340
> +    FrameLoader* m_loader;

We don't want to increase the storage of raw pointers.  This is how use-after-free bugs arise.
Comment 3 Rob Buis 2020-12-15 07:46:03 PST
Created attachment 416245 [details]
Patch
Comment 4 Rob Buis 2020-12-15 14:25:47 PST
Comment on attachment 416154 [details]
Patch

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

>> Source/WebCore/page/Frame.h:340
>> +    FrameLoader* m_loader;
> 
> We don't want to increase the storage of raw pointers.  This is how use-after-free bugs arise.

That is a good rule. It is just a pity that the smart pointers do not work well in this case, i.e call the destructor but keep the inner raw pointer around while the destructor is in process. Anyway, I found an alternative approach.
Comment 5 EWS 2020-12-15 23:34:03 PST
Committed r270881: <https://trac.webkit.org/changeset/270881>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 416245 [details].
Comment 6 Radar WebKit Bug Importer 2020-12-17 14:11:42 PST
<rdar://problem/72440511>