diff options
author | yzshen <yzshen@chromium.org> | 2016-03-09 18:03:48 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-10 02:06:20 +0000 |
commit | 026e10b3842af957773aee40dc3736eecb7faa0c (patch) | |
tree | 91236b8b56eb19fb9c48278043b0fa29a8aa0f8f /mojo/public | |
parent | 91c0bf17a2a482acd05dca6fb1b9b3a14e38825a (diff) | |
download | chromium_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/public')
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, |