| Index: mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
|
| diff --git a/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
|
| index de7469c846da597aaf4f953b18b9f08e553ce4e7..c437738107086ff02e89c67de9b330aa49d35b8d 100644
|
| --- a/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
|
| +++ b/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
|
| @@ -200,15 +200,18 @@ class {{class_name}}_{{method.name}}_ProxyToResponder
|
| : public {{class_name}}::{{method.name}}Callback::Runnable {
|
| public:
|
| ~{{class_name}}_{{method.name}}_ProxyToResponder() override {
|
| - // Is the Mojo application destroying the callback without running it
|
| - // and without first closing the pipe?
|
| - bool callback_was_dropped = responder_ && responder_->IsValid();
|
| +#if DCHECK_IS_ON()
|
| + if (responder_) {
|
| + // Is the Mojo application destroying the callback without running it
|
| + // and without first closing the pipe?
|
| + responder_->DCheckInvalid("The callback passed to "
|
| + "{{class_name}}::{{method.name}}({%- if method.parameters -%}{{pass_params(method.parameters)}}, {% endif -%}callback) "
|
| + "was never run.");
|
| + }
|
| +#endif
|
| // If the Callback was dropped then deleting the responder will close
|
| // the pipe so the calling application knows to stop waiting for a reply.
|
| delete responder_;
|
| - DCHECK(!callback_was_dropped) << "The callback passed to "
|
| - "{{class_name}}::{{method.name}}({%- if method.parameters -%}{{pass_params(method.parameters)}}, {% endif -%}callback) "
|
| - "was never run.";
|
| }
|
|
|
| {{class_name}}_{{method.name}}_ProxyToResponder(
|
|
|