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

Unified Diff: mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl

Issue 2615633005: Mojo JS bindings: remove usage of the connection module. (Closed)
Patch Set: . 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: 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 6eb1ea272ac8205dcc96f41812fa6a7f063deb8a..eb73532d75921af310e37c9e2adbda83474153e4 100644
--- a/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
@@ -8,9 +8,8 @@
}
function {{interface.name}}Proxy(receiver) {
- bindings.ProxyBase.call(this, receiver);
+ this.receiver_ = receiver;
}
- {{interface.name}}Proxy.prototype = Object.create(bindings.ProxyBase.prototype);
{%- for method in interface.methods %}
{{interface.name}}Ptr.prototype.{{method.name|stylize_method}} = function() {
@@ -57,15 +56,13 @@
{%- endfor %}
function {{interface.name}}Stub(delegate) {
- bindings.StubBase.call(this, delegate);
+ this.delegate_ = delegate;
}
- {{interface.name}}Stub.prototype = Object.create(bindings.StubBase.prototype);
{%- for method in interface.methods %}
{%- set js_method_name = method.name|stylize_method %}
-{%- set delegate_expr = "bindings.StubBindings(this).delegate" %}
{{interface.name}}Stub.prototype.{{js_method_name}} = function({{method.parameters|map(attribute='name')|join(', ')}}) {
- return {{delegate_expr}} && {{delegate_expr}}.{{js_method_name}} && {{delegate_expr}}.{{js_method_name}}({{method.parameters|map(attribute='name')|join(', ')}});
+ return this.delegate_ && this.delegate_.{{js_method_name}} && this.delegate_.{{js_method_name}}({{method.parameters|map(attribute='name')|join(', ')}});
}
{%- endfor %}
« no previous file with comments | « mojo/public/js/validation_unittests.js ('k') | mojo/public/tools/bindings/generators/js_templates/module.amd.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698