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

Unified Diff: mojo/shell/runner/child/runner_connection.h

Issue 1793793002: Remove ShellConnection::WaitForInitialize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/shell/runner/child/BUILD.gn ('k') | mojo/shell/runner/child/runner_connection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/runner/child/runner_connection.h
diff --git a/mojo/shell/runner/child/runner_connection.h b/mojo/shell/runner/child/runner_connection.h
index e49f73e60e8d4d07041f2970c40f87fffe9703b7..e1829c13923dc85bad5e9b33fd2ab738df1b6f7a 100644
--- a/mojo/shell/runner/child/runner_connection.h
+++ b/mojo/shell/runner/child/runner_connection.h
@@ -5,35 +5,41 @@
#ifndef MOJO_SHELL_RUNNER_CHILD_RUNNER_CONNECTION_H_
#define MOJO_SHELL_RUNNER_CHILD_RUNNER_CONNECTION_H_
+#include "base/callback.h"
#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "mojo/shell/public/cpp/shell_connection.h"
+#include "mojo/shell/public/interfaces/connector.mojom.h"
#include "mojo/shell/public/interfaces/shell_client.mojom.h"
+#include "mojo/shell/public/interfaces/shell_client_factory.mojom.h"
namespace mojo {
namespace shell {
-// Encapsulates a connection to a runner process. The connection object starts a
-// background controller thread that is used to receive control messages from
-// the runner. When this object is destroyed the thread is joined.
+// Encapsulates a connection to a runner process.
class RunnerConnection {
public:
virtual ~RunnerConnection();
- // Establish a connection to the runner, blocking the calling thread until
- // it is established. The Application request from the runner is returned via
- // |request|.
+ // Establishes a new runner connection using a ShellClientFactory request pipe
+ // from the command line.
//
- // If a connection to the runner cannot be established, |request| will not be
- // modified and this function will return null.
+ // |shell_connection| is a ShellConnection which will be used to service
+ // incoming connection requests from other clients. This may be null, in which
+ // case no incoming connection requests will be serviced. This is not owned
+ // and must out-live the RunnerConnection.
//
// If |exit_on_error| is true, the calling process will be terminated in the
- // event of an error on |handle|.
+ // event of an error on the ShellClientFactory pipe.
//
- // TODO(rockot): Remove |exit_on_error| when it's safe for all clients to be
- // terminated on such errors. For now we don't want this killing content's
- // child processes.
- static RunnerConnection* ConnectToRunner(
- InterfaceRequest<mojom::ShellClient>* request,
- ScopedMessagePipeHandle handle,
+ // The RunnerConnection returned by this call bounds the lifetime of the
+ // connection. If connection fails (which can happen if there is no
+ // ShellClientFactory request pipe on the command line) this returns null.
+ //
+ // TODO(rockot): Remove |exit_on_error|. We shouldn't be killing processes
+ // abruptly on pipe errors, but some tests currently depend on this behavior.
+ static scoped_ptr<RunnerConnection> Create(
+ mojo::ShellConnection* shell_connection,
bool exit_on_error = true);
protected:
« no previous file with comments | « mojo/shell/runner/child/BUILD.gn ('k') | mojo/shell/runner/child/runner_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698