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 isolate_view_element; | 5 library isolate_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/curly_block.dart'; | 10 import 'package:observatory/src/elements/curly_block.dart'; |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 new DivElement() | 333 new DivElement() |
334 ..classes = ['memberItem'] | 334 ..classes = ['memberItem'] |
335 ..children = [ | 335 ..children = [ |
336 new DivElement() | 336 new DivElement() |
337 ..classes = ['memberName'] | 337 ..classes = ['memberName'] |
338 ..text = 'threads (${threads.length})', | 338 ..text = 'threads (${threads.length})', |
339 new DivElement() | 339 new DivElement() |
340 ..classes = ['memberValue'] | 340 ..classes = ['memberValue'] |
341 ..children = [ | 341 ..children = [ |
342 new CurlyBlockElement(queue: _r.queue) | 342 new CurlyBlockElement(queue: _r.queue) |
343 ..content = threads | 343 ..content = threads.map(_populateThreadInfo) |
344 .map(_populateThreadInfo) | |
345 ] | 344 ] |
346 ] | 345 ] |
347 ], | 346 ], |
348 new HRElement(), | 347 new HRElement(), |
349 new EvalBoxElement(_isolate, _isolate.rootLibrary, _instances, _eval, | 348 new EvalBoxElement(_isolate, _isolate.rootLibrary, _instances, _eval, |
350 queue: _r.queue), | 349 queue: _r.queue), |
351 new DivElement() | 350 new DivElement() |
352 ..children = _rootScript != null | 351 ..children = _rootScript != null |
353 ? [ | 352 ? [ |
354 new HRElement(), | 353 new HRElement(), |
355 new ScriptInsetElement( | 354 new ScriptInsetElement( |
356 _isolate, _rootScript, _scripts, _instances, _events, | 355 _isolate, _rootScript, _scripts, _instances, _events, |
357 queue: _r.queue) | 356 queue: _r.queue) |
358 ] | 357 ] |
359 : const [], | 358 : const [], |
360 new HRElement(), | 359 new HRElement(), |
361 new ViewFooterElement(queue: _r.queue) | 360 new ViewFooterElement(queue: _r.queue) |
362 ] | 361 ] |
363 ]; | 362 ]; |
364 } | 363 } |
365 | 364 |
366 DivElement _populateThreadInfo(Thread t) { | 365 DivElement _populateThreadInfo(Thread t) { |
367 int index = 0; | 366 int index = 0; |
368 return new DivElement() | 367 return new DivElement() |
369 ..classes = ['indent'] | 368 ..classes = ['indent'] |
370 ..children = [ | 369 ..children = [ |
371 new SpanElement() | 370 new SpanElement()..text = '${t.id} ', |
372 ..text = '${t.id} ', | |
373 new CurlyBlockElement(queue: _r.queue) | 371 new CurlyBlockElement(queue: _r.queue) |
374 ..content = [ | 372 ..content = [ |
375 new DivElement() | 373 new DivElement() |
376 ..classes = ['indent'] | 374 ..classes = ['indent'] |
377 ..text = 'kind ${t.kindString}', | 375 ..text = 'kind ${t.kindString}', |
378 new DivElement() | 376 new DivElement() |
379 ..classes = ['indent'] | 377 ..classes = ['indent'] |
380 ..title = '${t.memoryHighWatermark}B' | 378 ..title = '${t.memoryHighWatermark}B' |
381 ..text = | 379 ..text = |
382 'native memory usage high watermark ${Utils.formatSize(t.memoryHig
hWatermark)}', | 380 'native memory usage high watermark ${Utils.formatSize(t.memor
yHighWatermark)}', |
383 new DivElement() | 381 new DivElement() |
384 ..children = t.zones | 382 ..children = t.zones.map((z) => new DivElement() |
385 .map((z) => new DivElement() | |
386 ..classes = ['indent'] | 383 ..classes = ['indent'] |
387 ..children = [ | 384 ..children = [ |
388 new DivElement() | 385 new DivElement() |
389 ..children = [ | 386 ..children = [ |
390 new SpanElement() | 387 new SpanElement() |
391 ..children = [ | 388 ..children = [ |
392 // TODO(bkonyi): zones will always be empty. See | 389 // TODO(bkonyi): zones will always be empty. See |
393 // issue #28885. | 390 // issue #28885. |
394 new SpanElement() | 391 new SpanElement()..text = 'zone ${index++} ', |
395 ..text = 'zone ${index++} ', | |
396 new CurlyBlockElement(queue: _r.queue) | 392 new CurlyBlockElement(queue: _r.queue) |
397 ..content = [ | 393 ..content = [ |
398 new DivElement() | 394 new DivElement() |
399 ..classes = ['memberList'] | 395 ..classes = ['memberList'] |
400 ..children = [ | 396 ..children = [ |
401 new DivElement() | 397 new DivElement() |
402 ..classes = ['memberItem'] | 398 ..classes = ['memberItem'] |
403 ..children = [ | 399 ..children = [ |
404 new SpanElement() | 400 new SpanElement() |
405 ..classes = ['memberName'] | 401 ..classes = ['memberName'] |
406 ..text = 'used ', | 402 ..text = 'used ', |
407 new SpanElement() | 403 new SpanElement() |
408 ..classes = ['memberValue'] | 404 ..classes = ['memberValue'] |
409 ..title = '${z.used}B' | 405 ..title = '${z.used}B' |
410 ..text = | 406 ..text = Utils.formatSize(z.used) |
411 Utils.formatSize(z.used) | |
412 ], | 407 ], |
413 new DivElement() | 408 new DivElement() |
414 ..classes = ['memberItem'] | 409 ..classes = ['memberItem'] |
415 ..children = [ | 410 ..children = [ |
416 new SpanElement() | 411 new SpanElement() |
417 ..classes = ['memberName'] | 412 ..classes = ['memberName'] |
418 ..text = 'capacity', | 413 ..text = 'capacity', |
419 new SpanElement() | 414 new SpanElement() |
420 ..classes = ['memberValue'] | 415 ..classes = ['memberValue'] |
421 ..title = '${z.capacity}B' | 416 ..title = '${z.capacity}B' |
422 ..text = | 417 ..text = Utils.formatSize(z.capacity) |
423 Utils.formatSize(z.capacity) | |
424 ] | 418 ] |
425 ] | 419 ] |
426 ] | 420 ] |
427 ] | 421 ] |
428 ] | 422 ] |
429 ] | 423 ]) |
430 )] | 424 ] |
431 ]; | 425 ]; |
432 } | 426 } |
433 | 427 |
434 Future _loadExtraData() async { | 428 Future _loadExtraData() async { |
435 _function = null; | 429 _function = null; |
436 _rootScript = null; | 430 _rootScript = null; |
437 final frame = M.topFrame(_isolate.pauseEvent); | 431 final frame = M.topFrame(_isolate.pauseEvent); |
438 if (frame != null) { | 432 if (frame != null) { |
439 _function = await _functions.get(_isolate, frame.function.id); | 433 _function = await _functions.get(_isolate, frame.function.id); |
440 } | 434 } |
441 if (_isolate.rootLibrary != null) { | 435 if (_isolate.rootLibrary != null) { |
442 final rootLibrary = | 436 final rootLibrary = |
443 await _libraries.get(_isolate, _isolate.rootLibrary.id); | 437 await _libraries.get(_isolate, _isolate.rootLibrary.id); |
444 _rootScript = rootLibrary.rootScript; | 438 _rootScript = rootLibrary.rootScript; |
445 } | 439 } |
446 _r.dirty(); | 440 _r.dirty(); |
447 } | 441 } |
448 } | 442 } |
OLD | NEW |