Chromium Code Reviews| Index: third_party/WebKit/Source/platform/heap/Member.h |
| diff --git a/third_party/WebKit/Source/platform/heap/Member.h b/third_party/WebKit/Source/platform/heap/Member.h |
| index b2bac898b0c9e4b65564bf2e4e3e53dca4d4bd83..5ed599b791d91c9b2af3f63b09d7c6df1942c9f7 100644 |
| --- a/third_party/WebKit/Source/platform/heap/Member.h |
| +++ b/third_party/WebKit/Source/platform/heap/Member.h |
| @@ -13,6 +13,7 @@ namespace blink { |
| template <typename T> |
| class Persistent; |
| +class ScriptWrappable; |
| template <typename T> |
| class TraceWrapperMember; |
| @@ -172,6 +173,14 @@ class MemberBase { |
| // collection iterator. |
| DCHECK(m_creationThreadState || !m_raw); |
| } |
| + |
| + // If this DCHECK() triggers, you're attempting to embed a ScriptWrappable |
| + // inside a static local singleton, which is unsafe. |
| + // See |DEFINE_STATIC_LOCAL()| documentation for further details. |
| + if (WTF::IsSubclass<T, blink::ScriptWrappable>::value) { |
| + if (m_creationThreadState) |
| + DCHECK(m_creationThreadState->canAllocateScriptWrappable()); |
|
haraken
2017/02/11 10:25:20
Would you help me understand why we need to have t
sof
2017/02/11 12:09:11
Good question to raise -- the "no ScriptWrappable"
|
| + } |
| #endif |
| } |