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

Unified Diff: src/core/SkData.cpp

Issue 737093002: Stop overloading internal_dispose in SkTextBlob and SkData (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ARGGGGGGHHHH Created 6 years, 1 month 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 | « include/core/SkTextBlob.h ('k') | src/core/SkTextBlob.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkData.cpp
diff --git a/src/core/SkData.cpp b/src/core/SkData.cpp
index c5d10775f8024cad028c69dbb7e107325c157586..dfbd00384975d93a622c7eabeccfaf5d8b091bd0 100644
--- a/src/core/SkData.cpp
+++ b/src/core/SkData.cpp
@@ -12,11 +12,6 @@
#include "SkStream.h"
#include "SkWriteBuffer.h"
-static void sk_inplace_sentinel_releaseproc(const void*, size_t, void*) {
- // we should never get called, as we are just a sentinel
- sk_throw();
-}
-
SkData::SkData(const void* ptr, size_t size, ReleaseProc proc, void* context) {
fPtr = const_cast<void*>(ptr);
fSize = size;
@@ -31,7 +26,7 @@ SkData::SkData(const void* ptr, size_t size, ReleaseProc proc, void* context) {
SkData::SkData(size_t size) {
fPtr = (char*)(this + 1); // contents are immediately after this
fSize = size;
- fReleaseProc = sk_inplace_sentinel_releaseproc;
+ fReleaseProc = NULL;
fReleaseProcContext = NULL;
}
@@ -41,20 +36,6 @@ SkData::~SkData() {
}
}
-void SkData::internal_dispose() const {
- if (sk_inplace_sentinel_releaseproc == fReleaseProc) {
- const_cast<SkData*>(this)->fReleaseProc = NULL; // so we don't call it in our destructor
-
- this->internal_dispose_restore_refcnt_to_1();
- this->~SkData(); // explicitly call this for refcnt bookkeeping
-
- sk_free(const_cast<SkData*>(this));
- } else {
- this->internal_dispose_restore_refcnt_to_1();
- SkDELETE(this);
- }
-}
-
bool SkData::equals(const SkData* other) const {
if (NULL == other) {
return false;
« no previous file with comments | « include/core/SkTextBlob.h ('k') | src/core/SkTextBlob.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698