Bug 203875
| Summary: | JSC should not be using WTF::String::createCFString(). | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Mark Lam <mark.lam> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | fpizlo, keith_miller, msaboff, rmorisset, saam, tzagallo, ysuzuki |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=203873 | ||
Mark Lam
After https://bugs.webkit.org/show_bug.cgi?id=203873, there's only one instance of this bad idiom: formatLocaleDate() in DatePrototype.cpp.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Yusuke Suzuki
There is other WTF functions that are internally using createCFString (like, mac/FileSystemMac.mm). So they should be changed too since these functions can be called from JSC.
Keith Miller
Why is this a bad idiom? Just because we don't want to allocate CF strings?
Mark Lam
(In reply to Keith Miller from comment #2)
> Why is this a bad idiom? Just because we don't want to allocate CF strings?
Because String::createCFString() uses StringImpl::createCFString(), which relies on the concept of isMainThread(), which is only meaningful if WebCore is the client of JSC. For all other clients, this can result in badness.