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

Unified Diff: services/dart/test/echo/main.dart

Issue 959993002: Dart: Removes name conflicts from generated bindings. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Removes unused constructors 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 0d211add5be9693a8b6a2342cb275d461877ddf7..4f93a7aae454e4aed94e1a3c49c49e16c7d65af0 100644
--- a/services/dart/test/echo/main.dart
+++ b/services/dart/test/echo/main.dart
@@ -9,17 +9,20 @@ import 'mojo:core';
import 'package:services/dart/test/echo_service.mojom.dart';
-class EchoServiceImpl extends EchoService {
+class EchoServiceImpl implements EchoService {
+ EchoServiceStub _stub;
Application _application;
EchoServiceImpl(Application application, MojoMessagePipeEndpoint endpoint)
- : _application = application, super(endpoint) {
- super.delegate = this;
+ : _application = application {
+ _stub = new EchoServiceStub.fromEndpoint(endpoint)
+ ..delegate = this
+ ..listen();
}
echoString(String value, Function responseFactory) {
if (value == "quit") {
- close();
+ _stub.close();
_application.close();
}
return new Future.value(responseFactory(value));
@@ -30,7 +33,7 @@ class EchoApplication extends Application {
EchoApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle);
void acceptConnection(String requestorUrl, ApplicationConnection connection) {
- connection.provideService(EchoService.name, (endpoint) =>
+ connection.provideService(EchoServiceName, (endpoint) =>
new EchoServiceImpl(this, endpoint));
connection.listen();
}
@@ -39,6 +42,5 @@ class EchoApplication extends Application {
main(List args) {
MojoHandle appHandle = new MojoHandle(args[0]);
String url = args[1];
- var echoApplication = new EchoApplication.fromHandle(appHandle);
- echoApplication.listen();
+ new EchoApplication.fromHandle(appHandle);
}

Powered by Google App Engine
This is Rietveld 408576698