Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp |
| index d0d3bd051180dce7ef6a8ad89f2a005361ff7fe8..94c63cfb2fdfee01d5d084e3fcdba9a88582c218 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp |
| @@ -109,6 +109,7 @@ ScriptCustomElementDefinition::ScriptCustomElementDefinition( |
| const v8::Local<v8::Object>& constructor, |
| const v8::Local<v8::Object>& prototype) |
| : CustomElementDefinition(descriptor) |
| + , m_scriptState(scriptState) |
| , m_constructor(scriptState->isolate(), constructor) |
| , m_prototype(scriptState->isolate(), prototype) |
| { |
| @@ -122,6 +123,7 @@ ScriptCustomElementDefinition::ScriptCustomElementDefinition( |
| v8::Local<v8::Object> ScriptCustomElementDefinition::constructor( |
| ScriptState* scriptState) const |
| { |
| + DCHECK_EQ(m_scriptState, scriptState); |
| DCHECK(!m_constructor.isEmpty()); |
| return m_constructor.newLocal(scriptState->isolate()); |
| } |
| @@ -129,8 +131,18 @@ v8::Local<v8::Object> ScriptCustomElementDefinition::constructor( |
| v8::Local<v8::Object> ScriptCustomElementDefinition::prototype( |
| ScriptState* scriptState) const |
| { |
| + DCHECK_EQ(m_scriptState, scriptState); |
|
yosin_UTC9
2016/05/31 09:16:57
Do we really need to have this check?
|
| DCHECK(!m_prototype.isEmpty()); |
| return m_prototype.newLocal(scriptState->isolate()); |
| } |
| +// CustomElementDefinition |
| +ScriptValue ScriptCustomElementDefinition::getConstructor( |
| + ScriptState* scriptState) |
| +{ |
| + if (m_scriptState != scriptState) |
|
yosin_UTC9
2016/05/31 09:16:57
Do we really need to have this check?
|
| + return ScriptValue(scriptState, v8Undefined()); |
|
yosin_UTC9
2016/05/31 09:16:57
Should be |ScriptValue()|
dominicc (has gone to gerrit)
2016/05/31 22:56:32
Why not just do that?
yosin_UTC9
2016/06/01 02:14:37
I expect to have this patch isn't ready for commit
|
| + return ScriptValue(scriptState, constructor(scriptState)); |
| +} |
| + |
| } // namespace blink |