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

Unified Diff: mojo/public/tools/bindings/generators/dart_templates/union_definition.tmpl

Issue 1539673003: Generate Mojom Types in Dart (Take 2) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Merge with master Created 4 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/tools/bindings/generators/dart_templates/union_definition.tmpl
diff --git a/mojo/public/tools/bindings/generators/dart_templates/union_definition.tmpl b/mojo/public/tools/bindings/generators/dart_templates/union_definition.tmpl
index 349100007993b2b0f03702eff9866ebe0dfa3c93..13858817f9257b995274aa865ae6c659e91cf2b0 100644
--- a/mojo/public/tools/bindings/generators/dart_templates/union_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/dart_templates/union_definition.tmpl
@@ -1,7 +1,7 @@
{#--- Begin #}
{%- import "encoding_macros.tmpl" as encoding_macros %}
-
+{%- import "mojom_type_macros.tmpl" as mojom_type_macros %}
{%- macro enum_def(union) %}
enum {{union|name}}Tag {
{%- for field in union.fields %}
@@ -108,7 +108,11 @@ class {{union|name}} extends bindings.Union {
{%- endmacro %}
-{%- macro union_def(union) %}
+{%- macro union_def(union, typepkg, package) %}
{{enum_def(union)}}
{{wrapper_def(union)}}
+
+{% if should_gen_mojom_types -%}
+{{ mojom_type_macros.writeMojomTypeDef(union, typepkg, package) }}
+{%- endif -%}
{%- endmacro %}

Powered by Google App Engine
This is Rietveld 408576698