Replace base::AtomicRefCount functions with member functions.
Also, the use of AtomicRefCount to check for cross-thread use of non-atomic
RefCounted is suspect (the guarantees provided by AtomicRefCount aren't
obviously strong enough for this use). Since this is only used for DCHECKs,
it seems simplest to have it use sequentially-consistent atomics and not
think about it further.
Bug: 736037
Tbr: [email protected]
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I1613e5f39fa814ceef3cec5bd25806179b65c978
Reviewed-on: https://chromium-review.googlesource.com/556014
Commit-Queue: Jeremy Roman <[email protected]>
Reviewed-by: danakj <[email protected]>
Reviewed-by: Dale Curtis <[email protected]>
Reviewed-by: Taiju Tsuiki <[email protected]>
Cr-Commit-Position: refs/heads/master@{#484700}
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 818d057..b07302c 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -442,9 +442,9 @@
void RundownTaskCounter::Post(base::SequencedTaskRunner* task_runner) {
// As the count starts off at one, it should never get to zero unless
// TimedWait has been called.
- DCHECK(!base::AtomicRefCountIsZero(&count_));
+ DCHECK(!count_.IsZero());
- base::AtomicRefCountInc(&count_);
+ count_.Increment();
// The task must be non-nestable to guarantee that it runs after all tasks
// currently scheduled on |task_runner| have completed.
@@ -453,7 +453,7 @@
}
void RundownTaskCounter::Decrement() {
- if (!base::AtomicRefCountDec(&count_))
+ if (!count_.Decrement())
waitable_event_.Signal();
}