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

Unified Diff: mojo/runner/child/runner_connection.cc

Issue 1525033004: Always set the error handler closure of Binding<> after binding to a message pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years 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 | « content/common/mojo/service_registry_impl.cc ('k') | mojo/runner/host/child_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/runner/child/runner_connection.cc
diff --git a/mojo/runner/child/runner_connection.cc b/mojo/runner/child/runner_connection.cc
index 1326ada65601710252e0763489cc2caca3ea2769..1fdcdb8a3c4c356da72d85249ff46236bd784cdd 100644
--- a/mojo/runner/child/runner_connection.cc
+++ b/mojo/runner/child/runner_connection.cc
@@ -151,7 +151,10 @@ class ChildControllerImpl : public ChildController {
connection->set_controller(impl.Pass());
}
- void Bind(ScopedMessagePipeHandle handle) { binding_.Bind(handle.Pass()); }
+ void Bind(ScopedMessagePipeHandle handle) {
+ binding_.Bind(handle.Pass());
+ binding_.set_connection_error_handler([this]() { OnConnectionError(); });
+ }
void OnConnectionError() {
// A connection error means the connection to the shell is lost. This is not
@@ -184,9 +187,7 @@ class ChildControllerImpl : public ChildController {
callback_(callback),
unblocker_(unblocker),
channel_info_(nullptr),
- binding_(this) {
- binding_.set_connection_error_handler([this]() { OnConnectionError(); });
- }
+ binding_(this) {}
static void ReturnApplicationRequestOnMainThread(
const GotApplicationRequestCallback& callback,
« no previous file with comments | « content/common/mojo/service_registry_impl.cc ('k') | mojo/runner/host/child_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698