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

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

Issue 1065653006: Array and map members for unions. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 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_union_class_definition.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_union_class_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_union_class_definition.tmpl
index 46931bcde02830012cd544f8c259c688b58e02eb..4355f41cfd386dd08d5e3078ad7d5f41d53d409a 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_union_class_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_union_class_definition.tmpl
@@ -23,7 +23,7 @@
case Tag::{{field.name|upper}}:
{% if field.kind|is_string_kind %}
rv->set_{{field.name}}(*(data_.{{field.name}}));
-{% elif field.kind|is_struct_kind %}
+{% elif field.kind|is_object_kind %}
rv->set_{{field.name}}(data_.{{field.name}}->Clone());
{%- else %}
rv->set_{{field.name}}(data_.{{field.name}});
@@ -72,7 +72,7 @@ void {{union.name}}::set_{{field.name}}({{field.kind|cpp_const_wrapper_type}} {{
SwitchActive(Tag::{{field.name|upper}});
{% if field.kind|is_string_kind %}
*(data_.{{field.name}}) = {{field.name}};
-{% elif field.kind|is_struct_kind %}
+{% elif field.kind|is_object_kind %}
*(data_.{{field.name}}) = {{field.name}}.Pass();
{%- else %}
data_.{{field.name}} = {{field.name}};

Powered by Google App Engine
This is Rietveld 408576698