Chromium Code Reviews| Index: mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl |
| diff --git a/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl b/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl |
| index 1b5cafa01e4501e67a3e9694bdb55d818a98513e..9ae211659b890555de2057ac2a635110792fa2ff 100644 |
| --- a/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl |
| +++ b/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl |
| @@ -2,12 +2,23 @@ |
| var k{{interface.name}}_{{method.name}}_Name = {{method.ordinal}}; |
| {%- endfor %} |
| + function {{interface.name}}Ptr() { |
|
yzshen1
2016/12/02 00:22:59
As you can see, I decided to create FooPtr which i
|
| + bindings.InterfacePtrBase.call(this, {{interface.name}}); |
| + } |
| + {{interface.name}}Ptr.prototype = |
| + Object.create(bindings.InterfacePtrBase.prototype); |
| + |
| function {{interface.name}}Proxy(receiver) { |
| bindings.ProxyBase.call(this, receiver); |
| } |
| {{interface.name}}Proxy.prototype = Object.create(bindings.ProxyBase.prototype); |
| {%- for method in interface.methods %} |
| + {{interface.name}}Ptr.prototype.{{method.name|stylize_method}} = function() { |
| + return {{interface.name}}Proxy.prototype.{{method.name|stylize_method}} |
| + .apply(this.connection.remote, arguments); |
| + }; |
| + |
| {{interface.name}}Proxy.prototype.{{method.name|stylize_method}} = function( |
| {%- for parameter in method.parameters -%} |
| {{parameter.name}}{% if not loop.last %}, {% endif %} |