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

Unified Diff: examples/dart/hello_world/hello/main.dart

Issue 968243003: Dart: Adds optional named arguments for creating bindings. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Format 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
« no previous file with comments | « no previous file | mojo/dart/embedder/test/dart_to_cpp_tests.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/dart/hello_world/hello/main.dart
diff --git a/examples/dart/hello_world/hello/main.dart b/examples/dart/hello_world/hello/main.dart
index 4dcbd4c86614081d699517f8d177cc5131559b46..fda17418b3dba3bb2b60dbdc58f74eb4c1dd34fc 100644
--- a/examples/dart/hello_world/hello/main.dart
+++ b/examples/dart/hello_world/hello/main.dart
@@ -14,10 +14,16 @@ class Hello extends Application {
void initialize(List<String> args, String url) {
print("$url Hello");
+
// We expect to find the world mojo application at the same
// path as this application.
- connectToApplication(url.replaceAll("hello", "world"));
- close();
+ var c = connectToApplication(url.replaceAll("hello", "world"));
+
+ // A call to close() here would cause this app to go down before the "world"
+ // app has a chance to come up. Instead, we wait to close this app until
+ // the "world" app comes up, does its print, and closes its end of the
+ // connection.
+ c.listen(onClosed: close);
}
}
« no previous file with comments | « no previous file | mojo/dart/embedder/test/dart_to_cpp_tests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698