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

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

Issue 10553029: Handle interface to prerenders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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/weak_ptr_unittest.cc » ('j') | base/memory/weak_ptr_unittest.cc » ('J')
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 #pragma once 7 #pragma once
8 8
9 #include <cassert> 9 #include <cassert>
10 10
(...skipping 13 matching lines...) Expand all
24 24
25 protected: 25 protected:
26 RefCountedBase(); 26 RefCountedBase();
27 ~RefCountedBase(); 27 ~RefCountedBase();
28 28
29 void AddRef() const; 29 void AddRef() const;
30 30
31 // Returns true if the object should self-delete. 31 // Returns true if the object should self-delete.
32 bool Release() const; 32 bool Release() const;
33 33
34 private: 34 public:
dominich 2012/06/18 15:32:44 no.
35 mutable int ref_count_; 35 mutable int ref_count_;
36 #ifndef NDEBUG 36 #ifndef NDEBUG
37 mutable bool in_dtor_; 37 mutable bool in_dtor_;
38 #endif 38 #endif
39 39
40 DFAKE_MUTEX(add_release_); 40 DFAKE_MUTEX(add_release_);
41 41
42 DISALLOW_COPY_AND_ASSIGN(RefCountedBase); 42 DISALLOW_COPY_AND_ASSIGN(RefCountedBase);
43 }; 43 };
44 44
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 }; 296 };
297 297
298 // Handy utility for creating a scoped_refptr<T> out of a T* explicitly without 298 // Handy utility for creating a scoped_refptr<T> out of a T* explicitly without
299 // having to retype all the template arguments 299 // having to retype all the template arguments
300 template <typename T> 300 template <typename T>
301 scoped_refptr<T> make_scoped_refptr(T* t) { 301 scoped_refptr<T> make_scoped_refptr(T* t) {
302 return scoped_refptr<T>(t); 302 return scoped_refptr<T>(t);
303 } 303 }
304 304
305 #endif // BASE_MEMORY_REF_COUNTED_H_ 305 #endif // BASE_MEMORY_REF_COUNTED_H_
OLDNEW
« no previous file with comments | « no previous file | base/memory/weak_ptr_unittest.cc » ('j') | base/memory/weak_ptr_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698