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

Side by Side Diff: runtime/observatory/lib/utils.dart

Issue 1126363005: Show tooltip with local variable value in Observatory debugger (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/observatory/lib/src/service/object.dart ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library utils; 5 library utils;
6 6
7 import 'dart:async';
7 import 'dart:math'; 8 import 'dart:math';
8 9
9 class Utils { 10 class Utils {
10 11
11 static String formatPercentNormalized(double x) { 12 static String formatPercentNormalized(double x) {
12 var percent = 100.0 * x; 13 var percent = 100.0 * x;
13 return '${percent.toStringAsFixed(2)}%'; 14 return '${percent.toStringAsFixed(2)}%';
14 } 15 }
15 16
16 static String formatPercent(num a, num total) { 17 static String formatPercent(num a, num total) {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 134 }
134 return '${seconds}s'; 135 return '${seconds}s';
135 } 136 }
136 137
137 static String formatSeconds(double x) { 138 static String formatSeconds(double x) {
138 return x.toStringAsFixed(2); 139 return x.toStringAsFixed(2);
139 } 140 }
140 141
141 static bool runningInJavaScript() => identical(1.0, 1); 142 static bool runningInJavaScript() => identical(1.0, 1);
142 } 143 }
144
145 /// A [Task] that can be scheduled on the Dart event queue.
146 class Task {
147 Timer _timer;
148 final Function callback;
149
150 Task(this.callback);
151
152 /// Queue [this] to run on the next Dart event queue pump. Does nothing
153 /// if [this] is already queued.
154 queue() {
155 if (_timer != null) {
156 // Already scheduled.
157 return;
158 }
159 _timer = new Timer(Duration.ZERO, () {
160 _timer = null;
161 callback();
162 });
163 }
164 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/service/object.dart ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698