diff options
author | mtklein <mtklein@google.com> | 2016-03-16 10:03:14 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-16 10:03:15 -0700 |
commit | e7ec417268d4be2d7921b23c131859b322badf78 (patch) | |
tree | a9bc077e6193f97fd14bb2a3bf54ab220f2453ea /include/core/SkRefCnt.h | |
parent | 250581493a0859987e482810879e85e5ac2dc002 (diff) |
Revert of Use std::unique_ptr. (patchset #10 id:170001 of https://codereview.chromium.org/1780933003/ )
Reason for revert:
aww jeez, I dropped ps 8...
Original issue's description:
> Use std::unique_ptr.
>
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940
>
> Committed: https://skia.googlesource.com/skia/+/3dd9ed37c24611af86f0fe374bd3698b63f09450
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1780933003
>
> Committed: https://skia.googlesource.com/skia/+/2691d76a06e1af6282f8b3a3140cc93361be10c4
TBR=bungeman@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/1809693002
Diffstat (limited to 'include/core/SkRefCnt.h')
-rw-r--r-- | include/core/SkRefCnt.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h index d18a63a49f..f159e3b1b7 100644 --- a/include/core/SkRefCnt.h +++ b/include/core/SkRefCnt.h @@ -9,10 +9,9 @@ #define SkRefCnt_DEFINED #include "../private/SkAtomics.h" -#include "../private/SkTLogic.h" +#include "../private/SkUniquePtr.h" #include "SkTypes.h" #include <functional> -#include <memory> #include <utility> #define SK_SUPPORT_TRANSITION_TO_SP_INTERFACES @@ -190,16 +189,12 @@ template <typename T> struct SkTUnref { /** * Utility class that simply unref's its argument in the destructor. */ -template <typename T> class SkAutoTUnref : public std::unique_ptr<T, SkTUnref<T>> { +template <typename T> class SkAutoTUnref : public skstd::unique_ptr<T, SkTUnref<T>> { public: - explicit SkAutoTUnref(T* obj = nullptr) : std::unique_ptr<T, SkTUnref<T>>(obj) {} + explicit SkAutoTUnref(T* obj = nullptr) : skstd::unique_ptr<T, SkTUnref<T>>(obj) {} T* detach() { return this->release(); } operator T*() const { return this->get(); } - - // Android's std::unique_ptr's operator bool() is sometimes not explicit... - // so override it with our own explcitly explicit version. - explicit operator bool() const { return this->get() != nullptr; } }; // Can't use the #define trick below to guard a bare SkAutoTUnref(...) because it's templated. :( |