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

Unified Diff: include/core/SkRefCnt.h

Issue 1068443002: Clean up BlockRef (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: fix const Created 5 years, 8 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 | no next file » | 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 9c62fe2740615dd0449a49d319e4e042ebdbf977..1632361519110915971d1b7fc12c02217887e7cb 100644
--- a/include/core/SkRefCnt.h
+++ b/include/core/SkRefCnt.h
@@ -208,30 +208,7 @@ public:
return obj;
}
- /**
- * BlockRef<B> is a type which inherits from B, cannot be created,
- * cannot be deleted, and makes ref and unref private.
- */
- template<typename B> class BlockRef : public B {
- private:
- BlockRef();
- ~BlockRef();
- void ref() const;
- void unref() const;
- };
-
- /** If T is const, the type returned from operator-> will also be const. */
- typedef typename SkTConstType<BlockRef<T>, SkTIsConst<T>::value>::type BlockRefType;
-
- /**
- * SkAutoTUnref assumes ownership of the ref. As a result, it is an error
- * for the user to ref or unref through SkAutoTUnref. Therefore
- * SkAutoTUnref::operator-> returns BlockRef<T>*. This prevents use of
- * skAutoTUnrefInstance->ref() and skAutoTUnrefInstance->unref().
- */
- BlockRefType *operator->() const {
- return static_cast<BlockRefType*>(fObj);
- }
+ T* operator->() const { return fObj; }
operator T*() const { return fObj; }
private:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698