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

Unified Diff: include/core/SkWeakRefCnt.h

Issue 382523002: Revert "Remove ability for Release code to call getRefCnt() or getWeakRefCnt()." (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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 | « include/core/SkRefCnt.h ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkWeakRefCnt.h
diff --git a/include/core/SkWeakRefCnt.h b/include/core/SkWeakRefCnt.h
index d9f0dc80d6722c9ad429aa15ed853be2fa28484e..210dcc9f1c7bd6bdbefd2a375fb6851ef2ffdd02 100644
--- a/include/core/SkWeakRefCnt.h
+++ b/include/core/SkWeakRefCnt.h
@@ -60,18 +60,20 @@ public:
*/
SkWeakRefCnt() : SkRefCnt(), fWeakCnt(1) {}
-#ifdef SK_DEBUG
/** Destruct, asserting that the weak reference count is 1.
*/
virtual ~SkWeakRefCnt() {
+#ifdef SK_DEBUG
SkASSERT(fWeakCnt == 1);
fWeakCnt = 0;
+#endif
}
/** Return the weak reference count.
*/
int32_t getWeakCnt() const { return fWeakCnt; }
+#ifdef SK_DEBUG
void validate() const {
this->INHERITED::validate();
SkASSERT(fWeakCnt > 0);
@@ -153,9 +155,6 @@ private:
/* Invariant: fWeakCnt = #weak + (fRefCnt > 0 ? 1 : 0) */
mutable int32_t fWeakCnt;
- // Used by tests.
- friend bool WeakRefCntIs(const SkWeakRefCnt&, int32_t);
-
typedef SkRefCnt INHERITED;
};
« no previous file with comments | « include/core/SkRefCnt.h ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698