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

Unified Diff: services/dart/test/echo/main.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: services/dart/test/echo/main.dart
diff --git a/services/dart/test/echo/main.dart b/services/dart/test/echo/main.dart
index 4f93a7aae454e4aed94e1a3c49c49e16c7d65af0..60cdb4d69fad4c61e9cfe994d70a66161662fe72 100644
--- a/services/dart/test/echo/main.dart
+++ b/services/dart/test/echo/main.dart
@@ -10,20 +10,17 @@ import 'mojo:core';
import 'package:services/dart/test/echo_service.mojom.dart';
class EchoServiceImpl implements EchoService {
- EchoServiceStub _stub;
+ EchoServiceBinding _binding;
Application _application;
EchoServiceImpl(Application application, MojoMessagePipeEndpoint endpoint)
: _application = application {
- _stub = new EchoServiceStub.fromEndpoint(endpoint)
- ..delegate = this
- ..listen();
+ _binding = new EchoServiceBinding.fromEndpoint(endpoint, delegate: this);
}
echoString(String value, Function responseFactory) {
if (value == "quit") {
- _stub.close();
- _application.close();
+ _binding.close();
}
return new Future.value(responseFactory(value));
}
@@ -32,7 +29,9 @@ class EchoServiceImpl implements EchoService {
class EchoApplication extends Application {
EchoApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle);
- void acceptConnection(String requestorUrl, ApplicationConnection connection) {
+ void acceptConnection(String requestorUrl,
+ ApplicationConnection connection,
+ String resolvedUrl) {
connection.provideService(EchoServiceName, (endpoint) =>
new EchoServiceImpl(this, endpoint));
connection.listen();

Powered by Google App Engine
This is Rietveld 408576698