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 service_manager.mojom; | 5 module service_manager.mojom; |
6 | 6 |
7 import "services/service_manager/public/interfaces/connector.mojom"; | 7 import "services/service_manager/public/interfaces/connector.mojom"; |
8 | 8 |
9 struct ServiceInfo { | 9 struct RunningServiceInfo { |
10 uint32 id; | 10 uint32 id; |
11 Identity identity; | 11 Identity identity; |
12 uint32 pid; | 12 uint32 pid; |
13 }; | 13 }; |
14 | 14 |
15 // Implemented by a client that wishes to be informed when the list of running | 15 // Implemented by a client that wishes to be informed when the list of running |
16 // services changes. | 16 // services changes. |
17 interface ServiceManagerListener { | 17 interface ServiceManagerListener { |
18 // Called once when the listener is added via | 18 // Called once when the listener is added via |
19 // ServiceManager::AddInstanceListener() to provide the initial list of | 19 // ServiceManager::AddInstanceListener() to provide the initial list of |
20 // services that the listener observes changes against. | 20 // services that the listener observes changes against. |
21 OnInit(array<ServiceInfo> running_services); | 21 OnInit(array<RunningServiceInfo> running_services); |
22 | 22 |
23 // Called when the Service Manager has started tracking a Service. This | 23 // Called when the Service Manager has started tracking a Service. This |
24 // happens when the Service Manager first handles a request to launch the | 24 // happens when the Service Manager first handles a request to launch the |
25 // Service, before a process is created for it. | 25 // Service, before a process is created for it. |
26 OnServiceCreated(ServiceInfo service); | 26 OnServiceCreated(RunningServiceInfo service); |
27 | 27 |
28 // Called when a pid is available for the service. This could be because the | 28 // Called when a pid is available for the service. This could be because the |
29 // Service Manager created a process for it, or because an existing one was | 29 // Service Manager created a process for it, or because an existing one was |
30 // assigned to it. | 30 // assigned to it. |
31 OnServiceStarted(Identity identity, uint32 pid); | 31 OnServiceStarted(Identity identity, uint32 pid); |
32 | 32 |
33 // Called when the Service Manager has stopped tracking a service. (i.e. when | 33 // Called when the Service Manager has stopped tracking a service. (i.e. when |
34 // it has ended/quit). | 34 // it has ended/quit). |
35 OnServiceStopped(Identity identity); | 35 OnServiceStopped(Identity identity); |
36 }; | 36 }; |
37 | 37 |
38 interface ServiceManager { | 38 interface ServiceManager { |
39 // The listener is removed when the |listener| pipe is closed. | 39 // The listener is removed when the |listener| pipe is closed. |
40 AddListener(ServiceManagerListener listener); | 40 AddListener(ServiceManagerListener listener); |
41 }; | 41 }; |
OLD | NEW |