| OLD | NEW |
| 1 {%- import "struct_macros.tmpl" as struct_macros %} | 1 {%- import "struct_macros.tmpl" as struct_macros %} |
| 2 {%- set mojom_type = struct|get_qualified_name_for_kind %} | 2 {%- set mojom_type = struct|get_qualified_name_for_kind %} |
| 3 {%- set data_type = struct|get_qualified_name_for_kind(internal=True) %} | 3 {%- set data_type = struct|get_qualified_name_for_kind(internal=True) %} |
| 4 | 4 |
| 5 template <> | 5 template <> |
| 6 struct StructTraits<{{mojom_type}}, {{mojom_type}}Ptr> { | 6 struct {{export_attribute}} StructTraits<{{mojom_type}}, {{mojom_type}}Ptr> { |
| 7 static bool IsNull(const {{mojom_type}}Ptr& input) { return !input; } | 7 static bool IsNull(const {{mojom_type}}Ptr& input) { return !input; } |
| 8 static void SetToNull({{mojom_type}}Ptr* output) { output->reset(); } | 8 static void SetToNull({{mojom_type}}Ptr* output) { output->reset(); } |
| 9 | 9 |
| 10 {%- for field in struct.fields %} | 10 {%- for field in struct.fields %} |
| 11 {%- set return_ref = field.kind|is_object_kind or | 11 {%- set return_ref = field.kind|is_object_kind or |
| 12 field.kind|is_any_handle_or_interface_kind %} | 12 field.kind|is_any_handle_or_interface_kind %} |
| 13 {%- if return_ref %} | 13 {%- if return_ref %} |
| 14 static decltype({{mojom_type}}::{{field.name}})& {{field.name}}( | 14 static decltype({{mojom_type}}::{{field.name}})& {{field.name}}( |
| 15 {{mojom_type}}Ptr& input) { | 15 {{mojom_type}}Ptr& input) { |
| 16 return input->{{field.name}}; | 16 return input->{{field.name}}; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 SerializationContext* context) { | 72 SerializationContext* context) { |
| 73 if (!input) | 73 if (!input) |
| 74 return CallSetToNullIfExists<Traits>(output); | 74 return CallSetToNullIfExists<Traits>(output); |
| 75 | 75 |
| 76 {{mojom_type}}DataView data_view(input, context); | 76 {{mojom_type}}DataView data_view(input, context); |
| 77 return Traits::Read(data_view, output); | 77 return Traits::Read(data_view, output); |
| 78 } | 78 } |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace internal | 81 } // namespace internal |
| OLD | NEW |