Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Side by Side Diff: base/synchronization/cancellation_flag.cc

Issue 2163023002: Unify usage of logging/assert macros in base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/synchronization/cancellation_flag.h" 5 #include "base/synchronization/cancellation_flag.h"
6 6
7 #include "base/logging.h"
8
9 namespace base { 7 namespace base {
10 8
11 void CancellationFlag::Set() { 9 void CancellationFlag::Set() {
12 #if !defined(NDEBUG) 10 #if DCHECK_IS_ON()
13 DCHECK_EQ(set_on_, PlatformThread::CurrentId()); 11 DCHECK_EQ(set_on_, PlatformThread::CurrentId());
14 #endif 12 #endif
15 base::subtle::Release_Store(&flag_, 1); 13 base::subtle::Release_Store(&flag_, 1);
16 } 14 }
17 15
18 bool CancellationFlag::IsSet() const { 16 bool CancellationFlag::IsSet() const {
19 return base::subtle::Acquire_Load(&flag_) != 0; 17 return base::subtle::Acquire_Load(&flag_) != 0;
20 } 18 }
21 19
22 void CancellationFlag::UnsafeResetForTesting() { 20 void CancellationFlag::UnsafeResetForTesting() {
23 base::subtle::Release_Store(&flag_, 0); 21 base::subtle::Release_Store(&flag_, 0);
24 } 22 }
25 23
26 } // namespace base 24 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698