| 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/shell/public/interfaces/shell.mojom"; | |
| 8 import "mojo/shell/public/interfaces/shell_client_factory.mojom"; | |
| 9 | |
| 10 struct InstanceInfo { | |
| 11 uint32 id; | |
| 12 string name; | |
| 13 string qualifier; | |
| 14 uint32 pid; | |
| 15 }; | |
| 16 | |
| 17 // Implemented by a client that wishes to be informed when the list of running | |
| 18 // instances changes. | |
| 19 interface InstanceListener { | |
| 20 // Called once when the listener is added via | |
| 21 // ApplicationManager::AddInstanceListener() to provide the initial list of | |
| 22 // instances that the listener observes changes against. | |
| 23 SetExistingInstances(array<InstanceInfo> instances); | |
| 24 | |
| 25 // Called when the application manager has started tracking an instance. | |
| 26 // This happens when the application manager first handles a request to launch | |
| 27 // the instance, before any process is created for it. | |
| 28 InstanceCreated(InstanceInfo instance); | |
| 29 | |
| 30 // Called when the application manager has stopped tracking an instance. | |
| 31 // (i.e. when it has ended/quit). | |
| 32 InstanceDestroyed(uint32 id); | |
| 33 | |
| 34 // Called when a pid is available for the instance. 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 InstancePIDAvailable(uint32 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 |factory|, and perform applicable | |
| 51 // initialization. |user_id| is the user the instance should be created as. | |
| 52 // This is typically set to Connector::kUserInherit, unless the application | |
| 53 // has the ability to connect as other users. | |
| 54 CreateInstanceForFactory(ShellClientFactory factory, | |
| 55 string name, | |
| 56 uint32 user_id, | |
| 57 CapabilityFilter filter, | |
| 58 PIDReceiver& pid_receiver); | |
| 59 | |
| 60 // The listener is removed when the |listener| pipe is closed. | |
| 61 AddInstanceListener(InstanceListener listener); | |
| 62 }; | |
| OLD | NEW |