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

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

Issue 2640823004: Allow origin trials to be enabled by script (Closed)
Patch Set: Address nit Created 3 years, 11 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/V8PerContextData.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PerContextData.cpp b/third_party/WebKit/Source/bindings/core/v8/V8PerContextData.cpp
index 2f2ff3968943803d2f9cb5135b898f2ffe3d21b5..1858130f979d45b9560496c44f1e500c446acfeb 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8PerContextData.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8PerContextData.cpp
@@ -170,6 +170,20 @@ v8::Local<v8::Object> V8PerContextData::prototypeForType(
return prototypeValue.As<v8::Object>();
}
+bool V8PerContextData::getExistingConstructorAndPrototypeForType(
+ const WrapperTypeInfo* type,
+ v8::Local<v8::Object>* prototypeObject,
+ v8::Local<v8::Function>* interfaceObject) {
+ *interfaceObject = m_constructorMap.Get(type);
+ if (interfaceObject->IsEmpty()) {
+ *prototypeObject = v8::Local<v8::Object>();
+ return false;
+ }
+ *prototypeObject = prototypeForType(type);
+ DCHECK(!prototypeObject->IsEmpty());
+ return true;
+}
+
void V8PerContextData::addCustomElementBinding(
std::unique_ptr<V0CustomElementBinding> binding) {
m_customElementBindings.push_back(std::move(binding));

Powered by Google App Engine
This is Rietveld 408576698