Bug 136392 - Use UTF8Encoding in more places
Summary: Use UTF8Encoding in more places
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-29 15:51 PDT by Joseph Pecoraro
Modified: 2014-08-29 17:28 PDT (History)
4 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (7.39 KB, patch)
2014-08-29 15:53 PDT, Joseph Pecoraro
joepeck: commit-queue-
Details | Formatted Diff | Diff

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