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

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: 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..0ed5e1872e098d2e0f7cbcfed8f5b66ec041d2da 100644
--- a/mojo/public/dart/src/application_connection.dart
+++ b/mojo/public/dart/src/application_connection.dart
@@ -11,15 +11,15 @@ typedef void FallbackServiceFactory(String interfaceName,
class LocalServiceProvider implements ServiceProvider {
final ApplicationConnection connection;
- ServiceProviderStub _stub;
+ ServiceProviderBinding _binding;
sky 2015/03/02 20:28:22 Binding is such a better name than Stub. Thanks!
zra 2015/03/02 20:52:45 No problem =)
- LocalServiceProvider(this.connection, this._stub) {
- _stub.delegate = this;
+ LocalServiceProvider(this.connection, this._binding) {
+ _binding.delegate = this;
}
- listen() => _stub.listen();
+ listen({Function onClosed}) => _binding.listen(onClosed: onClosed);
- void close({bool nodefer : false}) => _stub.close(nodefer: nodefer);
+ void close({bool nodefer : false}) => _binding.close(nodefer: nodefer);
void connectToService(String interfaceName,
core.MojoMessagePipeEndpoint pipe) {
@@ -64,10 +64,11 @@ class ApplicationConnection {
final _nameToServiceFactory = new Map<String, ServiceFactory>();
FallbackServiceFactory _fallbackServiceFactory;
- ApplicationConnection(ServiceProviderStub stub, ServiceProviderProxy proxy)
+ ApplicationConnection(
+ ServiceProviderBinding binding, ServiceProviderProxy proxy)
: remoteServiceProvider = proxy {
- if (stub != null) _localServiceProvider =
- new LocalServiceProvider(this, stub);
+ if (binding != null)
+ _localServiceProvider = new LocalServiceProvider(this, binding);
}
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