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

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

Issue 2298563002: Removed const from classes arrays in Observatory (Closed)
Patch Set: Created 4 years, 3 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 library_view_element; 5 library library_view_element;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'package:observatory/models.dart' as M; 9 import 'package:observatory/models.dart' as M;
10 import 'package:observatory/src/elements/class_ref.dart'; 10 import 'package:observatory/src/elements/class_ref.dart';
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 new NavIsolateMenuElement(_isolate, _events, queue: _r.queue), 147 new NavIsolateMenuElement(_isolate, _events, queue: _r.queue),
148 new NavMenuElement('instance', last: true, queue: _r.queue), 148 new NavMenuElement('instance', last: true, queue: _r.queue),
149 new NavRefreshElement(queue: _r.queue) 149 new NavRefreshElement(queue: _r.queue)
150 ..onRefresh.listen((e) async { 150 ..onRefresh.listen((e) async {
151 e.element.disabled = true; 151 e.element.disabled = true;
152 _refresh(); 152 _refresh();
153 }), 153 }),
154 new NavNotifyElement(_notifications, queue: _r.queue) 154 new NavNotifyElement(_notifications, queue: _r.queue)
155 ], 155 ],
156 156
157 new DivElement()..classes = const ['content-centered-big'] 157 new DivElement()..classes = ['content-centered-big']
158 ..children = [ 158 ..children = [
159 new HeadingElement.h2()..text = 'ICData', 159 new HeadingElement.h2()..text = 'ICData',
160 new HRElement(), 160 new HRElement(),
161 new ObjectCommonElement(_isolate, _library, _retainedSizes, 161 new ObjectCommonElement(_isolate, _library, _retainedSizes,
162 _reachableSizes, _references, _retainingPaths, 162 _reachableSizes, _references, _retainingPaths,
163 _instances, queue: _r.queue), 163 _instances, queue: _r.queue),
164 new DivElement()..classes = ['memberList'] 164 new DivElement()..classes = ['memberList']
165 ..children = [ 165 ..children = [
166 new DivElement()..classes = ['memberItem'] 166 new DivElement()..classes = ['memberItem']
167 ..children = [ 167 ..children = [
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 Element _createDependencies() { 212 Element _createDependencies() {
213 if (_library.dependencies.isEmpty) { 213 if (_library.dependencies.isEmpty) {
214 return new SpanElement(); 214 return new SpanElement();
215 } 215 }
216 final dependencies = _library.dependencies.toList(); 216 final dependencies = _library.dependencies.toList();
217 return new DivElement() 217 return new DivElement()
218 ..children = [ 218 ..children = [
219 new SpanElement()..text = 'dependencies (${dependencies.length}) ', 219 new SpanElement()..text = 'dependencies (${dependencies.length}) ',
220 new CurlyBlockElement(queue: _r.queue) 220 new CurlyBlockElement(queue: _r.queue)
221 ..children = dependencies.map((d) => 221 ..children = dependencies.map((d) =>
222 new DivElement()..classes = const ['indent'] 222 new DivElement()..classes = ['indent']
223 ..children = [ 223 ..children = [
224 new SpanElement()..text = d.isImport ? 'import ' : 'export ', 224 new SpanElement()..text = d.isImport ? 'import ' : 'export ',
225 new LibraryRefElement(_isolate, d.target, queue: _r.queue), 225 new LibraryRefElement(_isolate, d.target, queue: _r.queue),
226 new SpanElement()..text = d.prefix == null ? '' 226 new SpanElement()..text = d.prefix == null ? ''
227 : ' as ${d.prefix}', 227 : ' as ${d.prefix}',
228 new SpanElement()..text = d.isDeferred ? ' deferred' : '', 228 new SpanElement()..text = d.isDeferred ? ' deferred' : '',
229 ]).toList() 229 ]).toList()
230 ]; 230 ];
231 } 231 }
232 232
233 Element _createScripts() { 233 Element _createScripts() {
234 if (_library.scripts.isEmpty) { 234 if (_library.scripts.isEmpty) {
235 return new SpanElement(); 235 return new SpanElement();
236 } 236 }
237 final scripts = _library.scripts.toList(); 237 final scripts = _library.scripts.toList();
238 return new DivElement() 238 return new DivElement()
239 ..children = [ 239 ..children = [
240 new SpanElement()..text = 'scripts (${scripts.length}) ', 240 new SpanElement()..text = 'scripts (${scripts.length}) ',
241 new CurlyBlockElement(queue: _r.queue) 241 new CurlyBlockElement(queue: _r.queue)
242 ..children = scripts.map((s) => 242 ..children = scripts.map((s) =>
243 new DivElement()..classes = const ['indent'] 243 new DivElement()..classes = ['indent']
244 ..children = [ 244 ..children = [
245 new ScriptRefElement(_isolate, s, queue: _r.queue) 245 new ScriptRefElement(_isolate, s, queue: _r.queue)
246 ]).toList() 246 ]).toList()
247 ]; 247 ];
248 } 248 }
249 249
250 Element _createClasses() { 250 Element _createClasses() {
251 if (_library.classes.isEmpty) { 251 if (_library.classes.isEmpty) {
252 return new SpanElement(); 252 return new SpanElement();
253 } 253 }
254 final classes = _library.classes.toList(); 254 final classes = _library.classes.toList();
255 return new DivElement() 255 return new DivElement()
256 ..children = [ 256 ..children = [
257 new SpanElement()..text = 'classes (${classes.length}) ', 257 new SpanElement()..text = 'classes (${classes.length}) ',
258 new CurlyBlockElement(queue: _r.queue) 258 new CurlyBlockElement(queue: _r.queue)
259 ..children = classes.map((c) => 259 ..children = classes.map((c) =>
260 new DivElement()..classes = const ['indent'] 260 new DivElement()..classes = ['indent']
261 ..children = [ 261 ..children = [
262 new ClassRefElement(_isolate, c, queue: _r.queue) 262 new ClassRefElement(_isolate, c, queue: _r.queue)
263 ]).toList() 263 ]).toList()
264 ]; 264 ];
265 } 265 }
266 266
267 Element _createVariables() { 267 Element _createVariables() {
268 if (_library.variables.isEmpty) { 268 if (_library.variables.isEmpty) {
269 return new SpanElement(); 269 return new SpanElement();
270 } 270 }
271 final variables = _library.variables.toList(); 271 final variables = _library.variables.toList();
272 return new DivElement() 272 return new DivElement()
273 ..children = [ 273 ..children = [
274 new SpanElement()..text = 'variables (${variables.length}) ', 274 new SpanElement()..text = 'variables (${variables.length}) ',
275 new CurlyBlockElement(queue: _r.queue) 275 new CurlyBlockElement(queue: _r.queue)
276 ..children = [ 276 ..children = [
277 _variables == null 277 _variables == null
278 ? (new SpanElement()..text = 'loading...') 278 ? (new SpanElement()..text = 'loading...')
279 : (new DivElement()..classes = const ['indent', 'memberList'] 279 : (new DivElement()..classes = ['indent', 'memberList']
280 ..children = _variables.map((f) => 280 ..children = _variables.map((f) =>
281 new DivElement()..classes = const ['memberItem'] 281 new DivElement()..classes = ['memberItem']
282 ..children = [ 282 ..children = [
283 new DivElement()..classes = const ['memberName'] 283 new DivElement()..classes = ['memberName']
284 ..children = [ 284 ..children = [
285 new FieldRefElement(_isolate, f, _instances, 285 new FieldRefElement(_isolate, f, _instances,
286 queue: _r.queue) 286 queue: _r.queue)
287 ], 287 ],
288 new DivElement()..classes = const ['memberValue'] 288 new DivElement()..classes = ['memberValue']
289 ..children = [ 289 ..children = [
290 new SpanElement()..text = ' = ', 290 new SpanElement()..text = ' = ',
291 anyRef(_isolate, f.staticValue, _instances, 291 anyRef(_isolate, f.staticValue, _instances,
292 queue: _r.queue) 292 queue: _r.queue)
293 ] 293 ]
294 ]).toList()) 294 ]).toList())
295 ] 295 ]
296 ]; 296 ];
297 } 297 }
298 298
299 Element _createFunctions() { 299 Element _createFunctions() {
300 if (_library.functions.isEmpty) { 300 if (_library.functions.isEmpty) {
301 return new SpanElement(); 301 return new SpanElement();
302 } 302 }
303 final functions = _library.functions.toList(); 303 final functions = _library.functions.toList();
304 return new DivElement() 304 return new DivElement()
305 ..children = [ 305 ..children = [
306 new SpanElement()..text = 'functions (${functions.length}) ', 306 new SpanElement()..text = 'functions (${functions.length}) ',
307 new CurlyBlockElement(queue: _r.queue) 307 new CurlyBlockElement(queue: _r.queue)
308 ..children = functions.map((f) => 308 ..children = functions.map((f) =>
309 new DivElement()..classes = const ['indent'] 309 new DivElement()..classes = ['indent']
310 ..children = [ 310 ..children = [
311 new FunctionRefElement(_isolate, f, queue: _r.queue) 311 new FunctionRefElement(_isolate, f, queue: _r.queue)
312 ]).toList() 312 ]).toList()
313 ]; 313 ];
314 } 314 }
315 } 315 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698