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..93ca9d23e96c6233a42f5fc39ccbf61c856dd09c 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 |
haraken
2016/06/01 02:28:12
ScriptState is not needed. You can just pass in an
yosin_UTC9
2016/06/01 06:16:14
I'll handle this change in another CL.
|
{ |
+ 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); |
DCHECK(!m_prototype.isEmpty()); |
return m_prototype.newLocal(scriptState->isolate()); |
} |
+// CustomElementDefinition |
+ScriptValue ScriptCustomElementDefinition::getConstructorForScript( |
+ ScriptState* scriptState) |
+{ |
+ if (m_scriptState != scriptState) |
+ return ScriptValue(); |
+ return ScriptValue(scriptState, constructor(scriptState)); |
haraken
2016/06/01 02:28:12
I guess this should be:
return ScriptValue(m_sc
yosin_UTC9
2016/06/01 06:16:14
AFAIK, No. I should not be happened.
|
+} |
+ |
} // namespace blink |