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

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

Issue 2247083003: Mojo C++ bindings: extract code shared by different variants. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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_declaration.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl
index 9db86b125702ce8176f0802081f45d6fa36fdd8d..3313c94586e7310e3eb093c728853486bfa9aab3 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl
@@ -25,13 +25,8 @@ class {{export_attribute}} {{interface.name}} {
{%- endif %}
{#--- Enums #}
-{% from "enum_macros.tmpl" import enum_decl -%}
{%- for enum in interface.enums %}
-{%- if enum|is_native_only_kind %}
- using {{enum.name}} = mojo::NativeEnum;
-{%- else %}
- {{enum_decl(enum)|indent(2)}}
-{%- endif %}
+ using {{enum.name}} = {{enum|get_name_for_kind(flatten_nested_kind=True)}};
{%- endfor %}
{#--- Constants #}

Powered by Google App Engine
This is Rietveld 408576698