| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 module mojo.shell.mojom; | 5 module mojo.shell.mojom; |
| 6 | 6 |
| 7 import "mojo/shell/public/interfaces/connector.mojom"; | 7 import "mojo/shell/public/interfaces/connector.mojom"; |
| 8 import "mojo/shell/public/interfaces/interface_provider.mojom"; | 8 import "mojo/shell/public/interfaces/interface_provider.mojom"; |
| 9 | 9 |
| 10 // Implemented by something "known to" the Mojo Shell (e.g. an application or | 10 // Implemented by something "known to" the Mojo Shell (e.g. an application or |
| 11 // service), for which an instance is tracked. It allows the implementor to | 11 // service), for which an instance is tracked. It allows the implementor to |
| 12 // receive lifecycle events and service inbound connection attempts. | 12 // receive lifecycle events and service inbound connection attempts. |
| 13 interface ShellClient { | 13 interface ShellClient { |
| 14 // Called by the shell once an instance for this application has been created. | 14 // Called by the shell once an instance for this application has been created. |
| 15 // This method will be called exactly once before any other method is called. | 15 // This method will be called exactly once before any other method is called. |
| 16 // | 16 // |
| 17 // Parameters: | 17 // Parameters: |
| 18 // | 18 // |
| 19 // connector | 19 // connector |
| 20 // An interface back to the shell by which new connections may be | 20 // An interface back to the shell by which new connections may be |
| 21 // established. | 21 // established. |
| 22 // | 22 // |
| 23 // name | 23 // identity |
| 24 // The resolved name used in the connection request that resulted in this | 24 // The identity of this instance in the shell. Includes: |
| 25 // application being initialized. | 25 // * The resolved name used in the connection request that resulted in this |
| 26 // | 26 // instance being initialized. |
| 27 // user_id | 27 // * The user associated with this instance in the shell. This will never |
| 28 // Identifies the user this instance is run as in the shell. This may | 28 // be kInheritUserID. |
| 29 // differ from the user the application that caused this application to be | 29 // * The instance group this instance belongs to. |
| 30 // instantiated is run as. This will always be a valid user id, never | |
| 31 // Shell::kUserInherit. | |
| 32 // | 30 // |
| 33 // id | 31 // id |
| 34 // A unique identifier used by the shell to identify this instance. | 32 // A unique identifier used by the shell to identify this instance. |
| 35 // | 33 // |
| 36 Initialize(Connector connector, string name, string user_id, uint32 id); | 34 Initialize(Connector connector, Identity identity, uint32 id); |
| 37 | 35 |
| 38 // Called when another application attempts to open a connection to this | 36 // Called when another application attempts to open a connection to this |
| 39 // application. An application implements this method to complete the exchange | 37 // application. An application implements this method to complete the exchange |
| 40 // of interface implementations with the remote application. See also | 38 // of interface implementations with the remote application. See also |
| 41 // documentation in shell.mojom for Connect(). The application originating | 39 // documentation in shell.mojom for Connect(). The application originating |
| 42 // the request is referred to as the "source" and the one receiving the | 40 // the request is referred to as the "source" and the one receiving the |
| 43 // "target". | 41 // "target". |
| 44 // | 42 // |
| 45 // Parameters: | 43 // Parameters: |
| 46 // | 44 // |
| 47 // requestor_name | 45 // source |
| 48 // The name of the source application. | 46 // The identity of the instance originating the connection. |
| 49 // | 47 // |
| 50 // requestor_id | 48 // source_id |
| 51 // A unique identifier used by the shell to identify the source | 49 // A unique identifier used by the shell to identify the source instance. |
| 52 // application's instance. | |
| 53 // | |
| 54 // requestor_user_id | |
| 55 // An identifier for the user the source application is run as. This may | |
| 56 // differ from the application the target is run as (i.e. the one received | |
| 57 // via Initialize() above). This will always be a valid user id, never | |
| 58 // kInheritUserID. | |
| 59 // | 50 // |
| 60 // local_interfaces | 51 // local_interfaces |
| 61 // A request for an InterfaceProvider by which the source application may | 52 // A request for an InterfaceProvider by which the source application may |
| 62 // seek to bind interface implementations exported by the target. | 53 // seek to bind interface implementations exported by the target. |
| 63 // | 54 // |
| 64 // remote_interfaces | 55 // remote_interfaces |
| 65 // An InterfaceProvider by which the target application may bind interface | 56 // An InterfaceProvider by which the target application may bind interface |
| 66 // implementations exported by the source. | 57 // implementations exported by the source. |
| 67 // | 58 // |
| 68 // allowed_interfaces | 59 // allowed_interfaces |
| 69 // A whitelist of interface names that should be exported to the source, | 60 // A whitelist of interface names that should be exported to the source, |
| 70 // according to the security policy described by the source and target's | 61 // according to the security policy described by the source and target's |
| 71 // manifests. Attempts to bind interfaces not in this whitelist must not be | 62 // manifests. Attempts to bind interfaces not in this whitelist must not be |
| 72 // fulfilled. | 63 // fulfilled. |
| 73 // | 64 // |
| 74 // resolved_name | 65 // resolved_name |
| 75 // The resolved name used to complete this connection. | 66 // The resolved name used to complete this connection. |
| 76 // | 67 // |
| 77 AcceptConnection(string requestor_name, | 68 AcceptConnection(Identity source, |
| 78 string requestor_user_id, | 69 uint32 source_id, |
| 79 uint32 requestor_id, | |
| 80 InterfaceProvider&? local_interfaces, | 70 InterfaceProvider&? local_interfaces, |
| 81 InterfaceProvider? remote_interfaces, | 71 InterfaceProvider? remote_interfaces, |
| 82 array<string> allowed_interfaces, | 72 array<string> allowed_interfaces, |
| 83 string resolved_name); | 73 string resolved_name); |
| 84 }; | 74 }; |
| OLD | NEW |