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

Unified Diff: services/dart/test/pingpong_target/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/pingpong/main.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/dart/test/pingpong_target/main.dart
diff --git a/services/dart/test/pingpong_target/main.dart b/services/dart/test/pingpong_target/main.dart
index 96bc0ed661cba2731afbd7b878acbf91ed160726..a85e4a7b47cad98045376bed8a6fac76ac868411 100644
--- a/services/dart/test/pingpong_target/main.dart
+++ b/services/dart/test/pingpong_target/main.dart
@@ -16,9 +16,7 @@ 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);
}
void setClient(ProxyBase proxyBase) {
@@ -34,9 +32,6 @@ class PingPongServiceImpl implements PingPongService {
_pingPongClient = null;
}
_stub.close();
- if (_application != null) {
- _application.close();
- }
}
}
@@ -45,10 +40,12 @@ 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();
+ // Close the application when the first connection goes down.
+ connection.listen(onClosed: close);
}
}
« no previous file with comments | « services/dart/test/pingpong/main.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698