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

Unified Diff: mojo/runner/host/child_process.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 | « mojo/runner/child/runner_connection.cc ('k') | mojo/shell/application_instance.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « mojo/runner/child/runner_connection.cc ('k') | mojo/shell/application_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698