| OLD | NEW |
| 1 {%- set class_name = union.name ~ "_Data" -%} | 1 {%- set class_name = union.name ~ "_Data" -%} |
| 2 {%- set enum_name = union.name ~ "_Tag" -%} | 2 {%- set enum_name = union.name ~ "_Tag" -%} |
| 3 {%- import "struct_macros.tmpl" as struct_macros %} | 3 {%- import "struct_macros.tmpl" as struct_macros %} |
| 4 | 4 |
| 5 class {{class_name}} { | 5 class {{class_name}} { |
| 6 public: | 6 public: |
| 7 // Used to identify Mojom Union Data Classes. | 7 // Used to identify Mojom Union Data Classes. |
| 8 typedef void MojomUnionDataType; | 8 typedef void MojomUnionDataType; |
| 9 static {{class_name}}* New(mojo::internal::Buffer* buf); | 9 static {{class_name}}* New(mojo::internal::Buffer* buf); |
| 10 {{class_name}}(); | 10 {{class_name}}(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 {%- else %} | 37 {%- else %} |
| 38 {{field.kind|cpp_union_field_type}} f_{{field.name}}; | 38 {{field.kind|cpp_union_field_type}} f_{{field.name}}; |
| 39 {%- endif %} | 39 {%- endif %} |
| 40 {%- endfor %} | 40 {%- endfor %} |
| 41 uint64_t unknown; | 41 uint64_t unknown; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 uint32_t size; | 44 uint32_t size; |
| 45 {{enum_name}} tag; | 45 {{enum_name}} tag; |
| 46 Union_ data; | 46 Union_ data; |
| 47 | |
| 48 void EncodePointers(); | |
| 49 void DecodePointers(); | |
| 50 }; | 47 }; |
| 51 static_assert(sizeof({{class_name}}) == mojo::internal::kUnionDataSize, | 48 static_assert(sizeof({{class_name}}) == mojo::internal::kUnionDataSize, |
| 52 "Bad sizeof({{class_name}})"); | 49 "Bad sizeof({{class_name}})"); |
| OLD | NEW |