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

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/interface_definition.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/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 7a030238623cef01e45cf74dab417ea83c6cbb3a..e76b919e668f589274c16febc9ab123a5fe65043 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
@@ -49,6 +49,13 @@ params->{{param.name}}()
builder.Finish(&message);
{%- endmacro %}
+{#--- Begin #}
+
+{#--- Constants #}
+{% for constant in interface.constants %}
+const {{constant.kind|cpp_pod_type}} {{interface.name}}::{{constant.name}} = {{constant.value|expression_to_text(module)}};
+{%- endfor %}
+
{#--- ForwardToCallback definition #}
{%- for method in interface.methods -%}
{%- if method.response_parameters != None %}

Powered by Google App Engine
This is Rietveld 408576698