summaryrefslogtreecommitdiffstats
path: root/mash
diff options
context:
space:
mode:
authorrockot <rockot@chromium.org>2016-02-08 22:23:02 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-09 06:23:54 +0000
commitb3ea203171e07f5c7e476e94d210ec4ad53ce5b0 (patch)
treeaa018d6a4a2ab0ee2bb051be7b2b708f0a9137a7 /mash
parent48b1529df3354be778217be1e658945749a8af90 (diff)
downloadchromium_src-b3ea203171e07f5c7e476e94d210ec4ad53ce5b0.zip
chromium_src-b3ea203171e07f5c7e476e94d210ec4ad53ce5b0.tar.gz
chromium_src-b3ea203171e07f5c7e476e94d210ec4ad53ce5b0.tar.bz2
[mojo-edk] Simplify multiprocess pipe bootstrap
This introduces a new MergePort message at the Ports layer for joining two independent port cycles which each have an unused (i.e. unwritten, unread, unsent) receiving port. MergePort allows us to create a MessagePipeDispatcher which is immediately usable but which will eventually be linked to a MessagePipeDispatcher on another port cycle, potentially in another process. The basic idea is to create a fully functional port pair but only bind one port to an MPD. Do this on each end and merge the dangling ports asynchronously. The simplification here allows a lot of code to be deleted from NodeController, some of which is deleted in this CL. Future work will convert existing bootstrap sites back to using synchronous bootstrap, including the token-based APIs. BUG=584764 TBR=ben@chromium.org for null check in mash shell Review URL: https://codereview.chromium.org/1675603002 Cr-Commit-Position: refs/heads/master@{#374322}
Diffstat (limited to 'mash')
-rw-r--r--mash/shell/shell_application_delegate.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/mash/shell/shell_application_delegate.cc b/mash/shell/shell_application_delegate.cc
index 68c01fd..4c2196e 100644
--- a/mash/shell/shell_application_delegate.cc
+++ b/mash/shell/shell_application_delegate.cc
@@ -117,8 +117,12 @@ void ShellApplicationDelegate::StartRestartableService(
// TODO(beng): This would be the place to insert logic that counted restarts
// to avoid infinite crash-restart loops.
scoped_ptr<mojo::Connection> connection = shell_->Connect(url);
- connection->SetRemoteServiceProviderConnectionErrorHandler(restart_callback);
- connections_[url] = std::move(connection);
+ // Note: |connection| may be null if we've lost our connection to the shell.
+ if (connection) {
+ connection->SetRemoteServiceProviderConnectionErrorHandler(
+ restart_callback);
+ connections_[url] = std::move(connection);
+ }
}
} // namespace shell