Bug 34611

Summary: WebLocalizedString() could use an assertion that it is being called on the main thread
Product: WebKit Reporter: John Sullivan <sullivan>
Component: WebKit Misc.Assignee: John Sullivan <sullivan>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: All   
Attachments:
Description Flags
Patch to add an assertion. timothy: review+

John Sullivan
Reported 2010-02-04 13:13:19 PST
WebLocalizedString() in WebLocalizableStrings.m is not thread-safe because it performs no internal locking when setting or using the value of a static variable. Also, it calls -[NSBundle localizedStringForKey:], which is not guaranteed to be thread-safe. To catch thread-safety issues, it would be useful to assert that this function is being called on the main thread.
Attachments
Patch to add an assertion. (12.50 KB, patch)
2010-02-04 13:41 PST, John Sullivan
timothy: review+
John Sullivan
Comment 1 2010-02-04 13:41:09 PST
Created attachment 48166 [details] Patch to add an assertion.
John Sullivan
Comment 2 2010-02-04 13:46:13 PST
Note You need to log in before you can comment on or make changes to this bug.