Bug 136392

Summary: Use UTF8Encoding in more places
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, benjamin, commit-queue, japhet
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[PATCH] Proposed Fix joepeck: commit-queue-

Description Joseph Pecoraro 2014-08-29 15:51:33 PDT
There were a few places that were constructing a TextEncoding from a string where we can use the global singleton.
Comment 1 Joseph Pecoraro 2014-08-29 15:53:11 PDT
Created attachment 237384 [details]
[PATCH] Proposed Fix
Comment 2 Alexey Proskuryakov 2014-08-29 17:24:57 PDT
Comment on attachment 237384 [details]
[PATCH] Proposed Fix

This makes me nervous about thread safety. XMLHttpRequest can live in a worker thread, and UTF8Encoding() function is not thread safe. I'm not sure how thread safe TextEncoding itself is.
Comment 3 Alexey Proskuryakov 2014-08-29 17:26:28 PDT
I think that all or almost all of TextEncoding and actual codec are thread safe, so it's probably just the UTF8Encoding() function that's a concern.
Comment 4 Joseph Pecoraro 2014-08-29 17:28:21 PDT
Comment on attachment 237384 [details]
[PATCH] Proposed Fix

Alexey mentioned there might be threading concerns here. The XMLHttpRequest and WorkerScriptLoader seem like they could be used from a non-main thread. This requires more thought. Putting cq- and clearing review flag for now.