Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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; | 5 module mojo; |
| 6 | 6 |
| 7 import "mojo/public/interfaces/application/service_provider.mojom"; | 7 import "mojo/public/interfaces/application/service_provider.mojom"; |
| 8 import "mojo/public/interfaces/application/shell.mojom"; | 8 import "mojo/public/interfaces/application/shell.mojom"; |
| 9 | 9 |
| 10 // This is the primary interface implemented by every Mojo application. It | 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 | 11 // allows the application to receive its startup arguments from the shell, and |
| 12 // to be notified of events that occur during its execution. | 12 // to be notified of events that occur during its execution. |
| 13 interface Application { | 13 interface Application { |
| 14 // Initializes the application with the specified arguments. This method is | 14 // Initializes the application with the specified arguments. This method is |
| 15 // guaranteed to be called before any other method is called, and will only be | 15 // guaranteed to be called before any other method is called, and will only be |
| 16 // called once. | 16 // called once. The |url| parameter is the final url the application was found |
| 17 Initialize(Shell shell, array<string>? args); | 17 // at, after all redirects and resolutions. |
| 18 Initialize(Shell shell, string url, array<string>? args); | |
|
sky
2015/02/05 23:41:22
Is there a reason we don't want to pass the url as
Aaron Boodman
2015/02/05 23:45:27
I guess since we don't know the shape of the sandb
sky
2015/02/05 23:49:51
Doesn't the array<string> provide you with more fl
Aaron Boodman
2015/02/06 00:11:54
AFAIK, after release, it would not be possible to
Aaron Boodman
2015/02/06 00:27:55
With a moment more thought (and double checking wi
| |
| 18 | 19 |
| 19 // Called when another application (identified by |requestor_url|) attempts to | 20 // Called when another application (identified by |requestor_url|) attempts to |
| 20 // open a connection to this application. | 21 // open a connection to this application. |
| 21 // | 22 // |
| 22 // If the other application wants to request services from this application, | 23 // If the other application wants to request services from this application, |
| 23 // it will have passed a valid interface request through the |services| | 24 // it will have passed a valid interface request through the |services| |
| 24 // parameter (i.e. one containing a valid message pipe endpoint). This | 25 // parameter (i.e. one containing a valid message pipe endpoint). This |
| 25 // application may then bind an implementation of |ServiceProvider| to that | 26 // application may then bind an implementation of |ServiceProvider| to that |
| 26 // request in order to make services available to the other application. | 27 // request in order to make services available to the other application. |
| 27 // | 28 // |
| 28 // If the other application wants to offer services to this application, it | 29 // If the other application wants to offer services to this application, it |
| 29 // will have passed a bound interface through the |exposed_services| | 30 // will have passed a bound interface through the |exposed_services| |
| 30 // parameter. This application may then request services through that | 31 // parameter. This application may then request services through that |
| 31 // interface. | 32 // interface. |
| 32 // | 33 // |
| 33 // It is possible that both parameters will be valid/bound if the other | 34 // It is possible that both parameters will be valid/bound if the other |
| 34 // application wants to both request services from and offer services to this | 35 // application wants to both request services from and offer services to this |
| 35 // application. | 36 // application. |
| 36 // | 37 // |
| 37 // This application is free to ignore the |services| or |exposed_services| | 38 // This application is free to ignore the |services| or |exposed_services| |
| 38 // parameters if it does not wish to offer or request services. | 39 // parameters if it does not wish to offer or request services. |
| 39 AcceptConnection(string requestor_url, | 40 AcceptConnection(string requestor_url, |
| 40 ServiceProvider&? services, | 41 ServiceProvider&? services, |
| 41 ServiceProvider? exposed_services); | 42 ServiceProvider? exposed_services); |
| 42 | 43 |
| 43 // Called to request the application shut itself down gracefully. | 44 // Called to request the application shut itself down gracefully. |
| 44 RequestQuit(); | 45 RequestQuit(); |
| 45 }; | 46 }; |
| OLD | NEW |