Chromium Code Reviews| 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..bcfcb451a9c4245fa0ddc70a545fd6d100ee5015 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: |
|
Ilya Kulshin
2016/02/11 20:40:18
Note: the actual change here is moving adopted() a
|
| + 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) { } |
| @@ -49,8 +59,5 @@ namespace WTF { |
| } |
| }; |
| -using WTF::adopted; |
| -using WTF::requireAdoption; |
| - |
| #endif |