| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 observatory_element; | 5 library observatory_element; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'package:observatory/app.dart'; | 9 import 'package:observatory/app.dart'; |
| 10 import 'package:observatory/service.dart'; | 10 import 'package:observatory/service.dart'; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 String formatTimePrecise(double time) => Utils.formatTimePrecise(time); | 123 String formatTimePrecise(double time) => Utils.formatTimePrecise(time); |
| 124 String formatTimeMilliseconds(int millis) => | 124 String formatTimeMilliseconds(int millis) => |
| 125 Utils.formatTimeMilliseconds(millis); | 125 Utils.formatTimeMilliseconds(millis); |
| 126 String formatTime(double time) => Utils.formatTime(time); | 126 String formatTime(double time) => Utils.formatTime(time); |
| 127 | 127 |
| 128 String formatSeconds(double x) => Utils.formatSeconds(x); | 128 String formatSeconds(double x) => Utils.formatSeconds(x); |
| 129 | 129 |
| 130 | 130 |
| 131 String formatSize(int bytes) => Utils.formatSize(bytes); | 131 String formatSize(int bytes) => Utils.formatSize(bytes); |
| 132 | 132 |
| 133 String fileAndLine(Map frame) { | |
| 134 var file = frame['script'].name; | |
| 135 var shortFile = file.substring(file.lastIndexOf('/') + 1); | |
| 136 return "${shortFile}:${frame['line']}"; | |
| 137 } | |
| 138 | |
| 139 int parseInt(String value) => int.parse(value); | 133 int parseInt(String value) => int.parse(value); |
| 140 | 134 |
| 141 String asStringLiteral(String value, [bool wasTruncated=false]) { | 135 String asStringLiteral(String value, [bool wasTruncated=false]) { |
| 142 var result = new List(); | 136 var result = new List(); |
| 143 result.add("'".codeUnitAt(0)); | 137 result.add("'".codeUnitAt(0)); |
| 144 for (int codeUnit in value.codeUnits) { | 138 for (int codeUnit in value.codeUnits) { |
| 145 if (codeUnit == '\n'.codeUnitAt(0)) result.addAll('\\n'.codeUnits); | 139 if (codeUnit == '\n'.codeUnitAt(0)) result.addAll('\\n'.codeUnits); |
| 146 else if (codeUnit == '\r'.codeUnitAt(0)) result.addAll('\\r'.codeUnits); | 140 else if (codeUnit == '\r'.codeUnitAt(0)) result.addAll('\\r'.codeUnits); |
| 147 else if (codeUnit == '\f'.codeUnitAt(0)) result.addAll('\\f'.codeUnits); | 141 else if (codeUnit == '\f'.codeUnitAt(0)) result.addAll('\\f'.codeUnits); |
| 148 else if (codeUnit == '\b'.codeUnitAt(0)) result.addAll('\\b'.codeUnits); | 142 else if (codeUnit == '\b'.codeUnitAt(0)) result.addAll('\\b'.codeUnits); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 node.style.visibility = 'hidden'; | 215 node.style.visibility = 'hidden'; |
| 222 } | 216 } |
| 223 Timer.run(() { | 217 Timer.run(() { |
| 224 for (var node in noCopyNodes) { | 218 for (var node in noCopyNodes) { |
| 225 node.style.visibility = 'visible'; | 219 node.style.visibility = 'visible'; |
| 226 } | 220 } |
| 227 }); | 221 }); |
| 228 }); | 222 }); |
| 229 } | 223 } |
| 230 } | 224 } |
| OLD | NEW |