Bug 230954 - Make WebLocalizedString() thread-safe
Summary: Make WebLocalizedString() thread-safe
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-29 07:54 PDT by Chris Dumez
Modified: 2021-09-29 09:13 PDT (History)
8 users (show)

See Also:


Attachments
Patch (2.48 KB, patch)
2021-09-29 07:59 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>