Bug 188820 - Remove extern variable and simplify state initialization in TextCheckerMac.mm
Summary: Remove extern variable and simplify state initialization in TextCheckerMac.mm
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Mac macOS 10.13
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-08-21 15:07 PDT by Daniel Bates
Modified: 2018-08-27 10:10 PDT (History)
3 users (show)

See Also:


Attachments
Patch (13.66 KB, patch)
2018-08-21 15:12 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2018-08-21 15:07:55 PDT
Currently TextCheckerMac.mm stores the TextCheckerState object in a file-local variables that has external linkage. This is unnecessary. Moreover we need to do a dance with other static variables to initialize this external variable exactly once per process. We should use a static file-local, non-member function and NeverDestroyed to simplify this code.
Comment 1 Daniel Bates 2018-08-21 15:12:02 PDT
Created attachment 347707 [details]
Patch
Comment 2 Daniel Bates 2018-08-27 10:09:25 PDT
Comment on attachment 347707 [details]
Patch

Clearing flags on attachment: 347707

Committed r235379: <https://trac.webkit.org/changeset/235379>
Comment 3 Daniel Bates 2018-08-27 10:09:27 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2018-08-27 10:10:17 PDT
<rdar://problem/43758177>