Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl |
| diff --git a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl |
| index a036d5839d10565c153094f907d8123dcc7e408e..83693692264eab532d2055c715f6d86bde738c9b 100644 |
| --- a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl |
| +++ b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl |
| @@ -21,7 +21,7 @@ static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const |
| {% endif %} |
| {% if not method.is_static %} |
| - {% if method.returns_promise %} |
| + {% if method.returns_promise or (interface_name == 'Window' and method.is_cross_origin) %} |
|
dcheng
2017/02/14 10:02:02
This is needed because a remote context only has a
Yuki
2017/02/14 11:24:37
a) Does HasInstance() return true for RemoteDOMWin
dcheng
2017/02/15 11:08:41
It seems to work in my local testing.
|
| // V8DOMConfiguration::DoNotCheckHolder |
| // Make sure that info.Holder() really points to an instance of the type. |
| if (!{{v8_class}}::hasInstance(info.Holder(), info.GetIsolate())) { |
| @@ -547,8 +547,7 @@ static void {{method.name}}OriginSafeMethodGetter{{world_suffix}}(const v8::Prop |
| static int domTemplateKey; // This address is used for a key to look up the dom template. |
| V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); |
| const DOMWrapperWorld& world = DOMWrapperWorld::world(info.GetIsolate()->GetCurrentContext()); |
| - v8::Local<v8::FunctionTemplate> interfaceTemplate = data->findInterfaceTemplate(world, &{{v8_class}}::wrapperTypeInfo); |
| - v8::Local<v8::Signature> signature = v8::Signature::New(info.GetIsolate(), interfaceTemplate); |
| + v8::Local<v8::Signature> signature; |
|
Yuki
2017/02/14 11:24:37
Could you write a comment that we don't set the si
dcheng
2017/02/15 11:08:41
Done.
|
| v8::Local<v8::FunctionTemplate> methodTemplate = data->findOrCreateOperationTemplate(world, &domTemplateKey, {{v8_class_or_partial}}::{{method.name}}MethodCallback{{world_suffix}}, v8Undefined(), signature, {{method.length}}); |
| // Return the function by default, unless the user script has overwritten it. |