OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:mojo/application.dart'; | 7 import 'package:mojo/application.dart'; |
8 import 'package:mojo/bindings.dart'; | 8 import 'package:mojo/bindings.dart'; |
9 import 'package:mojo/core.dart'; | 9 import 'package:mojo/core.dart'; |
10 import 'package:_mojo_for_test_only/test/echo_service.mojom.dart'; | 10 import 'package:_mojo_for_test_only/test/echo_service.mojom.dart'; |
(...skipping 11 matching lines...) Expand all Loading... |
22 } | 22 } |
23 | 23 |
24 class EchoApplication extends Application { | 24 class EchoApplication extends Application { |
25 EchoApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle); | 25 EchoApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle); |
26 | 26 |
27 @override | 27 @override |
28 void acceptConnection(String requestorUrl, String resolvedUrl, | 28 void acceptConnection(String requestorUrl, String resolvedUrl, |
29 ApplicationConnection connection) { | 29 ApplicationConnection connection) { |
30 connection.provideService(EchoService.serviceName, | 30 connection.provideService(EchoService.serviceName, |
31 (endpoint) => new DummyEchoServiceImpl(), | 31 (endpoint) => new DummyEchoServiceImpl(), |
32 description: EchoServiceStub.serviceDescription); | 32 description: EchoService.serviceDescription); |
33 } | 33 } |
34 } | 34 } |
35 | 35 |
36 main(List args, Object handleToken) { | 36 main(List args, Object handleToken) { |
37 MojoHandle appHandle = new MojoHandle(handleToken); | 37 MojoHandle appHandle = new MojoHandle(handleToken); |
38 new EchoApplication.fromHandle(appHandle) | 38 new EchoApplication.fromHandle(appHandle) |
39 ..onError = ((_) { | 39 ..onError = ((_) { |
40 MojoHandle.reportLeakedHandles(); | 40 MojoHandle.reportLeakedHandles(); |
41 }); | 41 }); |
42 } | 42 } |
OLD | NEW |