OLD | NEW |
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 #include <iosfwd> | 9 #include <iosfwd> |
10 | 10 |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 template <typename T, typename U> | 430 template <typename T, typename U> |
431 bool operator!=(const T* lhs, const scoped_refptr<U>& rhs) { | 431 bool operator!=(const T* lhs, const scoped_refptr<U>& rhs) { |
432 return !operator==(lhs, rhs); | 432 return !operator==(lhs, rhs); |
433 } | 433 } |
434 | 434 |
435 template <typename T> | 435 template <typename T> |
436 std::ostream& operator<<(std::ostream& out, const scoped_refptr<T>& p) { | 436 std::ostream& operator<<(std::ostream& out, const scoped_refptr<T>& p) { |
437 return out << p.get(); | 437 return out << p.get(); |
438 } | 438 } |
439 | 439 |
| 440 class ThreadUnsafe : public base::RefCounted<ThreadUnsafe> { |
| 441 private: |
| 442 friend class base::RefCounted<ThreadUnsafe>; |
| 443 }; |
| 444 class ThreadSafe : public base::RefCountedThreadSafe<ThreadSafe> { |
| 445 private: |
| 446 friend class base::RefCountedThreadSafe<ThreadSafe>; |
| 447 }; |
| 448 |
| 449 scoped_refptr<ThreadUnsafe> get_thread_unsafe(); |
| 450 scoped_refptr<ThreadSafe> get_thread_safe(); |
| 451 |
440 #endif // BASE_MEMORY_REF_COUNTED_H_ | 452 #endif // BASE_MEMORY_REF_COUNTED_H_ |
OLD | NEW |