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

Unified Diff: mojo/public/dart/src/application_connection.dart

Issue 968243003: Dart: Adds optional named arguments for creating bindings. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Binding -> Stub, delegate -> impl 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
Index: mojo/public/dart/src/application_connection.dart
diff --git a/mojo/public/dart/src/application_connection.dart b/mojo/public/dart/src/application_connection.dart
index 4f0b6c8ed250056b670b9b7cddee8faeb53c7b07..05c1cab0f671deac0d42e3be2a87c3ff502635ea 100644
--- a/mojo/public/dart/src/application_connection.dart
+++ b/mojo/public/dart/src/application_connection.dart
@@ -14,10 +14,10 @@ class LocalServiceProvider implements ServiceProvider {
ServiceProviderStub _stub;
LocalServiceProvider(this.connection, this._stub) {
- _stub.delegate = this;
+ _stub.impl = this;
}
- listen() => _stub.listen();
+ listen({Function onClosed}) => _stub.listen(onClosed: onClosed);
sky 2015/03/03 20:14:13 Is there a reason not to follow the closer pattern
zra 2015/03/03 21:28:54 Done. Added here and in ApplicationConnection.
void close({bool nodefer : false}) => _stub.close(nodefer: nodefer);
@@ -64,10 +64,11 @@ class ApplicationConnection {
final _nameToServiceFactory = new Map<String, ServiceFactory>();
FallbackServiceFactory _fallbackServiceFactory;
- ApplicationConnection(ServiceProviderStub stub, ServiceProviderProxy proxy)
+ ApplicationConnection(
+ ServiceProviderStub stub, ServiceProviderProxy proxy)
: remoteServiceProvider = proxy {
- if (stub != null) _localServiceProvider =
- new LocalServiceProvider(this, stub);
+ if (stub != null)
+ _localServiceProvider = new LocalServiceProvider(this, stub);
}
FallbackServiceFactory get fallbackServiceFactory => _fallbackServiceFactory;
@@ -92,9 +93,9 @@ class ApplicationConnection {
_nameToServiceFactory[interfaceName] = factory;
}
- void listen() {
+ void listen({Function onClosed}) {
assert(_localServiceProvider != null);
- _localServiceProvider.listen();
+ _localServiceProvider.listen(onClosed: onClosed);
}
void close({bool nodefer: false}) {

Powered by Google App Engine
This is Rietveld 408576698