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

Unified Diff: services/dart/test/pingpong/main.dart

Issue 968243003: Dart: Adds optional named arguments for creating bindings. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Format Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/dart/test/echo/main.dart ('k') | services/dart/test/pingpong_target/main.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/dart/test/pingpong/main.dart
diff --git a/services/dart/test/pingpong/main.dart b/services/dart/test/pingpong/main.dart
index 9b04761c0ffc61254926e4ad3d9ff53440643838..9f7485d74bca8b3ab7f03b2414ffdba5c9ef212d 100644
--- a/services/dart/test/pingpong/main.dart
+++ b/services/dart/test/pingpong/main.dart
@@ -16,7 +16,7 @@ class PingPongClientImpl implements PingPongClient {
PingPongClientImpl.unbound(this._count, this._completer)
: stub = new PingPongClientStub.unbound() {
- stub.delegate = this;
+ stub.impl = this;
}
void pong(int pongValue) {
@@ -34,19 +34,17 @@ class PingPongServiceImpl implements PingPongService {
PingPongServiceImpl(Application application, MojoMessagePipeEndpoint endpoint)
: _application = application {
- _stub = new PingPongServiceStub.fromEndpoint(endpoint)
- ..delegate = this
- ..listen();
+ _stub = new PingPongServiceStub.fromEndpoint(endpoint, impl: this);
}
PingPongServiceImpl.fromStub(this._stub) {
- _stub.delegate = this;
+ _stub.impl = this;
}
listen() => _stub.listen();
void setClient(ProxyBase proxyBase) {
- assert(_pingPongClient== null);
+ assert(_pingPongClient == null);
_pingPongClient = proxyBase;
}
@@ -61,7 +59,7 @@ class PingPongServiceImpl implements PingPongService {
return responseFactory(false);
}
var completer = new Completer();
- var pingPongService= new PingPongServiceProxy.unbound();
+ var pingPongService = new PingPongServiceProxy.unbound();
_application.connectToService(url, pingPongService);
var pingPongClient = new PingPongClientImpl.unbound(count, completer);
@@ -73,13 +71,13 @@ class PingPongServiceImpl implements PingPongService {
}
await completer.future;
pingPongService.ptr.quit();
+ pingPongService.close();
return responseFactory(true);
}
- Future pingTargetService(ProxyBase proxyBase,
- int count,
- Function responseFactory) async {
+ Future pingTargetService(ProxyBase proxyBase, int count,
+ Function responseFactory) async {
var pingPongService = proxyBase;
var completer = new Completer();
var client = new PingPongClientImpl.unbound(count, completer);
@@ -91,6 +89,7 @@ class PingPongServiceImpl implements PingPongService {
}
await completer.future;
pingPongService.ptr.quit();
+ pingPongService.close();
return responseFactory(true);
}
@@ -105,9 +104,7 @@ class PingPongServiceImpl implements PingPongService {
_pingPongClient = null;
}
_stub.close();
- if (_application != null) {
- _application.close();
- }
+ _stub = null;
}
}
@@ -116,8 +113,9 @@ class PingPongApplication extends Application {
@override
void acceptConnection(String requestorUrl, String resolvedUrl,
- ApplicationConnection connection) {
- connection.provideService(PingPongServiceName,
+ ApplicationConnection connection) {
+ connection.provideService(
+ PingPongServiceName,
(endpoint) => new PingPongServiceImpl(this, endpoint));
connection.listen();
}
« no previous file with comments | « services/dart/test/echo/main.dart ('k') | services/dart/test/pingpong_target/main.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698