| Index: third_party/WebKit/Source/platform/heap/Handle.h
|
| diff --git a/third_party/WebKit/Source/platform/heap/Handle.h b/third_party/WebKit/Source/platform/heap/Handle.h
|
| index 9ef17dedb23ab35406e19a1e1e774f52269c40af..27af3d6dca2664385244fc4f17e691d13c1c6194 100644
|
| --- a/third_party/WebKit/Source/platform/heap/Handle.h
|
| +++ b/third_party/WebKit/Source/platform/heap/Handle.h
|
| @@ -46,6 +46,10 @@
|
| #include "wtf/RefCounted.h"
|
| #include "wtf/TypeTraits.h"
|
|
|
| +#if defined(LEAK_SANITIZER)
|
| +#include "wtf/LeakAnnotations.h"
|
| +#endif
|
| +
|
| namespace blink {
|
|
|
| enum WeaknessPersistentConfiguration {
|
| @@ -183,6 +187,16 @@ public:
|
| return *this;
|
| }
|
|
|
| + PersistentBase* registerAsStaticReference()
|
| + {
|
| +#if defined(LEAK_SANITIZER)
|
| + if (m_persistentNode) {
|
| + ThreadState::current()->registerStaticPersistentNode(m_persistentNode);
|
| + WTF_ANNOTATE_LEAKING_OBJECT_PTR(this);
|
| + }
|
| +#endif
|
| + return this;
|
| + }
|
|
|
| private:
|
| NO_LAZY_SWEEP_SANITIZE_ADDRESS
|
| @@ -545,7 +559,19 @@ public:
|
| visitor->trace(*static_cast<Collection*>(this));
|
| }
|
|
|
| + PersistentHeapCollectionBase* registerAsStaticReference()
|
| + {
|
| +#if defined(LEAK_SANITIZER)
|
| + if (m_persistentNode) {
|
| + ThreadState::current()->registerStaticPersistentNode(m_persistentNode);
|
| + WTF_ANNOTATE_LEAKING_OBJECT_PTR(this);
|
| + }
|
| +#endif
|
| + return this;
|
| + }
|
| +
|
| private:
|
| +
|
| NO_LAZY_SWEEP_SANITIZE_ADDRESS
|
| void initialize()
|
| {
|
| @@ -1067,7 +1093,7 @@ template<typename T> T* adoptPtrWillBeNoop(T* ptr)
|
| #define DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(type) // do nothing
|
|
|
| #define DEFINE_STATIC_REF_WILL_BE_PERSISTENT(type, name, arguments) \
|
| - static type* name = (new Persistent<type>(arguments))->get();
|
| + static type* name = *(new Persistent<type>(arguments))->registerAsStaticReference();
|
|
|
| #else // !ENABLE(OILPAN)
|
|
|
|
|