| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 void quit() {} | 120 void quit() {} |
| 121 } | 121 } |
| 122 | 122 |
| 123 class PingPongApplication extends Application { | 123 class PingPongApplication extends Application { |
| 124 PingPongApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle); | 124 PingPongApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle); |
| 125 | 125 |
| 126 @override | 126 @override |
| 127 void acceptConnection(String requestorUrl, String resolvedUrl, | 127 void acceptConnection(String requestorUrl, String resolvedUrl, |
| 128 ApplicationConnection connection) { | 128 ApplicationConnection connection) { |
| 129 // No services are required from the remote end. | |
| 130 connection.remoteServiceProvider.close(); | |
| 131 | |
| 132 connection.provideService(PingPongService.serviceName, | 129 connection.provideService(PingPongService.serviceName, |
| 133 (endpoint) => new PingPongServiceImpl(this, endpoint), | 130 (endpoint) => new PingPongServiceImpl(this, endpoint), |
| 134 description: PingPongServiceStub.serviceDescription); | 131 description: PingPongServiceStub.serviceDescription); |
| 135 } | 132 } |
| 136 } | 133 } |
| 137 | 134 |
| 138 main(List args, Object handleToken) { | 135 main(List args, Object handleToken) { |
| 139 MojoHandle appHandle = new MojoHandle(handleToken); | 136 MojoHandle appHandle = new MojoHandle(handleToken); |
| 140 new PingPongApplication.fromHandle(appHandle) | 137 new PingPongApplication.fromHandle(appHandle) |
| 141 ..onError = ((_) { | 138 ..onError = ((_) { |
| 142 MojoHandle.reportLeakedHandles(); | 139 MojoHandle.reportLeakedHandles(); |
| 143 }); | 140 }); |
| 144 } | 141 } |
| OLD | NEW |