Index: third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/union_definition.tmpl |
diff --git a/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/union_definition.tmpl b/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/union_definition.tmpl |
index 487d2a5cc137be900891db0b3d20dfc3f28d1541..087499a0d5d491fc7f65796ccf5563c8a1d37c83 100644 |
--- a/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/union_definition.tmpl |
+++ b/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/union_definition.tmpl |
@@ -62,8 +62,12 @@ void {{class_name}}::EncodePointersAndHandles( |
case {{enum_name}}::{{field.name|upper}}: { |
{%- if field.kind|is_object_kind %} |
mojo::internal::Encode(&data.f_{{field.name}}, handles); |
-{%- elif field.kind|is_any_handle_kind or field.kind|is_interface_kind %} |
+{%- elif field.kind|is_any_handle_kind %} |
mojo::internal::EncodeHandle(&data.f_{{field.name}}, handles); |
+{%- elif field.kind|is_interface_kind %} |
+ mojo::internal::EncodeHandle( |
+ reinterpret_cast<mojo::internal::Interface_Data*>( |
+ &data.f_{{field.name}}), handles); |
{%- endif %} |
return; |
} |
@@ -78,8 +82,12 @@ void {{class_name}}::DecodePointersAndHandles( |
case {{enum_name}}::{{field.name|upper}}: { |
{%- if field.kind|is_object_kind %} |
mojo::internal::Decode(&data.f_{{field.name}}, handles); |
-{%- elif field.kind|is_any_handle_kind or field.kind|is_interface_kind %} |
+{%- elif field.kind|is_any_handle_kind %} |
mojo::internal::DecodeHandle(&data.f_{{field.name}}, handles); |
+{%- elif field.kind|is_interface_kind %} |
+ mojo::internal::DecodeHandle( |
+ reinterpret_cast<mojo::internal::Interface_Data*>( |
+ &data.f_{{field.name}}), handles); |
{%- endif %} |
return; |
} |