OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 module mojo.shell.mojom; | |
6 | |
7 import "mojo/application/public/interfaces/shell.mojom"; | |
8 | |
9 struct ApplicationInfo { | |
10 int32 id; | |
11 string url; | |
12 string qualifier; | |
13 uint32 pid; | |
14 }; | |
15 | |
16 // Implemented by an application that wishes to be informed when the list of | |
17 // running applications changes. | |
18 interface ApplicationManagerListener { | |
19 // Called once when the listener is added via | |
20 // ApplicationManager::AddListener() to provide the initial list of running | |
21 // applications that the listener observes changes against. | |
22 SetRunningApplications(array<ApplicationInfo> applications); | |
23 | |
24 // Called when the application manager has started tracking an application. | |
25 // This happens when the application manager first handles a request to launch | |
26 // the application, and before any process or content handler is created for | |
27 // it. | |
28 ApplicationInstanceCreated(ApplicationInfo application); | |
29 | |
30 // Called when the application manager has stopped tracking an application. | |
31 // (i.e. when it has ended/quit). | |
32 ApplicationInstanceDestroyed(int32 id); | |
33 | |
34 // Called when a pid is available for the application. This could be because a | |
35 // process was created by the runner for it, or because an existing content | |
36 // handler process was assigned. | |
37 ApplicationPIDAvailable(int32 id, uint32 pid); | |
38 }; | |
39 | |
40 // Implemented by an object in the application manager associated with a | |
41 // specific instance. Tells it the PID for a process launched by the client. | |
42 // This interface is only available to callers of ApplicationManager:: | |
43 // CreateInstanceForHandle(). | |
44 interface PIDReceiver { | |
45 SetPID(uint32 pid); | |
46 }; | |
47 | |
48 interface ApplicationManager { | |
49 // Instructs the ApplicationManager to create an instance for an existing | |
50 // process at the other end of |channel|, and perform applicable | |
51 // initialization. This assumes the target process will bind the other end of | |
52 // channel to an implementation of ChildController and bind an Application | |
53 // request there. | |
54 CreateInstanceForHandle(handle channel, | |
55 string url, | |
56 mojo.CapabilityFilter filter, | |
57 PIDReceiver& pid_receiver); | |
58 | |
59 // Called by a child process every time it launches a process. This is needed | |
60 // so that the ChildBroker class in the grandchild process can talk to the one | |
61 // global BrokerState in the parent mojo_runner process. | |
62 RegisterProcessWithBroker(uint32 pid, | |
63 handle pipe); | |
64 | |
65 // The listener is removed when the pipe is closed. | |
66 AddListener(ApplicationManagerListener listener); | |
67 }; | |
OLD | NEW |