Bug 230954

Summary: Make WebLocalizedString() thread-safe
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, darin, ggaren, sam, simon.fraser, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Chris Dumez 2021-09-29 07:54:22 PDT
Make WebLocalizedString() thread-safe. It takes minimal effort to make it thread-safe given that the NSBundle API is thread-safe and clients keep calling it on the background thread.
Comment 1 Chris Dumez 2021-09-29 07:59:08 PDT
Created attachment 439607 [details]
Patch
Comment 2 Alexey Proskuryakov 2021-09-29 08:37:04 PDT
Comment on attachment 439607 [details]
Patch

Seems like a bad idea to me. This assertion caught thread safety bug in important clients several times in recent memory.

One could claim that we shouldn't care because those re client bugs not WebKit ones; I will not agree with that.
Comment 3 Alexey Proskuryakov 2021-09-29 08:49:16 PDT
Comment on attachment 439607 [details]
Patch

I've been told that all those recent instances were not real bugs, and it was OK to call WebLocalizedString on background threads then. So r+.
Comment 4 EWS 2021-09-29 09:12:39 PDT
Committed r283225 (242267@main): <https://commits.webkit.org/242267@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 439607 [details].
Comment 5 Radar WebKit Bug Importer 2021-09-29 09:13:15 PDT
<rdar://problem/83673645>