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 service_manager.mojom; | 5 module service_manager.mojom; |
6 | 6 |
7 import "services/service_manager/public/interfaces/capabilities.mojom"; | 7 import "services/service_manager/public/interfaces/capabilities.mojom"; |
8 import "services/service_manager/public/interfaces/connector.mojom"; | 8 import "services/service_manager/public/interfaces/connector.mojom"; |
9 import "services/service_manager/public/interfaces/interface_provider.mojom"; | 9 import "services/service_manager/public/interfaces/interface_provider.mojom"; |
10 | 10 |
11 // Implemented by something "known to" the Mojo Shell (e.g. an application or | 11 // Implemented by any service which is known to the Service Manager, for which |
12 // service), for which an instance is tracked. It allows the implementor to | 12 // instances may be tracked. It allows the implementor to receive lifecycle |
13 // receive lifecycle events and service inbound connection attempts. | 13 // events and service inbound connection attempts. |
14 interface Service { | 14 interface Service { |
15 // Called by the service manager once an instance for this service has been | 15 // Called by the service manager once an instance for this service has been |
16 // created. This method will be called exactly once before any other method is | 16 // created. This method will be called exactly once before any other method is |
17 // called. | 17 // called. |
18 // | 18 // |
19 // Parameters: | 19 // Parameters: |
20 // | 20 // |
21 // identity | 21 // identity |
22 // The identity of this instance in the service manager. Includes: | 22 // The identity of this instance in the service manager. Includes: |
23 // * The resolved name used in the connection request that resulted in this | 23 // * The resolved name used in the connection request that resulted in this |
24 // instance being initialized. | 24 // instance being initialized. |
25 // * The user associated with this instance in the service manager. This | 25 // * The user associated with this instance in the service manager. This |
26 // will never be kInheritUserID. | 26 // will never be kInheritUserID. |
27 // * The instance group this instance belongs to. | 27 // * The instance group this instance belongs to. |
28 // | 28 // |
29 // Response parameters: | 29 // Response parameters: |
30 // | 30 // |
31 // connector_request | 31 // connector_request |
32 // An optional Connector request for the service manager to bind, allowing | 32 // An optional Connector request for the service manager to bind, allowing |
33 // the initialized client to connect to others. | 33 // the initialized client to connect to others. |
34 // | 34 // |
35 OnStart(Identity identity) => (Connector&? connector_request); | 35 OnStart(Identity identity) => (Connector&? connector_request); |
36 | 36 |
37 // Called when another application attempts to open a connection to this | 37 // Called when another service attempts to open a connection to this |
38 // application. An application implements this method to complete the exchange | 38 // service. A service implements this method to complete the exchange |
39 // of interface implementations with the remote application. See also | 39 // of interface implementations with the remote service. See also |
40 // documentation in service_manager.mojom for Connect(). The application | 40 // documentation in service_manager.mojom for Connect(). The service |
41 // originating the request is referred to as the "source" and the one | 41 // originating the request is referred to as the "source" and the one |
42 // receiving the "target". | 42 // receiving the "target". |
43 // | 43 // |
44 // Parameters: | 44 // Parameters: |
45 // | 45 // |
46 // source | 46 // source |
47 // The identity of the instance originating the connection. | 47 // The identity of the instance originating the connection. |
48 // | 48 // |
49 // interfaces | 49 // interfaces |
50 // A request for an InterfaceProvider by which the source application may | 50 // A request for an InterfaceProvider by which the source service may |
51 // seek to bind interface implementations exported by the target. | 51 // seek to bind interface implementations exported by the target. |
52 // | 52 // |
53 // allowed_capabilities | 53 // allowed_capabilities |
54 // A whitelist of interface names and capability classes that should be | 54 // A whitelist of interface names and capability classes that should be |
55 // made available to the source, according to the security policy described | 55 // made available to the source, according to the security policy described |
56 // by the source and target's manifests. Attempts to bind interfaces not in | 56 // by the source and target's manifests. Attempts to bind interfaces not in |
57 // this whitelist must not be fulfilled. | 57 // this whitelist must not be fulfilled. |
58 // | 58 // |
59 OnConnect(Identity source, | 59 OnConnect(Identity source, |
60 InterfaceProvider&? interfaces, | 60 InterfaceProvider&? interfaces, |
61 Interfaces required_interfaces, | 61 Interfaces required_interfaces, |
62 Classes required_classes); | 62 Classes required_classes); |
63 }; | 63 }; |
OLD | NEW |