aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-04-06 08:57:32 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-06 08:57:32 -0700
commit76f5cc6e9e87ff247c3ef1f4b3fb03668db06e2e (patch)
treeb298d72c290367791b47f1b88a468f39f362f24c /include
parent2f273a1ed098fbd7a8af86b349dbd247de609a2a (diff)
Clean up BlockRef
- It's no longer needed to help the (2011?) transition to SkAutoTUnref. - It prevents us from making classes that go in SkAutoTUnrefs final, i.e. all ref-counted classes. This had better not have been public API... TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/1068443002
Diffstat (limited to 'include')
-rw-r--r--include/core/SkRefCnt.h25
1 files changed, 1 insertions, 24 deletions
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h
index 9c62fe2740..1632361519 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: