Bug 210751

Summary: Exit early in FrameLoader::loadURL when redirecting to another frame
Product: WebKit Reporter: Rob Buis <rbuis>
Component: New BugsAssignee: Rob Buis <rbuis>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, darin, ews-watchlist, ggaren, japhet, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

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>