Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp

Issue 1419313003: Track the script state a listener was created in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp b/third_party/WebKit/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp
index 0858f74171893eeb9f3d7417afb0c14cff2e7381..beeab2e256ec25e7276513891c380b37ff713b6e 100644
--- a/third_party/WebKit/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp
@@ -180,10 +180,10 @@ bool CustomElementConstructorBuilder::createConstructor(Document* document, Cust
m_constructor->SetName(v8Type->IsNull() ? v8TagName : v8Type.As<v8::String>());
- V8HiddenValue::setHiddenValue(isolate, m_constructor, V8HiddenValue::customElementDocument(isolate), toV8(document, context->Global(), isolate));
- V8HiddenValue::setHiddenValue(isolate, m_constructor, V8HiddenValue::customElementNamespaceURI(isolate), v8String(isolate, descriptor.namespaceURI()));
- V8HiddenValue::setHiddenValue(isolate, m_constructor, V8HiddenValue::customElementTagName(isolate), v8TagName);
- V8HiddenValue::setHiddenValue(isolate, m_constructor, V8HiddenValue::customElementType(isolate), v8Type);
+ V8HiddenValue::setHiddenValue(m_scriptState.get(), m_constructor, V8HiddenValue::customElementDocument(isolate), toV8(document, context->Global(), isolate));
+ V8HiddenValue::setHiddenValue(m_scriptState.get(), m_constructor, V8HiddenValue::customElementNamespaceURI(isolate), v8String(isolate, descriptor.namespaceURI()));
+ V8HiddenValue::setHiddenValue(m_scriptState.get(), m_constructor, V8HiddenValue::customElementTagName(isolate), v8TagName);
+ V8HiddenValue::setHiddenValue(m_scriptState.get(), m_constructor, V8HiddenValue::customElementType(isolate), v8Type);
v8::Local<v8::String> prototypeKey = v8String(isolate, "prototype");
if (!v8CallBoolean(m_constructor->HasOwnProperty(context, prototypeKey)))
@@ -207,7 +207,7 @@ bool CustomElementConstructorBuilder::createConstructor(Document* document, Cust
if (!v8CallBoolean(m_constructor->SetPrototype(context, constructorPrototype)))
return false;
- V8HiddenValue::setHiddenValue(isolate, m_prototype, V8HiddenValue::customElementIsInterfacePrototypeObject(isolate), v8::True(isolate));
+ V8HiddenValue::setHiddenValue(m_scriptState.get(), m_prototype, V8HiddenValue::customElementIsInterfacePrototypeObject(isolate), v8::True(isolate));
if (!v8CallBoolean(m_prototype->DefineOwnProperty(context, v8String(isolate, "constructor"), m_constructor, v8::DontEnum)))
return false;
@@ -216,7 +216,7 @@ bool CustomElementConstructorBuilder::createConstructor(Document* document, Cust
bool CustomElementConstructorBuilder::prototypeIsValid(const AtomicString& type, ExceptionState& exceptionState) const
{
- if (m_prototype->InternalFieldCount() || !V8HiddenValue::getHiddenValue(m_scriptState->isolate(), m_prototype, V8HiddenValue::customElementIsInterfacePrototypeObject(m_scriptState->isolate())).IsEmpty()) {
+ if (m_prototype->InternalFieldCount() || !V8HiddenValue::getHiddenValue(m_scriptState.get(), m_prototype, V8HiddenValue::customElementIsInterfacePrototypeObject(m_scriptState->isolate())).IsEmpty()) {
CustomElementException::throwException(CustomElementException::PrototypeInUse, type, exceptionState);
return false;
}
@@ -272,10 +272,11 @@ static void constructCustomElement(const v8::FunctionCallbackInfo<v8::Value>& in
return;
}
- Document* document = V8Document::toImpl(V8HiddenValue::getHiddenValue(info.GetIsolate(), info.Callee(), V8HiddenValue::customElementDocument(isolate)).As<v8::Object>());
- TOSTRING_VOID(V8StringResource<>, namespaceURI, V8HiddenValue::getHiddenValue(isolate, info.Callee(), V8HiddenValue::customElementNamespaceURI(isolate)));
- TOSTRING_VOID(V8StringResource<>, tagName, V8HiddenValue::getHiddenValue(isolate, info.Callee(), V8HiddenValue::customElementTagName(isolate)));
- v8::Local<v8::Value> maybeType = V8HiddenValue::getHiddenValue(info.GetIsolate(), info.Callee(), V8HiddenValue::customElementType(isolate));
+ ScriptState* scriptState = ScriptState::current(isolate);
+ Document* document = V8Document::toImpl(V8HiddenValue::getHiddenValue(scriptState, info.Callee(), V8HiddenValue::customElementDocument(isolate)).As<v8::Object>());
+ TOSTRING_VOID(V8StringResource<>, namespaceURI, V8HiddenValue::getHiddenValue(scriptState, info.Callee(), V8HiddenValue::customElementNamespaceURI(isolate)));
+ TOSTRING_VOID(V8StringResource<>, tagName, V8HiddenValue::getHiddenValue(scriptState, info.Callee(), V8HiddenValue::customElementTagName(isolate)));
+ v8::Local<v8::Value> maybeType = V8HiddenValue::getHiddenValue(scriptState, info.Callee(), V8HiddenValue::customElementType(isolate));
TOSTRING_VOID(V8StringResource<>, type, maybeType);
ExceptionState exceptionState(ExceptionState::ConstructionContext, "CustomElement", info.Holder(), info.GetIsolate());
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698