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

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

Issue 1419293003: Allow mojo_runner to connect to arbitrary executables. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 2 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/runner/child/native_apptest_target.cc ('k') | mojo/runner/child/runner_connection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/runner/child/runner_connection.h
diff --git a/mojo/runner/child/runner_connection.h b/mojo/runner/child/runner_connection.h
new file mode 100644
index 0000000000000000000000000000000000000000..8ca8778af989d35b92dc2ef57489987028adb733
--- /dev/null
+++ b/mojo/runner/child/runner_connection.h
@@ -0,0 +1,39 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_RUNNER_CHILD_RUNNER_CONNECTION_H_
+#define MOJO_RUNNER_CHILD_RUNNER_CONNECTION_H_
+
+#include "base/macros.h"
+#include "mojo/application/public/interfaces/application.mojom.h"
+
+namespace mojo {
+namespace runner {
+
+// 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.
+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|.
+ // If a connection to the runner cannot be established, |request| will not be
+ // modified and this function will return null.
+ static RunnerConnection* ConnectToRunner(
+ InterfaceRequest<Application>* request);
+
+ protected:
+ RunnerConnection();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RunnerConnection);
+};
+
+} // namespace runner
+} // namespace mojo
+
+#endif // MOJO_RUNNER_CHILD_RUNNER_CONNECTION_H_
« no previous file with comments | « mojo/runner/child/native_apptest_target.cc ('k') | mojo/runner/child/runner_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698