| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // Provides a base class for reference-counted classes. | 5 // Provides a base class for reference-counted classes. |
| 6 | 6 |
| 7 #ifndef MOJO_EDK_UTIL_REF_COUNTED_H_ | 7 #ifndef MOJO_EDK_UTIL_REF_COUNTED_H_ |
| 8 #define MOJO_EDK_UTIL_REF_COUNTED_H_ | 8 #define MOJO_EDK_UTIL_REF_COUNTED_H_ |
| 9 | 9 |
| 10 #include <assert.h> | |
| 11 | |
| 12 #include <cstddef> | |
| 13 #include <utility> | |
| 14 | |
| 15 #include "mojo/edk/util/ref_counted_internal.h" | 10 #include "mojo/edk/util/ref_counted_internal.h" |
| 16 #include "mojo/edk/util/ref_ptr.h" | 11 #include "mojo/edk/util/ref_ptr.h" |
| 17 #include "mojo/public/cpp/system/macros.h" | 12 #include "mojo/public/cpp/system/macros.h" |
| 18 | 13 |
| 19 namespace mojo { | 14 namespace mojo { |
| 20 namespace util { | 15 namespace util { |
| 21 | 16 |
| 22 // A base class for (thread-safe) reference-counted classes. Use like: | 17 // A base class for (thread-safe) reference-counted classes. Use like: |
| 23 // | 18 // |
| 24 // class Foo : public RefCountedThreadSafe<Foo> { | 19 // class Foo : public RefCountedThreadSafe<Foo> { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // If you want to keep your constructor(s) private and still want to use | 127 // If you want to keep your constructor(s) private and still want to use |
| 133 // |MakeRefCounted<T>()|, use this. (See the example above | 128 // |MakeRefCounted<T>()|, use this. (See the example above |
| 134 // |RefCountedThreadSafe|.) | 129 // |RefCountedThreadSafe|.) |
| 135 #define FRIEND_MAKE_REF_COUNTED(T) \ | 130 #define FRIEND_MAKE_REF_COUNTED(T) \ |
| 136 friend class ::mojo::util::internal::MakeRefCountedHelper<T> | 131 friend class ::mojo::util::internal::MakeRefCountedHelper<T> |
| 137 | 132 |
| 138 } // namespace util | 133 } // namespace util |
| 139 } // namespace mojo | 134 } // namespace mojo |
| 140 | 135 |
| 141 #endif // MOJO_EDK_UTIL_REF_COUNTED_H_ | 136 #endif // MOJO_EDK_UTIL_REF_COUNTED_H_ |
| OLD | NEW |