Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1021)

Unified Diff: mojo/public/cpp/bindings/lib/interface_endpoint_client.cc

Issue 2729133004: Mojo C++ bindings: keep connection error handler on the stack while running it. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/interface_endpoint_client.cc
diff --git a/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc b/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc
index 3ee5aaebf98ed8a63888b0402126a7d4b6aab332..3eca5a16fe165b718bd93add4d0e6d74669cfc9a 100644
--- a/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc
+++ b/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc
@@ -312,13 +312,15 @@ void InterfaceEndpointClient::NotifyError(
control_message_proxy_.OnConnectionError();
if (!error_handler_.is_null()) {
- error_handler_.Run();
+ base::Closure error_handler = std::move(error_handler_);
+ error_handler.Run();
} else if (!error_with_reason_handler_.is_null()) {
+ ConnectionErrorWithReasonCallback error_with_reason_handler =
+ std::move(error_with_reason_handler_);
if (reason) {
- error_with_reason_handler_.Run(reason->custom_reason,
- reason->description);
+ error_with_reason_handler.Run(reason->custom_reason, reason->description);
} else {
- error_with_reason_handler_.Run(0, std::string());
+ error_with_reason_handler.Run(0, std::string());
}
}
}
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698