Chromium Code Reviews| 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)); |