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

Unified Diff: mojo/shell/public/interfaces/connector.mojom

Issue 1776513003: Allow client process information to be passed via Connector::Connect(). (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/public/interfaces/BUILD.gn ('k') | mojo/shell/public/interfaces/shell.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/public/interfaces/connector.mojom
diff --git a/mojo/shell/public/interfaces/connector.mojom b/mojo/shell/public/interfaces/connector.mojom
index 94acb69d803bf6785b9347a8d7742e2ec83eaedb..4dff63da05c177f98c5926e350c917e62c8e94b9 100644
--- a/mojo/shell/public/interfaces/connector.mojom
+++ b/mojo/shell/public/interfaces/connector.mojom
@@ -57,6 +57,31 @@ struct Identity {
string instance;
};
+// Implemented by an object in the shell associated with a specific instance.
+// Tells it the PID for a process launched by the client. See
+// ClientProcessConnection.
+interface PIDReceiver {
+ SetPID(uint32 pid);
+};
+
+// Typically, the shell will start a process for a service the first time it
+// receives a connection request for it. This struct allows a client to start
+// the process itself and provide the shell the pipes it needs to communicate
+// with it. When an instance of this struct is supplied to Connect(), the client
+// owns the lifetime of the child process, not the shell. The shell binds the
+// |shell_client_factory| pipe, and when it closes destroys the associated
+// instance but the process stays alive.
+struct ClientProcessConnection {
+ // Provides the shell the ability to bind a ShellClientRequest from the client
+ // process to the instance it creates.
+ handle<message_pipe> shell_client_factory;
+
+ // Allows the client process launcher to tell the shell the PID of the process
+ // it created (the pid isn't supplied directly here as the process may not
+ // have been launched by the time Connect() is called.)
+ handle<message_pipe> pid_receiver_request;
+};
+
// Encapsulates establishing connections with other Mojo applications.
interface Connector {
// Requests a connection with another application. The application originating
@@ -89,6 +114,12 @@ interface Connector {
// InterfaceProvider are filtered by the security policy described by the
// source and target application manifests.
//
+ // client_process_connection
+ // When non-null, supplies control pipes the shell can use to bind a
+ // process created by the client, instead of creating one itself.
+ // TODO(beng): access to this parameter should be restricted by a
+ // capability.
+ //
// Response parameters:
//
// result
@@ -104,9 +135,9 @@ interface Connector {
//
Connect(Identity target,
InterfaceProvider&? remote_interfaces,
- InterfaceProvider? local_interfaces) => (ConnectResult result,
- string user_id,
- uint32 application_id);
+ InterfaceProvider? local_interfaces,
+ ClientProcessConnection? client_process_connection) =>
+ (ConnectResult result, string user_id, uint32 application_id);
// Clones this Connector so it can be passed to another thread.
Clone(Connector& request);
« no previous file with comments | « mojo/shell/public/interfaces/BUILD.gn ('k') | mojo/shell/public/interfaces/shell.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698