| 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 | 8 |
| 9 const string kRootUserID = "505C0EE9-3013-43C0-82B0-A84F50CF8D84"; | 9 const string kRootUserID = "505C0EE9-3013-43C0-82B0-A84F50CF8D84"; |
| 10 const string kInheritUserID = "D26290E4-4485-4EAE-81A2-66D1EEB40A9D"; | 10 const string kInheritUserID = "D26290E4-4485-4EAE-81A2-66D1EEB40A9D"; |
| 11 | 11 |
| 12 const uint32 kInvalidInstanceID = 0; | 12 const uint32 kInvalidInstanceID = 0; |
| 13 | 13 |
| 14 enum ConnectResult { | 14 enum ConnectResult { |
| 15 // The connection was established successfully. | 15 // The connection was established successfully. |
| 16 SUCCEEDED, | 16 SUCCEEDED, |
| 17 | 17 |
| 18 // The name or user id supplied was malformed, or the application specified | 18 // The name or user id supplied was malformed, or the application specified |
| 19 // by |name| could not be loaded. | 19 // by |name| could not be loaded. |
| 20 INVALID_ARGUMENT, | 20 INVALID_ARGUMENT, |
| 21 | 21 |
| 22 // The connection was blocked by policy. Either connections to |name| are | 22 // The connection was blocked by policy. Either connections to |name| are |
| 23 // forbidden from this app by the CapabilityFilter, or the application | 23 // forbidden from this app by the CapabilityFilter, or the application |
| 24 // attempted to connect using a user id other than its own, | 24 // attempted to connect using a user id other than its own, |
| 25 // kInheritUserID or kRootUserID. | 25 // kInheritUserID or kRootUserID. |
| 26 ACCESS_DENIED | 26 ACCESS_DENIED |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 // A collection of metadata that disambiguates instances in the shell. | 29 // A collection of metadata that disambiguates instances in the shell. |
| 30 struct Identity { | 30 struct Identity { |
| 31 // A mojo: or exe: name identifying an application. | 31 // A mojo: or exe: name identifying an application. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 62 // ClientProcessConnection. | 62 // ClientProcessConnection. |
| 63 interface PIDReceiver { | 63 interface PIDReceiver { |
| 64 SetPID(uint32 pid); | 64 SetPID(uint32 pid); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 // Typically, the shell will start a process for a service the first time it | 67 // Typically, the shell will start a process for a service the first time it |
| 68 // receives a connection request for it. This struct allows a client to start | 68 // receives a connection request for it. This struct allows a client to start |
| 69 // the process itself and provide the shell the pipes it needs to communicate | 69 // the process itself and provide the shell the pipes it needs to communicate |
| 70 // with it. When an instance of this struct is supplied to Connect(), the client | 70 // with it. When an instance of this struct is supplied to Connect(), the client |
| 71 // owns the lifetime of the child process, not the shell. The shell binds the | 71 // owns the lifetime of the child process, not the shell. The shell binds the |
| 72 // |shell_client_factory| pipe, and when it closes destroys the associated | 72 // |shell_client| pipe, and when it closes destroys the associated instance but |
| 73 // instance but the process stays alive. | 73 // the process stays alive. |
| 74 struct ClientProcessConnection { | 74 struct ClientProcessConnection { |
| 75 // Provides the shell the ability to bind a ShellClientRequest from the client | 75 // Provides the shell the ability to bind a ShellClient from the client |
| 76 // process to the instance it creates. | 76 // process to the instance it creates. |
| 77 handle<message_pipe> shell_client_factory; | 77 handle<message_pipe> shell_client; |
| 78 | 78 |
| 79 // Allows the client process launcher to tell the shell the PID of the process | 79 // Allows the client process launcher to tell the shell the PID of the process |
| 80 // it created (the pid isn't supplied directly here as the process may not | 80 // it created (the pid isn't supplied directly here as the process may not |
| 81 // have been launched by the time Connect() is called.) | 81 // have been launched by the time Connect() is called.) |
| 82 handle<message_pipe> pid_receiver_request; | 82 handle<message_pipe> pid_receiver_request; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 // Encapsulates establishing connections with other Mojo applications. | 85 // Encapsulates establishing connections with other Mojo applications. |
| 86 interface Connector { | 86 interface Connector { |
| 87 // Requests a connection with another application. The application originating | 87 // Requests a connection with another application. The application originating |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // | 135 // |
| 136 Connect(Identity target, | 136 Connect(Identity target, |
| 137 InterfaceProvider&? remote_interfaces, | 137 InterfaceProvider&? remote_interfaces, |
| 138 InterfaceProvider? local_interfaces, | 138 InterfaceProvider? local_interfaces, |
| 139 ClientProcessConnection? client_process_connection) => | 139 ClientProcessConnection? client_process_connection) => |
| 140 (ConnectResult result, string user_id, uint32 application_id); | 140 (ConnectResult result, string user_id, uint32 application_id); |
| 141 | 141 |
| 142 // Clones this Connector so it can be passed to another thread. | 142 // Clones this Connector so it can be passed to another thread. |
| 143 Clone(Connector& request); | 143 Clone(Connector& request); |
| 144 }; | 144 }; |
| OLD | NEW |