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

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

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 | « no previous file | base/memory/ref_counted.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef BASE_MEMORY_REF_COUNTED_H_ 5 #ifndef BASE_MEMORY_REF_COUNTED_H_
6 #define BASE_MEMORY_REF_COUNTED_H_ 6 #define BASE_MEMORY_REF_COUNTED_H_
7 7
8 #include <cassert> 8 #include <cassert>
9 9
10 #include "base/atomic_ref_count.h" 10 #include "base/atomic_ref_count.h"
(...skipping 11 matching lines...) Expand all
22 22
23 protected: 23 protected:
24 RefCountedBase(); 24 RefCountedBase();
25 ~RefCountedBase(); 25 ~RefCountedBase();
26 26
27 void AddRef() const; 27 void AddRef() const;
28 28
29 // Returns true if the object should self-delete. 29 // Returns true if the object should self-delete.
30 bool Release() const; 30 bool Release() const;
31 31
32 void ClearInDtor() const;
33
32 private: 34 private:
33 mutable int ref_count_; 35 mutable int ref_count_;
34 #ifndef NDEBUG 36 #ifndef NDEBUG
35 mutable bool in_dtor_; 37 mutable bool in_dtor_;
36 #endif 38 #endif
37 39
38 DFAKE_MUTEX(add_release_); 40 DFAKE_MUTEX(add_release_);
39 41
40 DISALLOW_COPY_AND_ASSIGN(RefCountedBase); 42 DISALLOW_COPY_AND_ASSIGN(RefCountedBase);
41 }; 43 };
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 }; 298 };
297 299
298 // Handy utility for creating a scoped_refptr<T> out of a T* explicitly without 300 // Handy utility for creating a scoped_refptr<T> out of a T* explicitly without
299 // having to retype all the template arguments 301 // having to retype all the template arguments
300 template <typename T> 302 template <typename T>
301 scoped_refptr<T> make_scoped_refptr(T* t) { 303 scoped_refptr<T> make_scoped_refptr(T* t) {
302 return scoped_refptr<T>(t); 304 return scoped_refptr<T>(t);
303 } 305 }
304 306
305 #endif // BASE_MEMORY_REF_COUNTED_H_ 307 #endif // BASE_MEMORY_REF_COUNTED_H_
OLDNEW
« no previous file with comments | « no previous file | base/memory/ref_counted.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698