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

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

Issue 628763002: Mojo JS bindings: simplify mojo.connectToService() usage - Part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/module.js.tmpl
diff --git a/mojo/public/tools/bindings/generators/js_templates/module.js.tmpl b/mojo/public/tools/bindings/generators/js_templates/module.js.tmpl
index 93fa537023dddb7683fe24bab0a297244c3b32e6..9d3b4e440cb05f8c295c6f471446cfe70817d6e1 100644
--- a/mojo/public/tools/bindings/generators/js_templates/module.js.tmpl
+++ b/mojo/public/tools/bindings/generators/js_templates/module.js.tmpl
@@ -46,8 +46,22 @@ define("{{module.path}}", [
exports.{{struct.name}} = {{struct.name}};
{%- endfor %}
{%- for interface in interfaces %}
- exports.{{interface.name}}Proxy = {{interface.name}}Proxy;
- exports.{{interface.name}}Stub = {{interface.name}}Stub;
+ exports.{{interface.name}} = {
Matt Perry 2014/10/03 22:57:49 I think this block belongs in interface_definition
hansmuller 2014/10/06 19:05:19 Done.
+ name: '{{namespace|replace(".","::")}}::{{interface.name}}',
+ proxyClass: {{interface.name}}Proxy,
+ stubClass: {{interface.name}}Stub,
+ validateRequest: validate{{interface.name}}Request,
+{%- if interface|has_callbacks %}
+ validateResponse: validate{{interface.name}}Response,
+{%- else %}
+ validateResponse: null,
+{%- endif %}
+ };
+{%- endfor %}
+{%- for interface in interfaces %}
+{%- if interface.client in interfaces|map(attribute='name') %}
+ exports.{{interface.name}}.client = exports.{{interface.client}};
+{%- endif %}
{%- endfor %}
return exports;
});

Powered by Google App Engine
This is Rietveld 408576698