Index: include/private/SkOncePtr.h |
diff --git a/include/private/SkOncePtr.h b/include/private/SkOncePtr.h |
index b60d968b4a4ef7825d16c558cbaf822206f94abe..921c6a6534b83de2f95a97e836f5d71dba61bc2f 100644 |
--- a/include/private/SkOncePtr.h |
+++ b/include/private/SkOncePtr.h |
@@ -11,51 +11,9 @@ |
#include "../private/SkAtomics.h" |
#include <memory> |
-template <typename T> class SkBaseOncePtr; |
- |
// Use this to create a global static pointer that's intialized exactly once when you call get(). |
#define SK_DECLARE_STATIC_ONCE_PTR(type, name) namespace {} static SkBaseOncePtr<type> name; |
-// Use this for a local or member pointer that's initialized exactly once when you call get(). |
-template <typename T, typename Delete = std::default_delete<T>> |
-class SkOncePtr : SkNoncopyable { |
-public: |
- SkOncePtr() { sk_bzero(this, sizeof(*this)); } |
- ~SkOncePtr() { |
- if (T* ptr = (T*)*this) { |
- Delete()(ptr); |
- } |
- } |
- |
- template <typename F> |
- T* get(const F& f) const { |
- return fOnce.get(f); |
- } |
- |
- operator T*() const { |
- return (T*)fOnce; |
- } |
- |
-private: |
- SkBaseOncePtr<T> fOnce; |
-}; |
- |
-// If you ask for SkOncePtr<T[]>, we'll clean up with delete[] by default. |
-template <typename T> |
-class SkOncePtr<T[]> : public SkOncePtr<T, std::default_delete<T[]>> {}; |
- |
-/* TODO(mtklein): in next CL |
-typedef SkBaseOncePtr<void> SkOnceFlag; |
-#define SK_DECLARE_STATIC_ONCE(name) namespace {} static SkOnceFlag name |
- |
-template <typename F> |
-inline void SkOnce(SkOnceFlag* once, const F& f) { |
- once->get([&]{ f(); return (void*)2; }); |
-} |
-*/ |
- |
-// Implementation details below here! No peeking! |
- |
template <typename T> |
class SkBaseOncePtr { |
public: |