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

Unified Diff: runtime/bin/vmservice/client/lib/src/app/chart.dart

Issue 299823004: Upgrade Observatory to Polymer 0.10.x (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
Index: runtime/bin/vmservice/client/lib/src/app/chart.dart
diff --git a/runtime/bin/vmservice/client/lib/src/app/chart.dart b/runtime/bin/vmservice/client/lib/src/app/chart.dart
index 6c433069a0278ad2ff4d5e1fba574df4e416f2c8..3e6205ce43b852df5f11ab71ec60204f90e96566 100644
--- a/runtime/bin/vmservice/client/lib/src/app/chart.dart
+++ b/runtime/bin/vmservice/client/lib/src/app/chart.dart
@@ -13,17 +13,22 @@ class GoogleChart {
return _api;
}
+ static Completer _completer = new Completer();
+
+ static Future get onReady => _completer.future;
+
+ static bool get ready => _completer.isCompleted;
+
/// Load the Google Chart API. Returns a [Future] which completes
/// when the API is loaded.
static Future initOnce() {
- Completer c = new Completer();
Logger.root.info('Loading Google Charts API');
context['google'].callMethod('load',
['visualization', '1', new JsObject.jsify({
'packages': ['corechart', 'table'],
- 'callback': new JsFunction.withThis(c.complete)
+ 'callback': new JsFunction.withThis(_completer.complete)
})]);
- return c.future.then(_initOnceOnComplete);
+ return _completer.future.then(_initOnceOnComplete);
}
static _initOnceOnComplete(_) {
« no previous file with comments | « runtime/bin/vmservice/client/dotdot.sh ('k') | runtime/bin/vmservice/client/lib/src/elements/action_link.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698