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

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_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/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 9ba7afd4bfa3da75ecddf913d38d4b771079fc07..6d4516c435afaaf72a09976a161aa324e3a198c5 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
@@ -1,5 +1,3 @@
-{% from "enum_macros.tmpl" import enum_decl -%}
-
class {{export_attribute}} {{struct.name}} {
public:
using DataView = {{struct.name}}DataView;
@@ -7,11 +5,7 @@ class {{export_attribute}} {{struct.name}} {
{#--- Enums #}
{%- for enum in struct.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