| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 module mojo.shell.mojom; | |
| 6 | |
| 7 import "mojo/shell/public/interfaces/service_provider.mojom"; | |
| 8 import "mojo/shell/public/interfaces/shell.mojom"; | |
| 9 | |
| 10 // This is the primary interface implemented by every Mojo application. It | |
| 11 // allows the application to receive its startup arguments from the shell, and | |
| 12 // to be notified of events that occur during its execution. | |
| 13 // | |
| 14 // TODO(aa): It would be good to reorder the parameters once we have interface | |
| 15 // versioning. | |
| 16 interface Application { | |
| 17 // Initializes the application with the specified arguments. This method is | |
| 18 // guaranteed to be called before any other method is called, and will only be | |
| 19 // called once. | |
| 20 // | |
| 21 // The |url| parameter is the identity of the application as far as the shell | |
| 22 // is concerned. This will be the URL the application was found at, after all | |
| 23 // mappings, resolution, and redirects. And it will not include the | |
| 24 // querystring, since the querystring is not part of an application's | |
| 25 // identity. | |
| 26 // | |
| 27 // The |id| parameter is the identifier of the instance in the | |
| 28 // ApplicationManager. It can be passed to other shell interfaces that request | |
| 29 // an instance identifier. | |
| 30 Initialize(Shell shell, string url, uint32 id); | |
| 31 | |
| 32 // Called when another application (identified by |requestor_url|) attempts to | |
| 33 // open a connection to this application. | |
| 34 // | |
| 35 // If the other application wants to request services from this application, | |
| 36 // it will have passed a valid interface request through the |services| | |
| 37 // parameter (i.e. one containing a valid message pipe endpoint). This | |
| 38 // application may then bind an implementation of |ServiceProvider| to that | |
| 39 // request in order to make services available to the other application. | |
| 40 // | |
| 41 // If the other application wants to offer services to this application, it | |
| 42 // will have passed a bound interface through the |exposed_services| | |
| 43 // parameter. This application may then request services through that | |
| 44 // interface. | |
| 45 // | |
| 46 // It is possible that both parameters will be valid/bound if the other | |
| 47 // application wants to both request services from and offer services to this | |
| 48 // application. | |
| 49 // | |
| 50 // This application is free to ignore the |services| or |exposed_services| | |
| 51 // parameters if it does not wish to offer or request services. | |
| 52 // | |
| 53 // |allowed_interfaces| is a set of interface names that the shell has | |
| 54 // determined can be exposed by this application to the connecting | |
| 55 // application. When this parameter is empty, this application should expose | |
| 56 // no services to the connecting application. When this parameter contains | |
| 57 // only the single string value "*" the application may expose all of its | |
| 58 // services to the connecting application. | |
| 59 // | |
| 60 // |resolved_url| is the URL that was requested to create this connection, | |
| 61 // after all mappings, resolutions, and redirects. This will include any | |
| 62 // querystring that was part of the request. | |
| 63 // | |
| 64 AcceptConnection(string requestor_url, | |
| 65 uint32 requestor_id, | |
| 66 mojo.ServiceProvider&? services, | |
| 67 mojo.ServiceProvider? exposed_services, | |
| 68 array<string> allowed_interfaces, | |
| 69 string resolved_url); | |
| 70 | |
| 71 // Called by the shell in response to calling Shell's QuitApplication. The | |
| 72 // application should run the callback with true if shutdown can proceed. | |
| 73 // See Shell::QuitApplication for details about shutdown workflow. | |
| 74 OnQuitRequested() => (bool can_quit); | |
| 75 }; | |
| OLD | NEW |