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

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 comments 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..a7d32d70a2727dda8ab4a5fcc74fb1b21dbbd17a 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8PerContextData.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8PerContextData.cpp
@@ -170,6 +170,19 @@ 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);
haraken 2017/01/28 02:25:20 Shall we add DCHECK(!prototypeObject->IsEmpty())?
chasej 2017/01/30 19:15:56 Done.
+ 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