summaryrefslogtreecommitdiffstats
path: root/mojo
diff options
context:
space:
mode:
authoryzshen <yzshen@chromium.org>2016-03-09 18:03:48 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-10 02:06:20 +0000
commit026e10b3842af957773aee40dc3736eecb7faa0c (patch)
tree91236b8b56eb19fb9c48278043b0fa29a8aa0f8f /mojo
parent91c0bf17a2a482acd05dca6fb1b9b3a14e38825a (diff)
downloadchromium_src-026e10b3842af957773aee40dc3736eecb7faa0c.zip
chromium_src-026e10b3842af957773aee40dc3736eecb7faa0c.tar.gz
chromium_src-026e10b3842af957773aee40dc3736eecb7faa0c.tar.bz2
Mojo C++ bindings: replace '::' with '.' in the interface name.
Previously the |foo::Bar::Name_| field was "foo::Bar". With this change it becomes "foo.Bar". Using C++-style namespace in the name doesn't makes too much sense because the name should remain the same across different languages. BUG=None Review URL: https://codereview.chromium.org/1778793004 Cr-Commit-Position: refs/heads/master@{#380301}
Diffstat (limited to 'mojo')
-rw-r--r--mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl3
-rw-r--r--mojo/public/tools/bindings/generators/java_templates/interface_definition.tmpl2
-rw-r--r--mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl2
-rw-r--r--mojo/shell/tests/connect/connect_unittests_manifest.json8
-rw-r--r--mojo/shell/tests/shell/target_manifest.json2
5 files changed, 8 insertions, 9 deletions
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
index de7469c..1512454 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
@@ -3,7 +3,6 @@
{%- set class_name = interface.name %}
{%- set proxy_name = interface.name ~ "Proxy" %}
-{%- set namespace_as_string = "%s"|format(namespace|replace(".","::")) %}
{%- macro alloc_params(struct, serialization_context) %}
bool success = true;
@@ -35,7 +34,7 @@ p_{{param.name}}
{%- endmacro %}
{#--- Begin #}
-MOJO_STATIC_CONST_MEMBER_DEFINITION const char {{class_name}}::Name_[] = "{{namespace_as_string}}::{{class_name}}";
+MOJO_STATIC_CONST_MEMBER_DEFINITION const char {{class_name}}::Name_[] = "{{namespace}}.{{class_name}}";
MOJO_STATIC_CONST_MEMBER_DEFINITION const uint32_t {{class_name}}::Version_;
{#--- Constants #}
diff --git a/mojo/public/tools/bindings/generators/java_templates/interface_definition.tmpl b/mojo/public/tools/bindings/generators/java_templates/interface_definition.tmpl
index 527e15f..6f80b04 100644
--- a/mojo/public/tools/bindings/generators/java_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/java_templates/interface_definition.tmpl
@@ -59,7 +59,7 @@ public static final {{manager_class(interface, True)}} MANAGER =
new {{manager_class(interface, True)}}() {
public String getName() {
- return "{{namespace|replace(".","::")}}::{{interface.name}}";
+ return "{{namespace}}.{{interface.name}}";
}
public int getVersion() {
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 1b5cafa..0f442b8 100644
--- a/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
@@ -161,7 +161,7 @@ params.{{parameter.name}}{% if not loop.last %}, {% endif -%}
}
var {{interface.name}} = {
- name: '{{namespace|replace(".","::")}}::{{interface.name}}',
+ name: '{{namespace}}.{{interface.name}}',
proxyClass: {{interface.name}}Proxy,
stubClass: {{interface.name}}Stub,
validateRequest: validate{{interface.name}}Request,
diff --git a/mojo/shell/tests/connect/connect_unittests_manifest.json b/mojo/shell/tests/connect/connect_unittests_manifest.json
index cb8e865..a36e640 100644
--- a/mojo/shell/tests/connect/connect_unittests_manifest.json
+++ b/mojo/shell/tests/connect/connect_unittests_manifest.json
@@ -3,9 +3,9 @@
"display_name": "Connect Unittests",
"capabilities": {
"mojo:connect_test_package": ["*"],
- "mojo:connect_test_app": ["mojo::shell::test::mojom::ConnectTestService",
- "mojo::shell::test::mojom::StandaloneApp"],
- "mojo:connect_test_a": ["mojo::shell::test::mojom::ConnectTestService",
- "mojo::shell::test::mojom::StandaloneApp"]
+ "mojo:connect_test_app": ["mojo.shell.test.mojom.ConnectTestService",
+ "mojo.shell.test.mojom.StandaloneApp"],
+ "mojo:connect_test_a": ["mojo.shell.test.mojom.ConnectTestService",
+ "mojo.shell.test.mojom.StandaloneApp"]
}
}
diff --git a/mojo/shell/tests/shell/target_manifest.json b/mojo/shell/tests/shell/target_manifest.json
index 68ddc21..f751592 100644
--- a/mojo/shell/tests/shell/target_manifest.json
+++ b/mojo/shell/tests/shell/target_manifest.json
@@ -1,5 +1,5 @@
{
"name": "exe:shell_unittest_target",
"display_name": "Shell Unittest: Target",
- "capabilities": { "mojo:shell_unittest": [ "mojo::shell::test::mojom::CreateInstanceTest" ] }
+ "capabilities": { "mojo:shell_unittest": [ "mojo.shell.test.mojom.CreateInstanceTest" ] }
}