| Index: mojo/public/tools/bindings/generators/cpp_templates/union_serialization_definition.tmpl
|
| diff --git a/mojo/public/tools/bindings/generators/cpp_templates/union_serialization_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/union_serialization_definition.tmpl
|
| deleted file mode 100644
|
| index 5394950b2dc5c8989e04f7fe24dbc79fc63cc155..0000000000000000000000000000000000000000
|
| --- a/mojo/public/tools/bindings/generators/cpp_templates/union_serialization_definition.tmpl
|
| +++ /dev/null
|
| @@ -1,42 +0,0 @@
|
| -{%- set mojom_type = union|get_qualified_name_for_kind %}
|
| -
|
| -// static
|
| -bool UnionTraits<{{mojom_type}}::DataView, {{mojom_type}}Ptr>::Read(
|
| - {{mojom_type}}::DataView input,
|
| - {{mojom_type}}Ptr* output) {
|
| - *output = {{mojom_type}}::New();
|
| - {{mojom_type}}Ptr& result = *output;
|
| -
|
| - internal::UnionAccessor<{{mojom_type}}> result_acc(result.get());
|
| - switch (input.tag()) {
|
| -{%- for field in union.fields %}
|
| - case {{mojom_type}}::Tag::{{field.name|upper}}: {
|
| -{%- set name = field.name %}
|
| -{%- set kind = field.kind %}
|
| -{%- set serializer_type = kind|unmapped_type_for_serializer %}
|
| -{%- if kind|is_object_kind %}
|
| - result_acc.SwitchActive({{mojom_type}}::Tag::{{name|upper}});
|
| - if (!input.Read{{name|under_to_camel}}(result_acc.data()->{{name}}))
|
| - return false;
|
| -
|
| -{%- elif kind|is_any_handle_or_interface_kind %}
|
| - auto result_{{name}} = input.Take{{name|under_to_camel}}();
|
| - result->set_{{name}}(std::move(result_{{name}}));
|
| -
|
| -{%- elif kind|is_enum_kind %}
|
| - decltype(result->get_{{name}}()) result_{{name}};
|
| - if (!input.Read{{name|under_to_camel}}(&result_{{name}}))
|
| - return false;
|
| - result->set_{{name}}(result_{{name}});
|
| -
|
| -{%- else %}
|
| - result->set_{{name}}(input.{{name}}());
|
| -{%- endif %}
|
| - break;
|
| - }
|
| -{%- endfor %}
|
| - default:
|
| - return false;
|
| - }
|
| - return true;
|
| -}
|
|
|