Bug 135365

Summary: Add an explicit way to initialize shared TextEncoding mappings besides accessing them.
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   

Description Brady Eidson 2014-07-28 16:11:30 PDT
Add an explicit way to initialize shared TextEncoding mappings besides accessing them.

In a few places in code we know UTF8Encoding() will be accessed on a background thread, possibly before the text encoding maps are ever set up on the main thread.

We "fix" this by accessing the UTF8Encoding() on the main thread before the background thread gets going.

See LocalStorageDatabaseTracker::LocalStorageDatabaseTracker in WK2 for example.

That's only for one encoding.  We should have an explicit, obvious way of initializing all the common TextEncodings from the main thread when this comes up.

<rdar://problem/9127819>