| OLD | NEW |
| 1 {%- import "interface_macros.tmpl" as interface_macros %} | 1 {%- import "interface_macros.tmpl" as interface_macros %} |
| 2 {%- import "struct_macros.tmpl" as struct_macros %} | 2 {%- import "struct_macros.tmpl" as struct_macros %} |
| 3 {%- from "enum_macros.tmpl" import is_valid_enum_def %} | 3 {%- from "enum_macros.tmpl" import is_valid_enum_def %} |
| 4 {%- from "enum_macros.tmpl" import global_enum_operators_def %} | 4 {%- from "enum_macros.tmpl" import global_enum_operators_def %} |
| 5 | 5 |
| 6 {%- set class_name = interface.name %} | 6 {%- set class_name = interface.name %} |
| 7 {%- set proxy_name = interface.name ~ "Proxy" %} | 7 {%- set proxy_name = interface.name ~ "Proxy" %} |
| 8 {%- set namespace_as_string = "%s"|format(namespace|replace(".","::")) %} | 8 {%- set namespace_as_string = "%s"|format(namespace|replace(".","::")) %} |
| 9 | 9 |
| 10 {%- macro alloc_params(struct) %} | 10 {%- macro alloc_params(struct) %} |
| 11 {%- for param in struct.packed.packed_fields_in_ordinal_order %} | 11 {%- for param in struct.packed.packed_fields_in_ordinal_order %} |
| 12 {{param.field.kind|cpp_result_type}} p_{{param.field.name}} {}; | 12 {{param.field.kind|cpp_result_type}} p_{{param.field.name}} {}; |
| 13 {%- endfor %} | 13 {%- endfor %} |
| 14 {{struct_macros.deserialize(struct, "params", "p_%s")}} | 14 {{struct_macros.deserialize(struct, "params", "p_%s")}} |
| 15 {%- endmacro %} | 15 {%- endmacro %} |
| 16 | 16 |
| 17 {%- macro pass_params(parameters) %} | 17 {%- macro pass_params(parameters) %} |
| 18 {%- for param in parameters %} | 18 {%- for param in parameters %} |
| 19 {%- if param.kind|is_move_only_kind -%} | 19 {%- if param.kind|is_move_only_kind -%} |
| 20 p_{{param.name}}.Pass() | 20 p_{{param.name}}.Pass() |
| 21 {%- else -%} | 21 {%- else -%} |
| 22 p_{{param.name}} | 22 p_{{param.name}} |
| 23 {%- endif -%} | 23 {%- endif -%} |
| 24 {%- if not loop.last %}, {% endif %} | 24 {%- if not loop.last %}, {% endif %} |
| 25 {%- endfor %} | 25 {%- endfor %} |
| 26 {%- endmacro %} | 26 {%- endmacro %} |
| 27 | 27 |
| 28 {%- macro build_message(struct, struct_display_name) -%} | 28 {%- macro build_message(struct, struct_display_name) -%} |
| 29 {{struct_macros.serialize(struct, struct_display_name, "in_%s", "params", "bui
lder.buffer()")}} | 29 {{struct_macros.serialize(struct, struct_display_name, "in_%s", "params", "bui
lder.buffer()", false)}} |
| 30 params->EncodePointersAndHandles(builder.message()->mutable_handles()); | 30 params->EncodePointersAndHandles(builder.message()->mutable_handles()); |
| 31 {%- endmacro %} | 31 {%- endmacro %} |
| 32 | 32 |
| 33 {#--- Begin #} | 33 {#--- Begin #} |
| 34 MOJO_STATIC_CONST_MEMBER_DEFINITION const char {{class_name}}::Name_[] = "{{name
space_as_string}}::{{class_name}}"; | 34 MOJO_STATIC_CONST_MEMBER_DEFINITION const char {{class_name}}::Name_[] = "{{name
space_as_string}}::{{class_name}}"; |
| 35 MOJO_STATIC_CONST_MEMBER_DEFINITION const uint32_t {{class_name}}::Version_; | 35 MOJO_STATIC_CONST_MEMBER_DEFINITION const uint32_t {{class_name}}::Version_; |
| 36 | 36 |
| 37 {#--- Constants #} | 37 {#--- Constants #} |
| 38 {%- for constant in interface.constants %} | 38 {%- for constant in interface.constants %} |
| 39 {%- if constant.kind|is_integral_kind %} | 39 {%- if constant.kind|is_integral_kind %} |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 default: | 315 default: |
| 316 break; | 316 break; |
| 317 } | 317 } |
| 318 | 318 |
| 319 // Unrecognized message. | 319 // Unrecognized message. |
| 320 ReportValidationError( | 320 ReportValidationError( |
| 321 mojo::internal::VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD); | 321 mojo::internal::VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD); |
| 322 return false; | 322 return false; |
| 323 } | 323 } |
| 324 {%- endif -%} | 324 {%- endif -%} |
| OLD | NEW |