Bug 210751 - Exit early in FrameLoader::loadURL when redirecting to another frame
Summary: Exit early in FrameLoader::loadURL when redirecting to another frame
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Buis
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-04-20 10:10 PDT by Rob Buis
Modified: 2020-04-21 03:32 PDT (History)
6 users (show)

See Also:


Attachments
Patch (4.40 KB, patch)
2020-04-20 10:11 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (4.43 KB, patch)
2020-04-21 00:09 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (5.02 KB, patch)
2020-04-21 01:22 PDT, 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-04-20 10:10:09 PDT
Exit early in FrameLoader::loadURL when redirecting to another frame, previously we were preparing
request needlessly, doing it twice in case of frame redirecting. Also move some variables to
where they are actually used.
Comment 1 Rob Buis 2020-04-20 10:11:58 PDT
Created attachment 396984 [details]
Patch
Comment 2 Geoffrey Garen 2020-04-20 11:47:36 PDT
Comment on attachment 396984 [details]
Patch

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

r=me

> Source/WebCore/loader/FrameLoader.cpp:1358
> +    Frame* targetFrame = isFormSubmission ? nullptr : findFrameForNavigation(effectiveFrameName);

This should be RefPtr.
Comment 3 Darin Adler 2020-04-20 12:39:11 PDT
Comment on attachment 396984 [details]
Patch

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

>> Source/WebCore/loader/FrameLoader.cpp:1358
>> +    Frame* targetFrame = isFormSubmission ? nullptr : findFrameForNavigation(effectiveFrameName);
> 
> This should be RefPtr.

I think our latest style would be:

    auto targetFrame = isFormSubmission ? nullptr : makeRefPtr(findFrameForNavigation(effectiveFrameName));

Or change findFrameForNavigation to return a RefPtr. Move the makeRefPtr outside the ? : if needed to make things compile.
Comment 4 Rob Buis 2020-04-21 00:09:45 PDT
Created attachment 397060 [details]
Patch
Comment 5 Rob Buis 2020-04-21 01:22:43 PDT
Created attachment 397062 [details]
Patch
Comment 6 EWS 2020-04-21 03:31:13 PDT
Committed r260423: <https://trac.webkit.org/changeset/260423>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 397062 [details].
Comment 7 Radar WebKit Bug Importer 2020-04-21 03:32:13 PDT
<rdar://problem/62099510>