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

Unified Diff: ppapi/native_client/src/include/ref_counted.h

Issue 10386080: Rename nacl::RefCounted to nacl::RefCountedThreadSafe (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: License bump Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/native_client/src/include/ref_counted.h
diff --git a/ppapi/native_client/src/include/ref_counted.h b/ppapi/native_client/src/include/ref_counted.h
index d1a1bbcd549395afa37ba99f965314e5dc6daa6a..d62e020eafeb405fbbe423f59df730bcc5e3b223 100644
--- a/ppapi/native_client/src/include/ref_counted.h
+++ b/ppapi/native_client/src/include/ref_counted.h
@@ -65,10 +65,9 @@ class RefCountedBase {
// You should always make your destructor private, to avoid any code deleting
// the object accidently while there are references to it.
template <class T>
-class RefCounted : public subtle::RefCountedBase {
+class RefCountedThreadSafe : public subtle::RefCountedBase {
public:
- RefCounted() { }
- ~RefCounted() { }
+ RefCountedThreadSafe() {}
void AddRef() const {
subtle::RefCountedBase::AddRef();
@@ -80,9 +79,12 @@ class RefCounted : public subtle::RefCountedBase {
}
}
+ protected:
+ ~RefCountedThreadSafe() {}
+
private:
- RefCounted(const RefCounted<T>&);
- void operator=(const RefCounted<T>&);
+ RefCountedThreadSafe(const RefCountedThreadSafe<T>&);
+ void operator=(const RefCountedThreadSafe<T>&);
};
//
@@ -90,7 +92,8 @@ class RefCounted : public subtle::RefCountedBase {
// scoped_refptrs<>.
//
template<typename T>
-class RefCountedData : public nacl::RefCounted< nacl::RefCountedData<T> > {
+class RefCountedData
+ : public RefCountedThreadSafe<RefCountedData<T> > {
public:
RefCountedData() : data() {}
RefCountedData(const T& in_value) : data(in_value) {}
@@ -151,8 +154,7 @@ class RefCountedData : public nacl::RefCounted< nacl::RefCountedData<T> > {
template <class T>
class scoped_refptr {
public:
- scoped_refptr() : ptr_((T*)0) {
- }
+ scoped_refptr() : ptr_((T*)0) {}
scoped_refptr(T* p) : ptr_(p) {
if (ptr_)
« no previous file with comments | « gpu/command_buffer/client/ref_counted.h ('k') | ppapi/native_client/src/shared/ppapi_proxy/array_buffer_proxy_var.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698