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