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

Side by Side Diff: base/atomic_ref_count.h

Issue 20378: Reduce the amount of included header files. Vast change like in "Oh God! This... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/ref_counted.h » ('j') | chrome/browser/memory_details.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 // This is a low level implementation of atomic semantics for reference 5 // This is a low level implementation of atomic semantics for reference
6 // counting. Please use base/ref_counted.h directly instead. 6 // counting. Please use base/ref_counted.h directly instead.
7 7
8 #ifndef BASE_ATOMIC_REF_COUNT_H_ 8 #ifndef BASE_ATOMIC_REF_COUNT_H_
9 #define BASE_ATOMIC_REF_COUNT_H_ 9 #define BASE_ATOMIC_REF_COUNT_H_
10 10
11 #include "base/atomicops.h" 11 #include "base/atomicops.h"
12 #include "base/basictypes.h"
13 12
14 namespace base { 13 namespace base {
15 14
16 typedef subtle::Atomic32 AtomicRefCount; 15 typedef subtle::Atomic32 AtomicRefCount;
17 16
18 // Increment a reference count by "increment", which must exceed 0. 17 // Increment a reference count by "increment", which must exceed 0.
19 inline void AtomicRefCountIncN(volatile AtomicRefCount *ptr, 18 inline void AtomicRefCountIncN(volatile AtomicRefCount *ptr,
20 AtomicRefCount increment) { 19 AtomicRefCount increment) {
21 subtle::NoBarrier_AtomicIncrement(ptr, increment); 20 subtle::NoBarrier_AtomicIncrement(ptr, increment);
22 } 21 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // referencing counting, the object will be destroyed, so the reference count 55 // referencing counting, the object will be destroyed, so the reference count
57 // should never be zero. Hence this is generally used for a debug check. 56 // should never be zero. Hence this is generally used for a debug check.
58 inline bool AtomicRefCountIsZero(volatile AtomicRefCount *ptr) { 57 inline bool AtomicRefCountIsZero(volatile AtomicRefCount *ptr) {
59 return subtle::Acquire_Load(ptr) == 0; 58 return subtle::Acquire_Load(ptr) == 0;
60 } 59 }
61 60
62 } // namespace base 61 } // namespace base
63 62
64 #endif // BASE_ATOMIC_REF_COUNT_H_ 63 #endif // BASE_ATOMIC_REF_COUNT_H_
65 64
OLDNEW
« no previous file with comments | « no previous file | base/ref_counted.h » ('j') | chrome/browser/memory_details.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698