Bug 231963

Summary: WebAuthn Platform UI callbacks are not guaranteed to happen on the main thread
Product: WebKit Reporter: Garrett Davidson <garrett_davidson>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, ews-watchlist, garrett_davidson, jiewen_tan, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Garrett Davidson
Reported 2021-10-19 10:00:27 PDT
WebAuthn Platform UI callbacks are not guaranteed to happen on the main thread
Attachments
Patch (10.96 KB, patch)
2021-10-19 10:12 PDT, Garrett Davidson
no flags
Patch (10.94 KB, patch)
2021-10-19 11:27 PDT, Garrett Davidson
no flags
Patch (10.88 KB, patch)
2021-10-19 12:36 PDT, Garrett Davidson
no flags
Garrett Davidson
Comment 1 2021-10-19 10:12:48 PDT
Radar WebKit Bug Importer
Comment 2 2021-10-19 10:14:22 PDT
Brent Fulgham
Comment 3 2021-10-19 10:54:51 PDT
Comment on attachment 441748 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=441748&action=review > Source/WebKit/ChangeLog:4 > + https://bugs.webkit.org/show_bug.cgi?id=231963 Please add: <rdar://84420452> > Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm:268 > + dispatch_async(dispatch_get_main_queue(), makeBlockPtr([weakThis, handler = WTFMove(handler), window = WTFMove(window), proxy = WTFMove(proxy), daemonEndpoint = retainPtr(daemonEndpoint), error = retainPtr(error)] () mutable { This would be better as: callOnMainThread([weakThis, handler = WTFMove(handler), window = WTFMove(window), proxy = WTFMove(proxy), daemonEndpoint = retainPtr(daemonEndpoint), error = retainPtr(error)] { ... }
Garrett Davidson
Comment 4 2021-10-19 11:27:23 PDT
Brent Fulgham
Comment 5 2021-10-19 12:02:34 PDT
Comment on attachment 441763 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=441763&action=review r=me, but please adjust the 'protectedThis' naming to reflect that this is a weak pointer, and does not hold the instance alive. > Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm:270 > + auto protectedThis = weakThis.get(); protectedThis is a bad name for a WeakPtr -- can we just use 'weakThis'? I don't think we need to pull a bare pointer out of the WeakPtr wrapper (it should cast properly). 'protectedThis' implies we have a RetainPtr that is holding the object alive -- which is misleading in this case. > Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm:271 > + if (!protectedThis || !daemonEndpoint) { So this would just be "if (!weakThis || !daemonEndpoint) {" > Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm:277 > + protectedThis->m_presenter = adoptNS([allocASCAuthorizationRemotePresenterInstance() init]); Then these could just be "weakThis->m_presenter", etc.
Garrett Davidson
Comment 6 2021-10-19 12:36:01 PDT
Brent Fulgham
Comment 7 2021-10-19 12:43:23 PDT
Comment on attachment 441770 [details] Patch Looks great! Thanks.
EWS
Comment 8 2021-10-19 13:32:47 PDT
Committed r284489 (243243@main): <https://commits.webkit.org/243243@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 441770 [details].
Note You need to log in before you can comment on or make changes to this bug.