Chromium Code Reviews| Index: include/core/SkData.h |
| diff --git a/include/core/SkData.h b/include/core/SkData.h |
| index 546b77dccf8b0c01dbffc67d2f7f3b8524ec71fd..2a3b3dd3741d72a2904f20ea33f2635516982522 100644 |
| --- a/include/core/SkData.h |
| +++ b/include/core/SkData.h |
| @@ -19,7 +19,7 @@ class SkStream; |
| * but the actual ptr that is returned (by data() or bytes()) is guaranteed |
| * to always be the same for the life of this instance. |
| */ |
| -class SK_API SkData : public SkRefCnt { |
| +class SK_API SkData : public SkNVRefCnt<SkData> { |
|
reed1
2016/08/09 18:36:59
can we mark SkData as final?
|
| public: |
| /** |
| * Returns the number of bytes stored. |
| @@ -79,7 +79,7 @@ public: |
| */ |
| static sk_sp<SkData> MakeWithCopy(const void* data, size_t length); |
| - |
| + |
| /** |
| * Create a new data with uninitialized contents. The caller should call writable_data() |
| * to write into the buffer, but this must be done before another ref() is made. |
| @@ -158,6 +158,7 @@ public: |
| static sk_sp<SkData> MakeEmpty(); |
| private: |
| + friend class SkNVRefCnt<SkData>; |
| ReleaseProc fReleaseProc; |
| void* fReleaseProcContext; |
| void* fPtr; |
| @@ -165,7 +166,7 @@ private: |
| SkData(const void* ptr, size_t size, ReleaseProc, void* context); |
| explicit SkData(size_t size); // inplace new/delete |
| - virtual ~SkData(); |
| + ~SkData(); |
| // Objects of this type are sometimes created in a custom fashion using sk_malloc_throw and |