| 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 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 | 10 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 class PingPongApplication extends Application { | 110 class PingPongApplication extends Application { |
| 111 PingPongApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle); | 111 PingPongApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle); |
| 112 | 112 |
| 113 @override | 113 @override |
| 114 void acceptConnection(String requestorUrl, String resolvedUrl, | 114 void acceptConnection(String requestorUrl, String resolvedUrl, |
| 115 ApplicationConnection connection) { | 115 ApplicationConnection connection) { |
| 116 // No services are required from the remote end. | 116 // No services are required from the remote end. |
| 117 connection.remoteServiceProvider.close(); | 117 connection.remoteServiceProvider.close(); |
| 118 | 118 |
| 119 connection.provideService(PingPongService.serviceName, | 119 connection.provideService(PingPongService.serviceName, |
| 120 (endpoint) => new PingPongServiceImpl(this, endpoint)); | 120 (endpoint) => new PingPongServiceImpl(this, endpoint), |
| 121 description: PingPongServiceStub.serviceDescription); |
| 121 } | 122 } |
| 122 } | 123 } |
| 123 | 124 |
| 124 main(List args, Object handleToken) { | 125 main(List args, Object handleToken) { |
| 125 MojoHandle appHandle = new MojoHandle(handleToken); | 126 MojoHandle appHandle = new MojoHandle(handleToken); |
| 126 new PingPongApplication.fromHandle(appHandle) | 127 new PingPongApplication.fromHandle(appHandle) |
| 127 ..onError = ((_) { | 128 ..onError = ((_) { |
| 128 MojoHandle.reportLeakedHandles(); | 129 MojoHandle.reportLeakedHandles(); |
| 129 }); | 130 }); |
| 130 } | 131 } |
| OLD | NEW |