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

Side by Side Diff: services/dart/test/pingpong/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 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 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/pingpong_service.mojom.dart'; 10 import 'package:services/dart/test/pingpong_service.mojom.dart';
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 _stub.close(); 107 _stub.close();
108 if (_application != null) { 108 if (_application != null) {
109 _application.close(); 109 _application.close();
110 } 110 }
111 } 111 }
112 } 112 }
113 113
114 class PingPongApplication extends Application { 114 class PingPongApplication extends Application {
115 PingPongApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle); 115 PingPongApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle);
116 116
117 void acceptConnection(String requestorUrl, ApplicationConnection connection) { 117 @override
118 void acceptConnection(String requestorUrl, String resolvedUrl,
119 ApplicationConnection connection) {
118 connection.provideService(PingPongServiceName, 120 connection.provideService(PingPongServiceName,
119 (endpoint) => new PingPongServiceImpl(this, endpoint)); 121 (endpoint) => new PingPongServiceImpl(this, endpoint));
120 connection.listen(); 122 connection.listen();
121 } 123 }
122 } 124 }
123 125
124 main(List args) { 126 main(List args) {
125 MojoHandle appHandle = new MojoHandle(args[0]); 127 MojoHandle appHandle = new MojoHandle(args[0]);
126 String url = args[1]; 128 String url = args[1];
127 new PingPongApplication.fromHandle(appHandle); 129 new PingPongApplication.fromHandle(appHandle);
128 } 130 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698