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

Side by Side Diff: mojo/edk/util/ref_counted.h

Issue 1558333002: Rectify our use of std::nullptr_t, inclusions of <stddef.h>/<cstddef>. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « mojo/edk/util/make_unique.h ('k') | mojo/edk/util/ref_ptr.h » ('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 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
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_
OLDNEW
« no previous file with comments | « mojo/edk/util/make_unique.h ('k') | mojo/edk/util/ref_ptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698