commit | 554fe52258a089b2e1d3100c9329a3a91d72e96d | [log] [tgz] |
---|---|---|
author | Sylvain Defresne <sdefresne@chromium.org> | Fri Sep 09 12:28:53 2022 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Sep 09 12:28:53 2022 |
tree | 8fb3a16253f631f06220c1bcb5901dd862e5dfb2 | |
parent | 45ac09aa737f70b951519b39bbcdf40a3b11cbaa [diff] |
[apple] Fix thread-safety issue in GetDisplayNameForLocale() The function GetDisplayNameForLocale() is called from multiple threads concurrently but has unprotected access to a global value that is mutated in the function, which results in KABOOM. Remove the glocal cache to make the code thread-safe. The cache may be needed if NSLocale construction is expensive, but is hard to keep around as this code is called on the main thread and so cannot use a base::Lock to simply protect the cache. Once the thread-safety issue is resolved, it will be possible to investigate whether a cache is indeed required, and if so, it will be written with thread-safety in mind (probably using so TLS storage). Move the function (and its tests) to files that are only build on iOS. Fixed: 1349345 Change-Id: Ib9ea4620280533bbff77aab234cc6940d46ccf7d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3879562 Auto-Submit: Sylvain Defresne <sdefresne@chromium.org> Commit-Queue: Sylvain Defresne <sdefresne@chromium.org> Reviewed-by: Rohit Rao <rohitrao@chromium.org> Reviewed-by: Jungshik Shin <jshin@chromium.org> Cr-Commit-Position: refs/heads/main@{#1045050}
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.
To check out the source code locally, don't use git clone
! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.