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

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

Issue 1454113003: Require an explicit ServiceName annotation for interfaces in C++. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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
Index: mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
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 afa5c2cdb5d1d97a55864d3aab7f2fcb4a24ac9d..79f71fa4f7b1d61f38150bf6dd1c2bb98c2127d5 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
@@ -5,7 +5,6 @@
{%- set class_name = interface.name %}
{%- set proxy_name = interface.name ~ "Proxy" %}
-{%- set namespace_as_string = "%s"|format(namespace|replace(".","::")) %}
{%- macro alloc_params(struct) %}
{%- for param in struct.packed.packed_fields_in_ordinal_order %}
@@ -31,7 +30,9 @@ p_{{param.name}}
{%- endmacro %}
{#--- Begin #}
-MOJO_STATIC_CONST_MEMBER_DEFINITION const char {{class_name}}::Name_[] = "{{namespace_as_string}}::{{class_name}}";
+{%- if interface.service_name %}
+MOJO_STATIC_CONST_MEMBER_DEFINITION const char {{class_name}}::Name_[] = "{{interface.service_name}}";
+{%- endif %}
MOJO_STATIC_CONST_MEMBER_DEFINITION const uint32_t {{class_name}}::Version_;
{#--- Constants #}

Powered by Google App Engine
This is Rietveld 408576698