| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/shell_client_factory.mojom"; | 8 import "mojo/shell/public/interfaces/shell_client_factory.mojom"; |
| 9 | 9 |
| 10 struct InstanceInfo { | 10 struct InstanceInfo { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // Called when the shell has stopped tracking an instance. (i.e. when it has | 29 // Called when the shell has stopped tracking an instance. (i.e. when it has |
| 30 // ended/quit). | 30 // ended/quit). |
| 31 InstanceDestroyed(uint32 id); | 31 InstanceDestroyed(uint32 id); |
| 32 | 32 |
| 33 // Called when a pid is available for the instance. This could be because a | 33 // Called when a pid is available for the instance. This could be because a |
| 34 // process was created by the runner for it, or because an existing content | 34 // process was created by the runner for it, or because an existing content |
| 35 // handler process was assigned. | 35 // handler process was assigned. |
| 36 InstancePIDAvailable(uint32 id, uint32 pid); | 36 InstancePIDAvailable(uint32 id, uint32 pid); |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 // Implemented by an object in the shell associated with a specific instance. | |
| 40 // Tells it the PID for a process launched by the client. This interface is only | |
| 41 // available to callers of Shell::CreateInstanceForFactory(). | |
| 42 interface PIDReceiver { | |
| 43 SetPID(uint32 pid); | |
| 44 }; | |
| 45 | |
| 46 // Specifies a whitelist of applications and services an application can connect | |
| 47 // to. Connections to applications not explicitly specified here as a key are | |
| 48 // rejected. Connections to services not specified in an application's allowed | |
| 49 // interfaces value are not made. | |
| 50 // A "*" value as the only key in an otherwise empty map means the application | |
| 51 // may connect to any other application. | |
| 52 // A "*" value as the only string in an otherwise empty array of interface names | |
| 53 // means the application may connect to any service in that application. | |
| 54 // An empty interface name array means the application may not connect to any | |
| 55 // services exposed by the application it is connecting to. | |
| 56 struct CapabilityFilter { | |
| 57 map<string, array<string>> filter; | |
| 58 }; | |
| 59 | |
| 60 interface Shell { | 39 interface Shell { |
| 61 // Instructs the Shell to create an instance for an existing process at the | |
| 62 // other end of |factory|, and perform applicable initialization. |user_id| is | |
| 63 // the user the instance should be created as. This is typically set to | |
| 64 // Connector::kUserInherit, unless the application has the ability to connect | |
| 65 // as other users. |result| passed in the response indicates (via a MojoResult | |
| 66 // code, see connector.mojom for definitions) the status of the instance | |
| 67 // creation. | |
| 68 CreateInstance(ShellClientFactory factory, | |
| 69 Identity target, | |
| 70 PIDReceiver& pid_receiver) => (ConnectResult result); | |
| 71 | |
| 72 // The listener is removed when the |listener| pipe is closed. | 40 // The listener is removed when the |listener| pipe is closed. |
| 73 AddInstanceListener(InstanceListener listener); | 41 AddInstanceListener(InstanceListener listener); |
| 74 }; | 42 }; |
| OLD | NEW |