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

Side by Side Diff: mojo/dart/apptests/test_apps/echo/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 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 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 }); 50 });
51 } 51 }
52 } 52 }
53 53
54 class EchoApplication extends Application { 54 class EchoApplication extends Application {
55 EchoApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle); 55 EchoApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle);
56 56
57 @override 57 @override
58 void acceptConnection(String requestorUrl, String resolvedUrl, 58 void acceptConnection(String requestorUrl, String resolvedUrl,
59 ApplicationConnection connection) { 59 ApplicationConnection connection) {
60 // No services are required from the remote end.
61 connection.remoteServiceProvider.close();
62 connection.provideService(EchoService.serviceName, 60 connection.provideService(EchoService.serviceName,
63 (endpoint) => new EchoServiceImpl(this, endpoint)); 61 (endpoint) => new EchoServiceImpl(this, endpoint));
64 } 62 }
65 } 63 }
66 64
67 main(List args, Object handleToken) { 65 main(List args, Object handleToken) {
68 MojoHandle appHandle = new MojoHandle(handleToken); 66 MojoHandle appHandle = new MojoHandle(handleToken);
69 new EchoApplication.fromHandle(appHandle) 67 new EchoApplication.fromHandle(appHandle)
70 ..onError = ((_) { 68 ..onError = ((_) {
71 MojoHandle.reportLeakedHandles(); 69 MojoHandle.reportLeakedHandles();
72 }); 70 });
73 } 71 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698