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

Unified Diff: include/core/SkRefCnt.h

Issue 393913002: Remove SkRefPtr. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix parameter. Created 6 years, 5 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
« no previous file with comments | « no previous file | src/ports/SkFontConfigInterface_android.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkRefCnt.h
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h
index 9e3a92eb9ac836af538eddcb8b02cc4fb4128a65..f92154bc2f86f1098a02a61fb9b46c1d46753e2a 100644
--- a/include/core/SkRefCnt.h
+++ b/include/core/SkRefCnt.h
@@ -248,36 +248,4 @@ public:
};
#define SkAutoUnref(...) SK_REQUIRE_LOCAL_VAR(SkAutoUnref)
-/** Wrapper class for SkRefCnt pointers. This manages ref/unref of a pointer to
- a SkRefCnt (or subclass) object.
- */
-template <typename T> class SkRefPtr {
-public:
- SkRefPtr() : fObj(NULL) {}
- SkRefPtr(T* obj) : fObj(obj) { SkSafeRef(fObj); }
- SkRefPtr(const SkRefPtr& o) : fObj(o.fObj) { SkSafeRef(fObj); }
- ~SkRefPtr() { SkSafeUnref(fObj); }
-
- SkRefPtr& operator=(const SkRefPtr& rp) {
- SkRefCnt_SafeAssign(fObj, rp.fObj);
- return *this;
- }
- SkRefPtr& operator=(T* obj) {
- SkRefCnt_SafeAssign(fObj, obj);
- return *this;
- }
-
- T* get() const { return fObj; }
- T& operator*() const { return *fObj; }
- T* operator->() const { return fObj; }
-
- typedef T* SkRefPtr::*unspecified_bool_type;
- operator unspecified_bool_type() const {
- return fObj ? &SkRefPtr::fObj : NULL;
- }
-
-private:
- T* fObj;
-};
-
#endif
« no previous file with comments | « no previous file | src/ports/SkFontConfigInterface_android.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698