Bug 183534

Summary: [WebAuthn] Optimize LocalAuthenticator
Product: WebKit Reporter: Jiewen Tan <jiewen_tan>
Component: WebCore Misc.Assignee: Jiewen Tan <jiewen_tan>
Severity: Normal CC: alex.gaynor, bfulgham, jiewen_tan, jonathan, jschoi, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 181943    
Description Flags
Patch none

Description Jiewen Tan 2018-03-09 15:54:13 PST
Optimize LocalAuthenticator.
Comment 1 Jiewen Tan 2018-03-09 15:56:33 PST
1) Optimize the nested callbacks.
2) Don't let authData throttle.
3) Test IDN of RP.ID.
Comment 2 Jiewen Tan 2018-03-14 22:28:46 PDT
4) Figure out a better way to pass variables to objc block in another thread.
5) Optimize threading.
6) Replace weak pointers with other mechanism as they don't work in another thread.
Comment 3 Jiewen Tan 2018-03-21 17:02:30 PDT
7) Change little endian bytes (ARM and x86 default) to big endian as requested by the spec.
8) Better manage lifetime of LAContext passed around different threads. A solution could be all LAContext objects are stored in a map managed by LocalAuthenticator, and freed by callbacks happened in mainthread. That means using callOnMainThread to executing every callbacks. This will also resolve the WeakPtr issue.
9) Unify callbacks and use variant to handle exceptions.
Comment 4 Jiewen Tan 2018-03-27 11:47:27 PDT
10) Move constants from LocalAuthenticator.mm to a separate header.
Comment 5 Radar WebKit Bug Importer 2018-08-15 17:09:23 PDT
Comment 6 Jiewen Tan 2018-09-08 20:57:04 PDT
Fixed 9) in Bug 189277.
Comment 7 Jiewen Tan 2018-09-21 22:09:16 PDT
Fixed 1), 4), 5), 6), and 8) in Bug 189279.
Comment 8 Jiewen Tan 2019-01-04 13:22:39 PST
2) and 7) are fixed in Bug 193150.
Comment 9 Jiewen Tan 2020-02-19 18:29:51 PST
11) Consider using initWithBytesNoCopy with toNSData().
Comment 10 Jiewen Tan 2020-03-08 22:03:43 PDT
12) Combine m_assertionResponses and m_existingCredentials.
Comment 11 Jiewen Tan 2020-03-08 22:04:34 PDT
13) Find a better way of comparing credential id. Doing it with array seems fine given the list should be small.
Comment 12 Jiewen Tan 2020-03-22 20:50:03 PDT
14) Invalidate the LAContext when LocalConnection is destroyed.
Comment 13 Jiewen Tan 2020-04-21 11:42:49 PDT
15) Sort credentials according to LRU before returning to UI clients.
Comment 14 Jiewen Tan 2020-04-27 15:42:04 PDT
Created attachment 397752 [details]
Comment 15 Brent Fulgham 2020-04-30 13:03:48 PDT
Comment on attachment 397752 [details]

Comment 16 Jiewen Tan 2020-04-30 15:22:13 PDT
Comment on attachment 397752 [details]

Thanks Brent for the r+.
Comment 17 EWS 2020-04-30 15:27:07 PDT
Committed r260970: <https://trac.webkit.org/changeset/260970>

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