OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_REF_COUNTED_H_ | 5 #ifndef BASE_REF_COUNTED_H_ |
6 #define BASE_REF_COUNTED_H_ | 6 #define BASE_REF_COUNTED_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/atomic_ref_count.h" | 9 #include "base/atomic_ref_count.h" |
10 #include "base/thread_collision_warner.h" | 10 #include "base/threading/thread_collision_warner.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 | 13 |
14 namespace subtle { | 14 namespace subtle { |
15 | 15 |
16 class RefCountedBase { | 16 class RefCountedBase { |
17 public: | 17 public: |
18 static bool ImplementsThreadSafeReferenceCounting() { return false; } | 18 static bool ImplementsThreadSafeReferenceCounting() { return false; } |
19 | 19 |
20 bool HasOneRef() const { return ref_count_ == 1; } | 20 bool HasOneRef() const { return ref_count_ == 1; } |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 }; | 289 }; |
290 | 290 |
291 // Handy utility for creating a scoped_refptr<T> out of a T* explicitly without | 291 // Handy utility for creating a scoped_refptr<T> out of a T* explicitly without |
292 // having to retype all the template arguments | 292 // having to retype all the template arguments |
293 template <typename T> | 293 template <typename T> |
294 scoped_refptr<T> make_scoped_refptr(T* t) { | 294 scoped_refptr<T> make_scoped_refptr(T* t) { |
295 return scoped_refptr<T>(t); | 295 return scoped_refptr<T>(t); |
296 } | 296 } |
297 | 297 |
298 #endif // BASE_REF_COUNTED_H_ | 298 #endif // BASE_REF_COUNTED_H_ |
OLD | NEW |