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

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

Issue 2828643002: Make customElements.define faster
Patch Set: Try to make Android builder happy. Created 3 years, 8 months 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
Index: third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinitionBuilder.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinitionBuilder.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinitionBuilder.cpp
index f5c1e00ed953583f58a5215aacb07a3b026e79b2..98620e1d922882a7f24c65f926a1c3e85d89836e 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinitionBuilder.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinitionBuilder.cpp
@@ -86,7 +86,7 @@ bool ScriptCustomElementDefinitionBuilder::ValueForName(
exception_state_.RethrowV8Exception(try_catch.Exception());
return false;
}
- return true;
+ return script_state_->ContextIsValid();
}
bool ScriptCustomElementDefinitionBuilder::CheckPrototype() {
@@ -100,7 +100,7 @@ bool ScriptCustomElementDefinitionBuilder::CheckPrototype() {
prototype_ = prototype_value.As<v8::Object>();
// If retrieving the prototype destroyed the context, indicate that
// defining the element should not proceed.
- return true;
+ return script_state_->ContextIsValid();
}
bool ScriptCustomElementDefinitionBuilder::CallableForName(
@@ -109,7 +109,7 @@ bool ScriptCustomElementDefinitionBuilder::CallableForName(
v8::Local<v8::Value> value;
if (!ValueForName(prototype_, name, value))
return false;
- // "undefined" means "omitted", so return true.
+ // "undefined" means "omitted" which is valid.
if (value->IsUndefined())
return true;
if (!value->IsFunction()) {
@@ -130,7 +130,7 @@ bool ScriptCustomElementDefinitionBuilder::RetrieveObservedAttributes() {
return true;
Vector<AtomicString> list = ToImplSequence<Vector<AtomicString>>(
script_state_->GetIsolate(), observed_attributes_value, exception_state_);
- if (exception_state_.HadException())
+ if (exception_state_.HadException() || !script_state_->ContextIsValid())
return false;
if (list.IsEmpty())
return true;
@@ -153,9 +153,10 @@ bool ScriptCustomElementDefinitionBuilder::RememberOriginalProperties() {
}
CustomElementDefinition* ScriptCustomElementDefinitionBuilder::Build(
- const CustomElementDescriptor& descriptor) {
+ const CustomElementDescriptor& descriptor,
+ CustomElementDefinition::Id id) {
return ScriptCustomElementDefinition::Create(
- script_state_.Get(), registry_, descriptor, constructor_,
+ script_state_.Get(), registry_, descriptor, id, constructor_,
connected_callback_, disconnected_callback_, adopted_callback_,
attribute_changed_callback_, observed_attributes_);
}

Powered by Google App Engine
This is Rietveld 408576698