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

Side by Side Diff: base/memory/ref_counted.cc

Issue 38553002: cc: Add tile pool to tile manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 | « base/memory/ref_counted.h ('k') | cc/base/ref_counted_managed.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/threading/thread_collision_warner.h" 8 #include "base/threading/thread_collision_warner.h"
9 9
10 namespace base { 10 namespace base {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #endif 44 #endif
45 if (--ref_count_ == 0) { 45 if (--ref_count_ == 0) {
46 #ifndef NDEBUG 46 #ifndef NDEBUG
47 in_dtor_ = true; 47 in_dtor_ = true;
48 #endif 48 #endif
49 return true; 49 return true;
50 } 50 }
51 return false; 51 return false;
52 } 52 }
53 53
54 void RefCountedBase::ClearInDtor() const {
55 #ifndef NDEBUG
56 in_dtor_ = false;
57 #endif
58 }
59
54 bool RefCountedThreadSafeBase::HasOneRef() const { 60 bool RefCountedThreadSafeBase::HasOneRef() const {
55 return AtomicRefCountIsOne( 61 return AtomicRefCountIsOne(
56 &const_cast<RefCountedThreadSafeBase*>(this)->ref_count_); 62 &const_cast<RefCountedThreadSafeBase*>(this)->ref_count_);
57 } 63 }
58 64
59 RefCountedThreadSafeBase::RefCountedThreadSafeBase() : ref_count_(0) { 65 RefCountedThreadSafeBase::RefCountedThreadSafeBase() : ref_count_(0) {
60 #ifndef NDEBUG 66 #ifndef NDEBUG
61 in_dtor_ = false; 67 in_dtor_ = false;
62 #endif 68 #endif
63 } 69 }
(...skipping 22 matching lines...) Expand all
86 in_dtor_ = true; 92 in_dtor_ = true;
87 #endif 93 #endif
88 return true; 94 return true;
89 } 95 }
90 return false; 96 return false;
91 } 97 }
92 98
93 } // namespace subtle 99 } // namespace subtle
94 100
95 } // namespace base 101 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/ref_counted.h ('k') | cc/base/ref_counted_managed.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698