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

Side by Side Diff: services/dart/test/echo/main.dart

Issue 973293002: Gets dart working with new Application::AcceptConnection param (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698