Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: include/core/SkData.h

Issue 2232433002: Use SkNVRefCnt for a couple common types. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: final Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/core/SkPathRef.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkData.h
diff --git a/include/core/SkData.h b/include/core/SkData.h
index 546b77dccf8b0c01dbffc67d2f7f3b8524ec71fd..76c9c9ebec2bc38fc19d05a02524f160d419d39b 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 final : public SkNVRefCnt<SkData> {
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
« no previous file with comments | « no previous file | include/core/SkPathRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698