OLD | NEW |
1 #!mojo mojo:dart_content_handler | 1 #!mojo mojo:dart_content_handler |
2 // Copyright 2015 The Chromium Authors. All rights reserved. | 2 // Copyright 2015 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 // To run this app: | 6 // To run this app: |
7 // mojo_shell mojo:hello | 7 // mojo_shell mojo:hello |
8 | 8 |
9 import 'dart:async'; | 9 import 'dart:async'; |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 print("Connecting to $worldUrl"); | 22 print("Connecting to $worldUrl"); |
23 | 23 |
24 // We expect to find the world mojo application at the same | 24 // We expect to find the world mojo application at the same |
25 // path as this application. | 25 // path as this application. |
26 var c = connectToApplication(worldUrl); | 26 var c = connectToApplication(worldUrl); |
27 | 27 |
28 // A call to close() here would cause this app to go down before the "world" | 28 // A call to close() here would cause this app to go down before the "world" |
29 // app has a chance to come up. Instead, we wait to close this app until | 29 // app has a chance to come up. Instead, we wait to close this app until |
30 // the "world" app comes up, does its print, and closes its end of the | 30 // the "world" app comes up, does its print, and closes its end of the |
31 // connection. | 31 // connection. |
32 c.remoteServiceProvider.impl.onError = closeApplication; | 32 c.remoteServiceProvider.ctrl.onError = closeApplication; |
33 } | 33 } |
34 | 34 |
35 Future closeApplication(e) async { | 35 Future closeApplication(e) async { |
36 await close(); | 36 await close(); |
37 MojoHandle.reportLeakedHandles(); | 37 MojoHandle.reportLeakedHandles(); |
38 } | 38 } |
39 } | 39 } |
40 | 40 |
41 main(List args, Object handleToken) { | 41 main(List args, Object handleToken) { |
42 MojoHandle appHandle = new MojoHandle(handleToken); | 42 MojoHandle appHandle = new MojoHandle(handleToken); |
43 new Hello.fromHandle(appHandle); | 43 new Hello.fromHandle(appHandle); |
44 } | 44 } |
OLD | NEW |