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

Unified Diff: mojo/public/bindings/generators/cpp_templates/interface_declaration.tmpl

Issue 99623010: Add support for enums within structs and interfaces to mojom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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/bindings/generators/cpp_templates/interface_declaration.tmpl
diff --git a/mojo/public/bindings/generators/cpp_templates/interface_declaration.tmpl b/mojo/public/bindings/generators/cpp_templates/interface_declaration.tmpl
index b18289562abb0686c766ba22181cc1946606db74..47d741b314150d86070404bb1baae72d8d515d9b 100644
--- a/mojo/public/bindings/generators/cpp_templates/interface_declaration.tmpl
+++ b/mojo/public/bindings/generators/cpp_templates/interface_declaration.tmpl
@@ -8,7 +8,14 @@ class {{interface.name}} {
typedef {{interface.name}}Stub _Stub;
typedef {{interface.peer}} _Peer;
-{%- for method in interface.methods %}
+{#--- Enums #}
+{%- for enum in interface.enums %}
+{% macro enum_def() %}{% include "enum_declaration.tmpl" %}{% endmacro %}
+ {{enum_def()|indent(2)}}
+{%- endfor %}
+
+{#--- Methods #}
+{% for method in interface.methods %}
virtual void {{method.name}}(
{%- for param in method.parameters -%}
{{param.kind|cpp_const_wrapper_type}} {{param.name}}

Powered by Google App Engine
This is Rietveld 408576698