| 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 | 3 |
| 4 {%- set class_name = interface.name %} | 4 {%- set class_name = interface.name %} |
| 5 {%- set proxy_name = interface.name ~ "Proxy" %} | 5 {%- set proxy_name = interface.name ~ "Proxy" %} |
| 6 {%- set namespace_as_string = "%s"|format(namespace|replace(".","::")) %} | 6 {%- set namespace_as_string = "%s"|format(namespace|replace(".","::")) %} |
| 7 | 7 |
| 8 {%- macro alloc_params(struct, params, message, serialization_context, | 8 {%- macro alloc_params(struct, params, message, serialization_context, |
| 9 description) %} | 9 description) %} |
| 10 ({{serialization_context}})->handles.Swap(({{message}})->mutable_handles()); | 10 ({{serialization_context}})->handles.Swap(({{message}})->mutable_handles()); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 "params", "builder.buffer()", | 37 "params", "builder.buffer()", |
| 38 serialization_context)}} | 38 serialization_context)}} |
| 39 ({{serialization_context}})->handles.Swap( | 39 ({{serialization_context}})->handles.Swap( |
| 40 builder.message()->mutable_handles()); | 40 builder.message()->mutable_handles()); |
| 41 {%- endmacro %} | 41 {%- endmacro %} |
| 42 | 42 |
| 43 {#--- Begin #} | 43 {#--- Begin #} |
| 44 const char {{class_name}}::Name_[] = "{{namespace_as_string}}::{{class_name}}"; | 44 const char {{class_name}}::Name_[] = "{{namespace_as_string}}::{{class_name}}"; |
| 45 const uint32_t {{class_name}}::Version_; | 45 const uint32_t {{class_name}}::Version_; |
| 46 | 46 |
| 47 {#--- Metadata #} |
| 48 const mojo::MethodMetadata {{class_name}}::kMethodMetadata[] = { |
| 49 {%- for method in interface.methods %} |
| 50 { {{method.min_version|default(0, true)}}, {{method.ordinal}}, "{{method.name}
}" }, |
| 51 {%- endfor %} |
| 52 }; |
| 53 |
| 47 {#--- Constants #} | 54 {#--- Constants #} |
| 48 {%- for constant in interface.constants %} | 55 {%- for constant in interface.constants %} |
| 49 {%- if constant.kind|is_integral_kind %} | 56 {%- if constant.kind|is_integral_kind %} |
| 50 const {{constant.kind|cpp_pod_type}} {{interface.name}}::{{constant.name}}; | 57 const {{constant.kind|cpp_pod_type}} {{interface.name}}::{{constant.name}}; |
| 51 {%- else %} | 58 {%- else %} |
| 52 const {{constant.kind|cpp_pod_type}} {{interface.name}}::{{constant.name}} = {{c
onstant|constant_value}}; | 59 const {{constant.kind|cpp_pod_type}} {{interface.name}}::{{constant.name}} = {{c
onstant|constant_value}}; |
| 53 {%- endif %} | 60 {%- endif %} |
| 54 {%- endfor %} | 61 {%- endfor %} |
| 55 | 62 |
| 56 | 63 |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 break; | 453 break; |
| 447 } | 454 } |
| 448 | 455 |
| 449 // Unrecognized message. | 456 // Unrecognized message. |
| 450 ReportValidationError( | 457 ReportValidationError( |
| 451 &validation_context, | 458 &validation_context, |
| 452 mojo::internal::VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD); | 459 mojo::internal::VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD); |
| 453 return false; | 460 return false; |
| 454 } | 461 } |
| 455 {%- endif -%} | 462 {%- endif -%} |
| OLD | NEW |