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

Side by Side Diff: ppapi/native_client/src/include/ref_counted.h

Issue 10836116: Purge ImplementsThreadSafeReferenceCounting() from the codebase now that Task is dead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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 | « ipc/ipc_sync_channel_unittest.cc ('k') | no next file » | no next file with comments »
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 NATIVE_CLIENT_SRC_INCLUDE_REF_COUNTED_H_ 5 #ifndef NATIVE_CLIENT_SRC_INCLUDE_REF_COUNTED_H_
6 #define NATIVE_CLIENT_SRC_INCLUDE_REF_COUNTED_H_ 6 #define NATIVE_CLIENT_SRC_INCLUDE_REF_COUNTED_H_
7 7
8 #include "native_client/src/shared/platform/nacl_sync_checked.h" 8 #include "native_client/src/shared/platform/nacl_sync_checked.h"
9 9
10 namespace nacl { 10 namespace nacl {
11 11
12 namespace subtle { 12 namespace subtle {
13 13
14 class RefCountedBase { 14 class RefCountedBase {
15 public: 15 public:
16 static bool ImplementsThreadSafeReferenceCounting() { return true; }
17
18 bool HasOneRef() const { 16 bool HasOneRef() const {
19 nacl::ScopedNaClMutexLock ml(&mu_); 17 nacl::ScopedNaClMutexLock ml(&mu_);
20 return (ref_count_ == 1); 18 return (ref_count_ == 1);
21 } 19 }
22 20
23 protected: 21 protected:
24 RefCountedBase() : ref_count_(0) { 22 RefCountedBase() : ref_count_(0) {
25 NaClXMutexCtor(&mu_); 23 NaClXMutexCtor(&mu_);
26 } 24 }
27 ~RefCountedBase() { 25 ~RefCountedBase() {
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 }; 224 };
227 225
228 // Handy utility for creating a scoped_refptr<T> out of a T* explicitly without 226 // Handy utility for creating a scoped_refptr<T> out of a T* explicitly without
229 // having to retype all the template arguments 227 // having to retype all the template arguments
230 template <typename T> 228 template <typename T>
231 scoped_refptr<T> make_scoped_refptr(T* t) { 229 scoped_refptr<T> make_scoped_refptr(T* t) {
232 return scoped_refptr<T>(t); 230 return scoped_refptr<T>(t);
233 } 231 }
234 232
235 #endif // NATIVE_CLIENT_SRC_INCLUDE_REF_COUNTED_H_ 233 #endif // NATIVE_CLIENT_SRC_INCLUDE_REF_COUNTED_H_
OLDNEW
« no previous file with comments | « ipc/ipc_sync_channel_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698