summaryrefslogtreecommitdiffstats
path: root/mojo
diff options
context:
space:
mode:
authorsammc@chromium.org <sammc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-12 08:41:56 +0000
committersammc@chromium.org <sammc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-12 08:41:56 +0000
commit19d63df74e05b25a95c0f970ed54f762bcd75754 (patch)
tree63621f5ad998550db8b36ae6b777300d14615bfa /mojo
parentf484f8d50093f7f4821cd7951a05e6ef04580829 (diff)
downloadchromium_src-19d63df74e05b25a95c0f970ed54f762bcd75754.zip
chromium_src-19d63df74e05b25a95c0f970ed54f762bcd75754.tar.gz
chromium_src-19d63df74e05b25a95c0f970ed54f762bcd75754.tar.bz2
Mojo: Expose service names in the JS bindings.
Review URL: https://codereview.chromium.org/326303003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276588 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo')
-rw-r--r--mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl5
-rw-r--r--mojo/public/tools/bindings/generators/mojom_js_generator.py1
2 files changed, 6 insertions, 0 deletions
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 596a7c76..d46f8ee 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) {
diff --git a/mojo/public/tools/bindings/generators/mojom_js_generator.py b/mojo/public/tools/bindings/generators/mojom_js_generator.py
index 8d1ffba..1fa3510 100644
--- a/mojo/public/tools/bindings/generators/mojom_js_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_js_generator.py
@@ -164,6 +164,7 @@ class Generator(generator.Generator):
@UseJinja("js_templates/module.js.tmpl", filters=js_filters)
def GenerateJsModule(self):
return {
+ "namespace": self.module.namespace,
"imports": self.GetImports(),
"kinds": self.module.kinds,
"enums": self.module.enums,