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

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

Issue 1769163002: Add a instance groups to Connect(), and introduce an Identity struct. (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/cpp/shell_test.h ('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 524047cd00478863aacb4fc0ec2f4ae4deeb4bb9..94acb69d803bf6785b9347a8d7742e2ec83eaedb 100644
--- a/mojo/shell/public/interfaces/connector.mojom
+++ b/mojo/shell/public/interfaces/connector.mojom
@@ -26,6 +26,37 @@ enum ConnectResult {
ACCESS_DENIED
};
+// A collection of metadata that disambiguates instances in the shell.
+struct Identity {
+ // A mojo: or exe: name identifying an application.
+ string name;
+
+ // The user id of the target application instance to connect to. If no such
+ // instance exists, the shell may start one. This user id will be passed to
+ // the new instance via Initialize().
+ // When connecting to other applications, applications must generally pass
+ // kInheritUserID for this value, and the shell will either connect to an
+ // existing instance matching the caller's user id, create a new instance
+ // matching the caller's user id, or connect to an existing instance running
+ // as kRootUserID. By default, applications do not have the ability to set
+ // arbitrary values to this field, and doing so will result in a connection
+ // error on the remote service provider. An application with the ability to
+ // launch applications with arbitrary user ids (e.g. a login app) may set this
+ // value to something meaningful to it. The user id string is a valid guid of
+ // the form "%08X-%04X-%04X-%04X-%012llX", and (aside from the root user whose
+ // guid is defined above) intended to be not-guessable.
+ // When an application is initialized or receives a connection from another
+ // application, this value is always the resolved user id, never
+ // kInheritUserID.
+ string user_id;
+
+ // An application may spawn multiple instances with the same name,user_id
+ // pair, provided they are started with unique values of this field.
+ // TODO(beng): enforce the emptiness of this parameter unless the client bears
+ // the appropriate capability.
+ string instance;
+};
+
// Encapsulates establishing connections with other Mojo applications.
interface Connector {
// Requests a connection with another application. The application originating
@@ -43,24 +74,8 @@ interface Connector {
//
// Parameters:
//
- // name
- // A mojo: or exe: name identifying the target application.
- //
- // user_id
- // The user id of the target application instance to connect to. If no such
- // instance exists, the shell may start one. This user id will be passed
- // to the new instance via Initialize(). Applications must generally pass
- // kInheritUserID for this value, and the shell will either connect to an
- // existing instance matching the caller's user id, create a new instance
- // matching the caller's user id, or connect to an existing instance
- // running as kRootUserID. By default, applications do not have the ability
- // to pass arbitrary values to this method, and doing so will result in a
- // connection error on the remote service provider. An application with
- // the ability to launch applications with arbitrary user ids (e.g. a login
- // app) may set this value to something meaningful to it. The user id
- // string is a valid guid of the form "%08X-%04X-%04X-%04X-%012llX", and
- // (aside from the root user whose guid is defined above) intended to be
- // not-guessable.
+ // target
+ // Identifies the target application instance to connect to.
//
// remote_interfaces
// Allows the source application access to interface implementations
@@ -87,8 +102,7 @@ interface Connector {
// application_id
// A unique identifier for the instance that was connected to.
//
- Connect(string name,
- string user_id,
+ Connect(Identity target,
InterfaceProvider&? remote_interfaces,
InterfaceProvider? local_interfaces) => (ConnectResult result,
string user_id,
« no previous file with comments | « mojo/shell/public/cpp/shell_test.h ('k') | mojo/shell/public/interfaces/shell.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698