Bug 176088

Summary: Stop using PolicyCallback
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, commit-queue, darin, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Alex Christensen 2017-08-29 19:41:23 PDT
Stop using PolicyCallback
Comment 1 Alex Christensen 2017-08-29 19:43:32 PDT
Created attachment 319324 [details]
Patch
Comment 2 Alex Christensen 2017-08-29 20:36:08 PDT
Comment on attachment 319324 [details]
Patch

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

> Source/WebCore/loader/PolicyChecker.cpp:-184
>      m_frame.loader().client().cancelPolicyCheck();
> -    PolicyCallback callback = WTFMove(m_callback);
> -    callback.cancel();

Cancelling the callback is now the responsibility of the FrameLoaderClient, to whom we have given the lambda.  That is why there are changes in WebKit and WebKitLegacy where the FrameLoaderClient::cancelPolicyCheck finds the lambda it has stored.
Comment 3 Alex Christensen 2017-08-30 10:33:05 PDT
Created attachment 319378 [details]
Patch
Comment 4 Andy Estes 2017-08-31 13:34:39 PDT
Comment on attachment 319378 [details]
Patch

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

> Source/WebCore/loader/PolicyChecker.cpp:147
> +    ResourceRequest requestCopy = request;
> +    m_frame.loader().client().dispatchDecidePolicyForNavigationAction(action, request, didReceiveRedirectResponse, formState, [this, function = WTFMove(function), request = WTFMove(requestCopy), formState = makeRefPtr(formState), suggestedFilename = WTFMove(suggestedFilename)](PolicyAction policyAction) mutable {

You can just capture request by value instead of explicitly making a copy.
Comment 5 Alex Christensen 2017-08-31 13:39:06 PDT
Created attachment 319513 [details]
Patch
Comment 6 WebKit Commit Bot 2017-08-31 13:40:06 PDT
Comment on attachment 319513 [details]
Patch

Rejecting attachment 319513 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-03', 'validate-changelog', '--check-oops', '--non-interactive', 319513, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

ChangeLog entry in Source/WebKit/ChangeLog contains OOPS!.

Full output: http://webkit-queues.webkit.org/results/4418705
Comment 7 Alex Christensen 2017-09-25 15:12:20 PDT
Created attachment 321750 [details]
Patch
Comment 8 Alex Christensen 2017-09-25 15:24:02 PDT
Created attachment 321757 [details]
Patch
Comment 9 Alex Christensen 2017-09-25 15:33:35 PDT
http://trac.webkit.org/r222472
Comment 10 Radar WebKit Bug Importer 2017-09-27 12:59:31 PDT
<rdar://problem/34694436>
Comment 11 Michael Catanzaro 2017-10-26 16:52:47 PDT
*** Bug 175913 has been marked as a duplicate of this bug. ***