Bug 221125

Summary: [WebAuthn] Optimize _WKWebAuthenticationPanelDelegate for native API
Product: WebKit Reporter: Jiewen Tan <jiewen_tan>
Component: WebKit Misc.Assignee: Jiewen Tan <jiewen_tan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, jiewen_tan, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 181943    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
ews-feeder: commit-queue-
Patch
bfulgham: review+
Patch for landing none

Description Jiewen Tan 2021-01-29 00:41:21 PST
Optimize _WKWebAuthenticationPanelDelegate for native API.
Comment 1 Jiewen Tan 2021-01-29 00:41:36 PST
<rdar://problem/71509141>
Comment 2 Jiewen Tan 2021-01-29 00:54:46 PST
Created attachment 418711 [details]
Patch
Comment 3 Jiewen Tan 2021-01-29 17:05:08 PST
Created attachment 418789 [details]
Patch
Comment 4 Jiewen Tan 2021-01-29 22:19:02 PST
Created attachment 418808 [details]
Patch
Comment 5 Jiewen Tan 2021-01-29 22:26:38 PST
Created attachment 418809 [details]
Patch
Comment 6 Brent Fulgham 2021-02-01 15:38:24 PST
Comment on attachment 418809 [details]
Patch

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

r=me

> Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp:509
> +    RunLoop::main().dispatch([weakPanel, call = WTFMove(call)] () {

Should we WTFMove() the weakPanel? We don't use it again outside the dispatch.

> Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:155
> +        [responses[0] setLAContext:laContext.get()];

Why not responses.firstObject?
Comment 7 Jiewen Tan 2021-02-01 15:47:24 PST
Comment on attachment 418809 [details]
Patch

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

Thanks Brent for r+ this patch.

>> Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp:509
>> +    RunLoop::main().dispatch([weakPanel, call = WTFMove(call)] () {
> 
> Should we WTFMove() the weakPanel? We don't use it again outside the dispatch.

Good catch. We can totally move that.

>> Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:155
>> +        [responses[0] setLAContext:laContext.get()];
> 
> Why not responses.firstObject?

Sure, it's totally doable. Since we check the count before, [0] shouldn't cause any issue.
Comment 8 Jiewen Tan 2021-02-01 16:02:15 PST
Created attachment 418937 [details]
Patch for landing
Comment 9 EWS 2021-02-01 18:50:06 PST
Committed r272184: <https://trac.webkit.org/changeset/272184>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 418937 [details].