Bug 207720 - Add missing call to completionHandler
Summary: Add missing call to completionHandler
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Rollin
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-02-13 14:06 PST by Keith Rollin
Modified: 2020-02-13 16:54 PST (History)
9 users (show)

See Also:


Attachments
Patch (1.98 KB, patch)
2020-02-13 14:20 PST, Keith Rollin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Rollin 2020-02-13 14:06:47 PST
Bug 179641 (r225702) updated SubresourceLoader::willSendRequestInternal with a return call without first calling the completionHandler. Address this by adding the call to the completionHandler.
Comment 1 Radar WebKit Bug Importer 2020-02-13 14:07:02 PST
<rdar://problem/59436915>
Comment 2 Keith Rollin 2020-02-13 14:20:19 PST
Created attachment 390686 [details]
Patch
Comment 3 Alex Christensen 2020-02-13 15:33:11 PST
Comment on attachment 390686 [details]
Patch

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

> Source/WebCore/loader/SubresourceLoader.cpp:242
> +                return completionHandler(WTFMove(newRequest));

If we reached terminal state, shouldn't we return completionHandler({ }); to not go through with the redirection?
Comment 4 WebKit Commit Bot 2020-02-13 15:53:42 PST
Comment on attachment 390686 [details]
Patch

Clearing flags on attachment: 390686

Committed r256569: <https://trac.webkit.org/changeset/256569>
Comment 5 WebKit Commit Bot 2020-02-13 15:53:43 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Chris Dumez 2020-02-13 16:38:17 PST
Comment on attachment 390686 [details]
Patch

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

>> Source/WebCore/loader/SubresourceLoader.cpp:242
>> +                return completionHandler(WTFMove(newRequest));
> 
> If we reached terminal state, shouldn't we return completionHandler({ }); to not go through with the redirection?

What Keith did seems consistent with other early return cases for error cases in this method.
Comment 7 Darin Adler 2020-02-13 16:43:09 PST
Comment on attachment 390686 [details]
Patch

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

> Source/WebCore/ChangeLog:15
> +        No new tests -- it's not possible to control execution into the
> +        affected code path.

Seems surprising. Why not? A limitation in our test machinery?
Comment 8 Chris Dumez 2020-02-13 16:54:29 PST
Comment on attachment 390686 [details]
Patch

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

>> Source/WebCore/ChangeLog:15
>> +        affected code path.
> 
> Seems surprising. Why not? A limitation in our test machinery?

If I understand the code correctly, you'd have to cancel the load just at the right time. Then since the load would be cancelled, I don't think there would be anything to observe from the web point-of-view. Since we fail to call the completion handler, the load simply will be hung on network process side I believe (likely until some timeout is reached), which again, would not be easily observable I believe.