commit | d773f1267311fd6af666d194bb0dd5dc5c36d53e | [log] [tgz] |
---|---|---|
author | Gabriel Charette <[email protected]> | Tue Mar 19 22:06:38 2019 |
committer | Commit Bot <[email protected]> | Tue Mar 19 22:06:38 2019 |
tree | af1013b82aa035307c85ee455d62e59740e82be6 | |
parent | 6c0c3594da25d79230c40c97891eab0239f03045 [diff] |
[base] Remove NO_THREAD_SAFETY_ANALYSIS from base::Optional This brings base::Optional inline with absl::optional if we decide to switch (https://crrev.com/c/1277105) and is the right thing to do even if we don't (mass disabling TSAN is dangerous). Introduce base::AutoLockMaybe and base::ReleasableAutoLock (inspired from matching absl types) to fix existing base::Optional<base::AutoLock> usage. google3 differs in philosophy in that they prefer explicit Acquire()/Release() for such use case but Chromium has a strong preference for RAII locking everywhere so I think these are preferable. The difference in philosophy is justifiable by them having had static-thread-safety-analysis on locks for much longer than us (and thus the safety guarantees provided by RAII locking aren't necessary there -- we could argue this in Chromium too but that's outside the scope of this change). Exposing explicit types instead of supporting these use cases directly on AutoLock avoids abuse where unnecessary. TBR=rockot@ (mojo/ side-effects) Bug: 881875, 831825 Change-Id: I241fcd673deb8470791d759e45c374264081feea Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1512302 Reviewed-by: danakj <[email protected]> Reviewed-by: Antoine Labour <[email protected]> Reviewed-by: François Doray <[email protected]> Reviewed-by: Alex Clarke <[email protected]> Reviewed-by: Łukasz Anforowicz <[email protected]> Commit-Queue: Gabriel Charette <[email protected]> Cr-Commit-Position: refs/heads/master@{#642206}
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 .