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