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

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

Issue 326303003: Mojo: Expose service names in the JS bindings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | mojo/public/tools/bindings/generators/mojom_js_generator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 596a7c761c6c7d7606337cbb85d3606441a88495..d46f8eeac9ce86a90c5dc48f7c162ff9f61aac02 100644
--- a/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
@@ -1,3 +1,4 @@
+{%- set namespace_as_string = namespace|replace(".","::") %}
{%- for method in interface.methods %}
var k{{interface.name}}_{{method.name}}_Name = {{method.ordinal}};
{%- endfor %}
@@ -6,6 +7,8 @@
this.receiver_ = receiver;
}
+ {{interface.name}}Proxy.NAME_ = '{{namespace_as_string}}::{{interface.name}}';
+
{%- for method in interface.methods %}
{{interface.name}}Proxy.prototype.{{method.name|stylize_method}} = function(
{%- for parameter in method.parameters -%}
@@ -51,6 +54,8 @@
function {{interface.name}}Stub() {
}
+ {{interface.name}}Stub.NAME_ = '{{namespace_as_string}}::{{interface.name}}';
+
{{interface.name}}Stub.prototype.accept = function(message) {
var reader = new codec.MessageReader(message);
switch (reader.messageName) {
« no previous file with comments | « no previous file | mojo/public/tools/bindings/generators/mojom_js_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698