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

Unified Diff: skia/config/sk_ref_cnt_ext_debug.h

Issue 1691073002: Add plumbing in blink to allow overriding the skia font manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge to head Created 4 years, 10 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
Index: skia/config/sk_ref_cnt_ext_debug.h
diff --git a/skia/config/sk_ref_cnt_ext_debug.h b/skia/config/sk_ref_cnt_ext_debug.h
index 78a39a3789f23cb5cbc2a9f23c74a60ec4a5c5ae..8a4e448a3d13016ad1b2bbe942519368dacc138a 100644
--- a/skia/config/sk_ref_cnt_ext_debug.h
+++ b/skia/config/sk_ref_cnt_ext_debug.h
@@ -11,16 +11,23 @@
#include <atomic>
+class SkRefCnt;
+
+namespace WTF {
+ void adopted(const SkRefCnt*);
+ void requireAdoption(const SkRefCnt*);
+}
+
// Alternate implementation of SkRefCnt for Chromium debug builds
class SK_API SkRefCnt : public SkRefCntBase {
public:
SkRefCnt();
~SkRefCnt() override;
void ref() const { SkASSERT(flags_.load() != AdoptionRequired_Flag); SkRefCntBase::ref(); }
- void adopted() const { flags_ |= Adopted_Flag; }
- void requireAdoption() const { flags_ |= AdoptionRequired_Flag; }
void deref() const { SkRefCntBase::unref(); }
private:
+ void adopted() const { flags_ |= Adopted_Flag; }
+ void requireAdoption() const { flags_ |= AdoptionRequired_Flag; }
enum {
Adopted_Flag = 0x1,
@@ -28,6 +35,9 @@ private:
};
mutable std::atomic<int> flags_;
+
+ friend void WTF::adopted(const SkRefCnt*);
+ friend void WTF::requireAdoption(const SkRefCnt*);
};
inline SkRefCnt::SkRefCnt() : flags_(0) { }

Powered by Google App Engine
This is Rietveld 408576698