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

Unified Diff: mojo/dart/packages/mojo/lib/src/application_connection.dart

Issue 1998433002: Dart: Adds Interface and InterfaceRequest interfaces. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Merge Created 4 years, 7 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 | « mojo/dart/packages/mojo/lib/src/application.dart ('k') | mojo/dart/packages/mojo/lib/src/codec.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/packages/mojo/lib/src/application_connection.dart
diff --git a/mojo/dart/packages/mojo/lib/src/application_connection.dart b/mojo/dart/packages/mojo/lib/src/application_connection.dart
index fe8562ed1a9b46f71edb69cac464375fe13b6ed3..eecc23caee12493f9c905fe8befed11e8f20b0eb 100644
--- a/mojo/dart/packages/mojo/lib/src/application_connection.dart
+++ b/mojo/dart/packages/mojo/lib/src/application_connection.dart
@@ -49,8 +49,8 @@ class LocalServiceProvider implements ServiceProvider {
/// [Application.acceptConnection].
///
/// To request a service (e.g. `Foo`) from the remote application:
-/// var fooProxy =
-/// applicationConnection.requestService(new FooProxy.unbound());
+/// var foo = new FooInterfaceRequest();
+/// applicationConnection.requestService(foo);
///
/// To provide a service to the remote application, specify a function that
/// instantiantes a service. For example:
@@ -90,25 +90,24 @@ class ApplicationConnection {
_fallbackServiceFactory = f;
}
- bindings.Proxy requestService(bindings.Proxy proxy,
- [String serviceName]) {
- if (proxy.ctrl.isBound ||
+ void requestService(bindings.MojoInterface iface, [String serviceName]) {
+ if (iface.ctrl.isBound ||
(remoteServiceProvider == null) ||
!remoteServiceProvider.ctrl.isBound) {
throw new core.MojoApiError(
- "The proxy is bound, or there is no remove service provider proxy");
+ "The interface is already bound, "
+ "or there is no remote service provider");
}
- var name = serviceName ?? proxy.ctrl.serviceName;
+ var name = serviceName ?? iface.ctrl.serviceName;
if ((name == null) || name.isEmpty) {
throw new core.MojoApiError(
"If an interface has no ServiceName, then one must be provided.");
}
var pipe = new core.MojoMessagePipe();
- proxy.ctrl.bind(pipe.endpoints[0]);
+ iface.ctrl.bind(pipe.endpoints[0]);
remoteServiceProvider.connectToService_(name, pipe.endpoints[1]);
- return proxy;
}
/// Prepares this connection to provide the specified service when a call for
« no previous file with comments | « mojo/dart/packages/mojo/lib/src/application.dart ('k') | mojo/dart/packages/mojo/lib/src/codec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698