| 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/interface_provider.mojom"; | 7 import "mojo/shell/public/interfaces/interface_provider.mojom"; |
| 8 import "mojo/shell/public/interfaces/shell.mojom"; | 8 import "mojo/shell/public/interfaces/shell.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 // url | 23 // name |
| 24 // The resolved URL used in the connection request that resulted in this | 24 // The resolved name used in the connection request that resulted in this |
| 25 // application being initialized. | 25 // application being initialized. |
| 26 // | 26 // |
| 27 // id | 27 // id |
| 28 // A unique identifier used by the shell to identify this instance. | 28 // A unique identifier used by the shell to identify this instance. |
| 29 // | 29 // |
| 30 // user_id | 30 // user_id |
| 31 // Identifies the user this instance is run as in the shell. This may | 31 // Identifies the user this instance is run as in the shell. This may |
| 32 // differ from the user the application that caused this application to be | 32 // differ from the user the application that caused this application to be |
| 33 // instantiated is run as. This will always be a valid user id, never | 33 // instantiated is run as. This will always be a valid user id, never |
| 34 // Shell::kUserInherit. | 34 // Shell::kUserInherit. |
| 35 // | 35 // |
| 36 Initialize(Connector connector, string url, uint32 id, uint32 user_id); | 36 Initialize(Connector connector, string name, uint32 id, uint32 user_id); |
| 37 | 37 |
| 38 // Called when another application attempts to open a connection to this | 38 // Called when another application attempts to open a connection to this |
| 39 // application. An application implements this method to complete the exchange | 39 // application. An application implements this method to complete the exchange |
| 40 // of interface implementations with the remote application. See also | 40 // of interface implementations with the remote application. See also |
| 41 // documentation in shell.mojom for Connect(). The application originating | 41 // documentation in shell.mojom for Connect(). The application originating |
| 42 // the request is referred to as the "source" and the one receiving the | 42 // the request is referred to as the "source" and the one receiving the |
| 43 // "target". | 43 // "target". |
| 44 // | 44 // |
| 45 // Parameters: | 45 // Parameters: |
| 46 // | 46 // |
| 47 // requestor_url | 47 // requestor_name |
| 48 // The URL of the source application. | 48 // The name of the source application. |
| 49 // | 49 // |
| 50 // requestor_id | 50 // requestor_id |
| 51 // A unique identifier used by the shell to identify the source | 51 // A unique identifier used by the shell to identify the source |
| 52 // application's instance. | 52 // application's instance. |
| 53 // | 53 // |
| 54 // requestor_user_id | 54 // requestor_user_id |
| 55 // An identifier for the user the source application is run as. This may | 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 | 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 | 57 // via Initialize() above). This will always be a valid user id, never |
| 58 // Shell::kUserInherit. | 58 // Shell::kUserInherit. |
| 59 // | 59 // |
| 60 // local_interfaces | 60 // local_interfaces |
| 61 // A request for an InterfaceProvider by which the source application may | 61 // A request for an InterfaceProvider by which the source application may |
| 62 // seek to bind interface implementations exported by the target. | 62 // seek to bind interface implementations exported by the target. |
| 63 // | 63 // |
| 64 // remote_interfaces | 64 // remote_interfaces |
| 65 // An InterfaceProvider by which the target application may bind interface | 65 // An InterfaceProvider by which the target application may bind interface |
| 66 // implementations exported by the source. | 66 // implementations exported by the source. |
| 67 // | 67 // |
| 68 // allowed_interfaces | 68 // allowed_interfaces |
| 69 // A whitelist of interface names that should be exported to the source, | 69 // 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 | 70 // 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 | 71 // manifests. Attempts to bind interfaces not in this whitelist must not be |
| 72 // fulfilled. | 72 // fulfilled. |
| 73 // | 73 // |
| 74 // resolved_url | 74 // resolved_name |
| 75 // The resolved URL used to complete this connection. | 75 // The resolved name used to complete this connection. |
| 76 // | 76 // |
| 77 AcceptConnection(string requestor_url, | 77 AcceptConnection(string requestor_name, |
| 78 uint32 requestor_id, | 78 uint32 requestor_id, |
| 79 uint32 requestor_user_id, | 79 uint32 requestor_user_id, |
| 80 InterfaceProvider&? local_interfaces, | 80 InterfaceProvider&? local_interfaces, |
| 81 InterfaceProvider? remote_interfaces, | 81 InterfaceProvider? remote_interfaces, |
| 82 array<string> allowed_interfaces, | 82 array<string> allowed_interfaces, |
| 83 string resolved_url); | 83 string resolved_name); |
| 84 }; | 84 }; |
| OLD | NEW |