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

Side by Side Diff: runtime/observatory/lib/src/elements/observatory_element.dart

Issue 1150303004: Switch to using SourceLocation universally in service protocol. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: post merge Created 5 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 unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/isolate_view.html ('k') | runtime/observatory/lib/src/elements/script_inset.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698