| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'mojo:application'; | 6 import 'mojo:application'; |
| 7 import 'mojo:bindings'; | 7 import 'mojo:bindings'; |
| 8 import 'mojo:core'; | 8 import 'mojo:core'; |
| 9 | 9 |
| 10 import 'package:services/dart/test/echo_service.mojom.dart'; | 10 import 'package:services/dart/test/echo_service.mojom.dart'; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 _stub.close(); | 25 _stub.close(); |
| 26 _application.close(); | 26 _application.close(); |
| 27 } | 27 } |
| 28 return new Future.value(responseFactory(value)); | 28 return new Future.value(responseFactory(value)); |
| 29 } | 29 } |
| 30 } | 30 } |
| 31 | 31 |
| 32 class EchoApplication extends Application { | 32 class EchoApplication extends Application { |
| 33 EchoApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle); | 33 EchoApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle); |
| 34 | 34 |
| 35 void acceptConnection(String requestorUrl, ApplicationConnection connection) { | 35 @override |
| 36 void acceptConnection(String requestorUrl, String resolvedUrl, |
| 37 ApplicationConnection connection) { |
| 36 connection.provideService(EchoServiceName, (endpoint) => | 38 connection.provideService(EchoServiceName, (endpoint) => |
| 37 new EchoServiceImpl(this, endpoint)); | 39 new EchoServiceImpl(this, endpoint)); |
| 38 connection.listen(); | 40 connection.listen(); |
| 39 } | 41 } |
| 40 } | 42 } |
| 41 | 43 |
| 42 main(List args) { | 44 main(List args) { |
| 43 MojoHandle appHandle = new MojoHandle(args[0]); | 45 MojoHandle appHandle = new MojoHandle(args[0]); |
| 44 String url = args[1]; | 46 String url = args[1]; |
| 45 new EchoApplication.fromHandle(appHandle); | 47 new EchoApplication.fromHandle(appHandle); |
| 46 } | 48 } |
| OLD | NEW |