summaryrefslogtreecommitdiffstats
path: root/mojo/public
diff options
context:
space:
mode:
authoryzshen <yzshen@chromium.org>2016-03-10 12:50:30 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-10 20:52:20 +0000
commita061a917ebc0d16fb67d2644d93bfdca7eec92d3 (patch)
treed5284b95547b89b45e772d2b40e27ef49aedd4e1 /mojo/public
parent3ba26c009b0b2583562b695c426391f71b626f33 (diff)
downloadchromium_src-a061a917ebc0d16fb67d2644d93bfdca7eec92d3.zip
chromium_src-a061a917ebc0d16fb67d2644d93bfdca7eec92d3.tar.gz
chromium_src-a061a917ebc0d16fb67d2644d93bfdca7eec92d3.tar.bz2
Reland: 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. The original CL was https://codereview.chromium.org/1778793004/ BUG=None TBR=ben@chromium.org Review URL: https://codereview.chromium.org/1782543004 Cr-Commit-Position: refs/heads/master@{#380459}
Diffstat (limited to 'mojo/public')
-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
3 files changed, 3 insertions, 4 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,