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

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

Issue 2637393002: Make mojom-generated C++ string constants really constant. (Closed)
Patch Set: Created 3 years, 11 months 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/wrapper_class_declaration.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_declaration.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_declaration.tmpl
index e03f00cd8cc1c329b2b2366844c70e1f4783f1b0..1f3ec1e2b1b8bca08314cd58275bf74b0f0a16d1 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_declaration.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_declaration.tmpl
@@ -10,11 +10,7 @@ class {{export_attribute}} {{struct.name}} {
{#--- Constants #}
{%- for constant in struct.constants %}
-{%- if constant.kind|is_integral_kind %}
- static const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant|constant_value}};
-{%- else %}
- static const {{constant.kind|cpp_pod_type}} {{constant.name}};
-{%- endif %}
+ static {{constant|format_constant_declaration(nested=True)}};
{%- endfor %}
static {{struct.name}}Ptr New();

Powered by Google App Engine
This is Rietveld 408576698