| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 std::unique_ptr<{{class_name}}_{{method.name}}_ProxyToResponder> proxy( | 229 std::unique_ptr<{{class_name}}_{{method.name}}_ProxyToResponder> proxy( |
| 230 new {{class_name}}_{{method.name}}_ProxyToResponder( | 230 new {{class_name}}_{{method.name}}_ProxyToResponder( |
| 231 request_id, is_sync, responder, group_controller)); | 231 request_id, is_sync, responder, group_controller)); |
| 232 return base::Bind(&{{class_name}}_{{method.name}}_ProxyToResponder::Run, | 232 return base::Bind(&{{class_name}}_{{method.name}}_ProxyToResponder::Run, |
| 233 base::Passed(&proxy)); | 233 base::Passed(&proxy)); |
| 234 } | 234 } |
| 235 | 235 |
| 236 ~{{class_name}}_{{method.name}}_ProxyToResponder() { | 236 ~{{class_name}}_{{method.name}}_ProxyToResponder() { |
| 237 #if DCHECK_IS_ON() | 237 #if DCHECK_IS_ON() |
| 238 if (responder_) { | 238 if (responder_) { |
| 239 // Is the Mojo application destroying the callback without running it | 239 // Is the Service destroying the callback without running it |
| 240 // and without first closing the pipe? | 240 // and without first closing the pipe? |
| 241 responder_->DCheckInvalid("The callback passed to " | 241 responder_->DCheckInvalid("The callback passed to " |
| 242 "{{class_name}}::{{method.name}}() was never run."); | 242 "{{class_name}}::{{method.name}}() was never run."); |
| 243 } | 243 } |
| 244 #endif | 244 #endif |
| 245 // If the Callback was dropped then deleting the responder will close | 245 // If the Callback was dropped then deleting the responder will close |
| 246 // the pipe so the calling application knows to stop waiting for a reply. | 246 // the pipe so the calling application knows to stop waiting for a reply. |
| 247 delete responder_; | 247 delete responder_; |
| 248 } | 248 } |
| 249 | 249 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 break; | 440 break; |
| 441 } | 441 } |
| 442 | 442 |
| 443 // Unrecognized message. | 443 // Unrecognized message. |
| 444 ReportValidationError( | 444 ReportValidationError( |
| 445 &validation_context, | 445 &validation_context, |
| 446 mojo::internal::VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD); | 446 mojo::internal::VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD); |
| 447 return false; | 447 return false; |
| 448 } | 448 } |
| 449 {%- endif -%} | 449 {%- endif -%} |
| OLD | NEW |