Remove SkAutoTUnref from public API
authorHal Canary <halcanary@google.com>
Tue, 8 Nov 2016 14:03:48 +0000 (09:03 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Tue, 8 Nov 2016 14:42:19 +0000 (14:42 +0000)
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4530

Change-Id: I1ba33edc5ca44332ff4f296e6b9997a133a08a87
Reviewed-on: https://skia-review.googlesource.com/4530
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Reed <reed@google.com>
include/core/SkRefCnt.h

index 9436b52..53523b4 100644 (file)
@@ -181,26 +181,6 @@ template<typename T> static inline void SkSafeSetNull(T*& obj) {
 
 ///////////////////////////////////////////////////////////////////////////////
 
-template <typename T> struct SkTUnref {
-    void operator()(T* t) { t->unref(); }
-};
-
-/**
- *  Utility class that simply unref's its argument in the destructor.
- */
-template <typename T> class SkAutoTUnref : public std::unique_ptr<T, SkTUnref<T>> {
-public:
-    explicit SkAutoTUnref(T* obj = nullptr) : std::unique_ptr<T, SkTUnref<T>>(obj) {}
-
-    operator T*() const { return this->get(); }
-
-#if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK)
-    // Need to update graphics/Shader.cpp.
-    T* detach() { return this->release(); }
-#endif
-};
-// Can't use the #define trick to guard a bare SkAutoTUnref(...) because it's templated. :(
-
 // This is a variant of SkRefCnt that's Not Virtual, so weighs 4 bytes instead of 8 or 16.
 // There's only benefit to using this if the deriving class does not otherwise need a vtable.
 template <typename Derived>