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

Unified Diff: examples/dart/device_info/lib/main.dart

Issue 2006093002: Dart: Futures -> Callbacks. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Merge Created 4 years, 6 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 | « benchmarks/mojo_rtt_benchmark/lib/main.dart ('k') | examples/dart/echo_client/lib/main.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/dart/device_info/lib/main.dart
diff --git a/examples/dart/device_info/lib/main.dart b/examples/dart/device_info/lib/main.dart
index f58a95b97ff0c4429aa948589ecb9ab26635da51..e7421177e3367884a2804ecd7748fab4a78fab0f 100644
--- a/examples/dart/device_info/lib/main.dart
+++ b/examples/dart/device_info/lib/main.dart
@@ -17,7 +17,11 @@ class DeviceInfoApp extends Application {
Future initialize(List<String> args, String url) async {
connectToService("mojo:device_info", _deviceInfo);
- print(await _deviceInfo.getDeviceType());
+ var c = new Completer();
+ _deviceInfo.getDeviceType((DeviceInfoDeviceType type) {
+ c.complete(type);
+ });
+ print(await _deviceInfo.responseOrError(c.future));
_deviceInfo.close();
close();
}
« no previous file with comments | « benchmarks/mojo_rtt_benchmark/lib/main.dart ('k') | examples/dart/echo_client/lib/main.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698