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 // This app is run by examples/dart/hello_world/hello. | 5 // This app is run by examples/dart/hello_world/hello. |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:mojo.application'; | 8 |
9 import 'dart:mojo.bindings'; | 9 import 'package:mojo/public/dart/application.dart'; |
10 import 'dart:mojo.core'; | 10 import 'package:mojo/public/dart/bindings.dart'; |
| 11 import 'package:mojo/public/dart/core.dart'; |
11 | 12 |
12 class World extends Application { | 13 class World extends Application { |
13 World.fromHandle(MojoHandle handle) : super.fromHandle(handle); | 14 World.fromHandle(MojoHandle handle) : super.fromHandle(handle); |
14 | 15 |
15 void initialize(List<String> args, String url) { | 16 void initialize(List<String> args, String url) { |
16 print("$url World"); | 17 print("$url World"); |
17 closeApplication(); | 18 closeApplication(); |
18 } | 19 } |
19 | 20 |
20 Future closeApplication() async { | 21 Future closeApplication() async { |
21 await close(); | 22 await close(); |
22 assert(MojoHandle.reportLeakedHandles()); | 23 assert(MojoHandle.reportLeakedHandles()); |
23 } | 24 } |
24 } | 25 } |
25 | 26 |
26 main(List args) { | 27 main(List args) { |
27 MojoHandle appHandle = new MojoHandle(args[0]); | 28 MojoHandle appHandle = new MojoHandle(args[0]); |
28 new World.fromHandle(appHandle); | 29 new World.fromHandle(appHandle); |
29 } | 30 } |
OLD | NEW |