commit | e74848b50080a4715f69db8bc15186b3565aba68 | [log] [tgz] |
---|---|---|
author | Jeremy Roman <jbroman@chromium.org> | Wed Mar 13 19:13:27 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Wed Mar 13 19:13:27 2019 |
tree | 1d1b4d452680362d6ac76a900e4594fde8a59e90 | |
parent | 36c20c40aeed0cd5c5ecf840567299ac50f1b3ed [diff] |
Simplify StringImpl::CreateCFString. Currently, it does a clever trick if called on the main thread, where it uses a custom CFAllocator to hold a StringImpl reference next to the CFStringRef allocation and release it when the NSCFString is dealloced, posting a task to the main thread if necessary. Firstly, the number of places where this efficiency is likely to be helpful has significantly reduced, now that most OS interaction occurs in the browser process. Locale and font names are not long enough in practice to be worth this. Secondly, though this may not presently occur, this is not sufficient to ensure safety, since it assumes that the NSCFString can move from one thread to another, but the original WTF::String doesn't. The following sequence appears to be possible currently: - WTF::String created on main thread - NSCFString created from it - Object owning both moves to another thread - Object is destroyed, releasing both - NSCFString release task races with ~String Change-Id: I4bd2b0ca01dbe8a637d58f61bcebaf7c2f1e0006 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1521030 Commit-Queue: Jeremy Roman <jbroman@chromium.org> Commit-Queue: Avi Drissman <avi@chromium.org> Auto-Submit: Jeremy Roman <jbroman@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/master@{#640436}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .