Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: mojo/dart/apptests/test_apps/pingpong_target/lib/main.dart

Issue 1964623002: Make the Dart application library code stop using the "wrong way" service provider (a.k.a. exposed_… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 class PingPongApplication extends Application { 50 class PingPongApplication extends Application {
51 PingPongApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle); 51 PingPongApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle);
52 52
53 @override 53 @override
54 void acceptConnection(String requestorUrl, String resolvedUrl, 54 void acceptConnection(String requestorUrl, String resolvedUrl,
55 ApplicationConnection connection) { 55 ApplicationConnection connection) {
56 // Provide the service implemented by PingPongServiceImpl. 56 // Provide the service implemented by PingPongServiceImpl.
57 connection.provideService(PingPongService.serviceName, 57 connection.provideService(PingPongService.serviceName,
58 (endpoint) => new PingPongServiceImpl(this, endpoint)); 58 (endpoint) => new PingPongServiceImpl(this, endpoint));
59
60 // No services are required from the remote end.
61 connection.remoteServiceProvider.close();
62 } 59 }
63 60
64 Future closeApplication() async { 61 Future closeApplication() async {
65 await close(); 62 await close();
66 MojoHandle.reportLeakedHandles(); 63 MojoHandle.reportLeakedHandles();
67 } 64 }
68 } 65 }
69 66
70 main(List args, Object handleToken) { 67 main(List args, Object handleToken) {
71 MojoHandle appHandle = new MojoHandle(handleToken); 68 MojoHandle appHandle = new MojoHandle(handleToken);
72 new PingPongApplication.fromHandle(appHandle); 69 new PingPongApplication.fromHandle(appHandle);
73 } 70 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698