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

Side by Side Diff: mash/shell/shell_application_delegate.cc

Issue 1675603002: [mojo-edk] Simplify multiprocess pipe bootstrap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix some callers to work with sync APIs Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | mojo/edk/embedder/embedder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mash/shell/shell_application_delegate.h" 5 #include "mash/shell/shell_application_delegate.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "mojo/shell/public/cpp/connection.h" 8 #include "mojo/shell/public/cpp/connection.h"
9 #include "mojo/shell/public/cpp/shell.h" 9 #include "mojo/shell/public/cpp/shell.h"
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 DCHECK(connections_.end() != connection); 110 DCHECK(connections_.end() != connection);
111 connections_.erase(connection); 111 connections_.erase(connection);
112 } 112 }
113 113
114 void ShellApplicationDelegate::StartRestartableService( 114 void ShellApplicationDelegate::StartRestartableService(
115 const std::string& url, 115 const std::string& url,
116 const base::Closure& restart_callback) { 116 const base::Closure& restart_callback) {
117 // TODO(beng): This would be the place to insert logic that counted restarts 117 // TODO(beng): This would be the place to insert logic that counted restarts
118 // to avoid infinite crash-restart loops. 118 // to avoid infinite crash-restart loops.
119 scoped_ptr<mojo::Connection> connection = shell_->Connect(url); 119 scoped_ptr<mojo::Connection> connection = shell_->Connect(url);
120 connection->SetRemoteServiceProviderConnectionErrorHandler(restart_callback); 120 // Note: |connection| may be null if we've lost our connection to the shell.
121 connections_[url] = std::move(connection); 121 if (connection) {
122 connection->SetRemoteServiceProviderConnectionErrorHandler(
123 restart_callback);
124 connections_[url] = std::move(connection);
125 }
122 } 126 }
123 127
124 } // namespace shell 128 } // namespace shell
125 } // namespace main 129 } // namespace main
OLDNEW
« no previous file with comments | « no previous file | mojo/edk/embedder/embedder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698