| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 mojo::MessageReceiverWithStatus* responder, | 262 mojo::MessageReceiverWithStatus* responder, |
| 263 scoped_refptr<mojo::AssociatedGroupController> group_controller) | 263 scoped_refptr<mojo::AssociatedGroupController> group_controller) |
| 264 : request_id_(request_id), | 264 : request_id_(request_id), |
| 265 is_sync_(is_sync), | 265 is_sync_(is_sync), |
| 266 responder_(responder), | 266 responder_(responder), |
| 267 serialization_context_(std::move(group_controller)) { | 267 serialization_context_(std::move(group_controller)) { |
| 268 } | 268 } |
| 269 | 269 |
| 270 void Run( | 270 void Run( |
| 271 {{interface_macros.declare_responder_params( | 271 {{interface_macros.declare_responder_params( |
| 272 "in_", method.response_parameters, for_blink, | 272 "in_", method.response_parameters, for_blink)}}); |
| 273 use_new_wrapper_types)}}); | |
| 274 | 273 |
| 275 uint64_t request_id_; | 274 uint64_t request_id_; |
| 276 bool is_sync_; | 275 bool is_sync_; |
| 277 mojo::MessageReceiverWithStatus* responder_; | 276 mojo::MessageReceiverWithStatus* responder_; |
| 278 // TODO(yzshen): maybe I should use a ref to the original one? | 277 // TODO(yzshen): maybe I should use a ref to the original one? |
| 279 mojo::internal::SerializationContext serialization_context_; | 278 mojo::internal::SerializationContext serialization_context_; |
| 280 | 279 |
| 281 DISALLOW_COPY_AND_ASSIGN({{class_name}}_{{method.name}}_ProxyToResponder); | 280 DISALLOW_COPY_AND_ASSIGN({{class_name}}_{{method.name}}_ProxyToResponder); |
| 282 }; | 281 }; |
| 283 | 282 |
| 284 void {{class_name}}_{{method.name}}_ProxyToResponder::Run( | 283 void {{class_name}}_{{method.name}}_ProxyToResponder::Run( |
| 285 {{interface_macros.declare_responder_params( | 284 {{interface_macros.declare_responder_params( |
| 286 "in_", method.response_parameters, for_blink, | 285 "in_", method.response_parameters, for_blink)}}) { |
| 287 use_new_wrapper_types)}}) { | |
| 288 {{struct_macros.get_serialized_size(response_params_struct, "in_%s", | 286 {{struct_macros.get_serialized_size(response_params_struct, "in_%s", |
| 289 "&serialization_context_")}} | 287 "&serialization_context_")}} |
| 290 mojo::internal::ResponseMessageBuilder builder( | 288 mojo::internal::ResponseMessageBuilder builder( |
| 291 {{message_name}}, size, request_id_, | 289 {{message_name}}, size, request_id_, |
| 292 is_sync_ ? mojo::Message::kFlagIsSync : 0); | 290 is_sync_ ? mojo::Message::kFlagIsSync : 0); |
| 293 {{build_message(response_params_struct, "in_%s", params_description, | 291 {{build_message(response_params_struct, "in_%s", params_description, |
| 294 "&serialization_context_")}} | 292 "&serialization_context_")}} |
| 295 bool ok = responder_->Accept(builder.message()); | 293 bool ok = responder_->Accept(builder.message()); |
| 296 ALLOW_UNUSED_LOCAL(ok); | 294 ALLOW_UNUSED_LOCAL(ok); |
| 297 // TODO(darin): !ok returned here indicates a malformed message, and that may | 295 // TODO(darin): !ok returned here indicates a malformed message, and that may |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 break; | 446 break; |
| 449 } | 447 } |
| 450 | 448 |
| 451 // Unrecognized message. | 449 // Unrecognized message. |
| 452 ReportValidationError( | 450 ReportValidationError( |
| 453 &validation_context, | 451 &validation_context, |
| 454 mojo::internal::VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD); | 452 mojo::internal::VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD); |
| 455 return false; | 453 return false; |
| 456 } | 454 } |
| 457 {%- endif -%} | 455 {%- endif -%} |
| OLD | NEW |