Index: mojo/runner/host/child_process.cc |
diff --git a/mojo/runner/host/child_process.cc b/mojo/runner/host/child_process.cc |
index 25b8aa30d339f6b052f080cf3c0082516b936a71..1cac6f33f8c03897246be5e53bc91651b1368aea 100644 |
--- a/mojo/runner/host/child_process.cc |
+++ b/mojo/runner/host/child_process.cc |
@@ -218,7 +218,10 @@ class ChildControllerImpl : public ChildController { |
app_context->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 |
@@ -251,9 +254,7 @@ class ChildControllerImpl : public ChildController { |
app_library_(app_library), |
unblocker_(unblocker), |
channel_info_(nullptr), |
- binding_(this) { |
- binding_.set_connection_error_handler([this]() { OnConnectionError(); }); |
- } |
+ binding_(this) {} |
static void StartAppOnMainThread( |
base::NativeLibrary app_library, |