OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 module mojo.shell.mojom; |
| 6 |
| 7 import "mojo/shell/public/interfaces/interface_provider.mojom"; |
| 8 |
| 9 // Encapsulates establishing connections with other Mojo applications. |
| 10 interface Connector { |
| 11 const uint32 kInvalidApplicationID = 0; |
| 12 const uint32 kUserRoot = 0; |
| 13 const uint32 kUserInherit = 1; |
| 14 |
| 15 // Requests a connection with another application. The application originating |
| 16 // the request is referred to as the "source" and the one receiving the |
| 17 // "target". |
| 18 // |
| 19 // The connection is embodied by a pair of message pipes binding the |
| 20 // InterfaceProvider interface, which allows both the source and target |
| 21 // applications to export interfaces to one another. The interfaces bound via |
| 22 // these InterfaceProviders are brokered by the shell according to the |
| 23 // security policy defined by each application in its manifest . |
| 24 // |
| 25 // If the target application is not running, the shell will run it, calling |
| 26 // its Initialize() method before completing the connection. |
| 27 // |
| 28 // Parameters: |
| 29 // |
| 30 // name |
| 31 // A mojo: or exe: name identifying the target application. |
| 32 // |
| 33 // user_id |
| 34 // The user id of the target application instance to connect to. If no such |
| 35 // instance exists, the shell may start one. This user id will be passed |
| 36 // to the new instance via Initialize(). Applications must generally set |
| 37 // this to kUserInherit, and the shell will either connect to an existing |
| 38 // instance matching the caller's user id, create a new instance matching |
| 39 // the caller's user id, or connect to an existing instance running as |
| 40 // kUserRoot. By default, applications do not have the ability to pass |
| 41 // arbitrary values to this method, and doing so will result in a |
| 42 // connection error on the remote service provider. An application with |
| 43 // the ability to launch applications with arbitrary user ids (e.g. a login |
| 44 // app) may set this value to something meaningful to it. |
| 45 // |
| 46 // remote_interfaces |
| 47 // Allows the source application access to interface implementations |
| 48 // exposed by the target application. The interfaces accessible via this |
| 49 // InterfaceParameter are filtered by the security policy described by the |
| 50 // source and target application manifests. |
| 51 // |
| 52 // local_interfaces |
| 53 // Allows the remote application access to interface implementations |
| 54 // exposed by the source application. The interfaces accessible via this |
| 55 // InterfaceProvider are filtered by the security policy described by the |
| 56 // source and target application manifests. |
| 57 // |
| 58 // Response parameters: |
| 59 // |
| 60 // application_id |
| 61 // A unique identifier for the instance that was connected to. |
| 62 // |
| 63 // user_id |
| 64 // The user id the shell ran the target application as. Typically a client |
| 65 // passes kUserInherit to Connect(), which is an invalid user id, so this |
| 66 // value in the response is guaranteed to be a valid user id, either the |
| 67 // id connected to, or kUserRoot if no user-specific instance was located. |
| 68 // |
| 69 Connect(string name, |
| 70 uint32 user_id, |
| 71 InterfaceProvider&? remote_interfaces, |
| 72 InterfaceProvider? local_interfaces) => (uint32 application_id, |
| 73 uint32 user_id); |
| 74 |
| 75 // Clones this Connector so it can be passed to another thread. |
| 76 Clone(Connector& request); |
| 77 }; |
OLD | NEW |