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

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

Issue 268363003: Mojo: Add support for constants to the IDL compiler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: JS export constants Created 6 years, 7 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 79d1a8f73a1278d6f82d33538321bc6de71f0920..9c56d25b63da4f44de881aed8c9cfb790b286ba5 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
@@ -2,6 +2,11 @@ class {{struct.name}} {
public:
typedef internal::{{struct.name}}_Data Data;
+{#--- Constants #}
+{% for constant in struct.constants %}
+ static const {{constant.kind|cpp_pod_type}} {{constant.name}};
+{%- endfor %}
+
{#--- Enums #}
{%- for enum in struct.enums -%}
{% macro enum_def() %}{% include "enum_declaration.tmpl" %}{% endmacro %}

Powered by Google App Engine
This is Rietveld 408576698