| Index: runtime/observatory/lib/src/elements/cpu_profile.dart
|
| diff --git a/runtime/observatory/lib/src/elements/cpu_profile.dart b/runtime/observatory/lib/src/elements/cpu_profile.dart
|
| index 606c81743d126c70ec7dd8886d9213cee5a3407c..68fba8acb83baf3b39db015e4a10e141f13ebe24 100644
|
| --- a/runtime/observatory/lib/src/elements/cpu_profile.dart
|
| +++ b/runtime/observatory/lib/src/elements/cpu_profile.dart
|
| @@ -21,18 +21,18 @@ import 'package:observatory/src/elements/nav/vm_menu.dart';
|
| import 'package:observatory/src/elements/sample_buffer_control.dart';
|
| import 'package:observatory/src/elements/stack_trace_tree_config.dart';
|
|
|
| -class CpuProfileElement extends HtmlElement implements Renderable {
|
| - static const tag = const Tag<CpuProfileElement>('cpu-profile',
|
| - dependencies: const [
|
| - NavTopMenuElement.tag,
|
| - NavVMMenuElement.tag,
|
| - NavIsolateMenuElement.tag,
|
| - NavRefreshElement.tag,
|
| - NavNotifyElement.tag,
|
| - SampleBufferControlElement.tag,
|
| - StackTraceTreeConfigElement.tag,
|
| - CpuProfileVirtualTreeElement.tag,
|
| - ]);
|
| +class CpuProfileElement extends HtmlElement implements Renderable {
|
| + static const tag =
|
| + const Tag<CpuProfileElement>('cpu-profile', dependencies: const [
|
| + NavTopMenuElement.tag,
|
| + NavVMMenuElement.tag,
|
| + NavIsolateMenuElement.tag,
|
| + NavRefreshElement.tag,
|
| + NavNotifyElement.tag,
|
| + SampleBufferControlElement.tag,
|
| + StackTraceTreeConfigElement.tag,
|
| + CpuProfileVirtualTreeElement.tag,
|
| + ]);
|
|
|
| RenderingScheduler<CpuProfileElement> _r;
|
|
|
| @@ -50,17 +50,18 @@ class CpuProfileElement extends HtmlElement implements Renderable {
|
| M.ProfileTreeDirection _direction = M.ProfileTreeDirection.exclusive;
|
| String _filter = '';
|
|
|
| -
|
| M.IsolateRef get isolate => _isolate;
|
| M.NotificationRepository get notifications => _notifications;
|
| M.IsolateSampleProfileRepository get profiles => _profiles;
|
| M.VMRef get vm => _vm;
|
|
|
| - factory CpuProfileElement(M.VM vm, M.IsolateRef isolate,
|
| - M.EventRepository events,
|
| - M.NotificationRepository notifications,
|
| - M.IsolateSampleProfileRepository profiles,
|
| - {RenderingQueue queue}) {
|
| + factory CpuProfileElement(
|
| + M.VM vm,
|
| + M.IsolateRef isolate,
|
| + M.EventRepository events,
|
| + M.NotificationRepository notifications,
|
| + M.IsolateSampleProfileRepository profiles,
|
| + {RenderingQueue queue}) {
|
| assert(vm != null);
|
| assert(isolate != null);
|
| assert(events != null);
|
| @@ -99,10 +100,9 @@ class CpuProfileElement extends HtmlElement implements Renderable {
|
| new NavVMMenuElement(_vm, _events, queue: _r.queue),
|
| new NavIsolateMenuElement(_isolate, _events, queue: _r.queue),
|
| navMenu('cpu profile', link: Uris.cpuProfiler(_isolate)),
|
| - new NavRefreshElement(queue: _r.queue)
|
| - ..onRefresh.listen(_refresh),
|
| + new NavRefreshElement(queue: _r.queue)..onRefresh.listen(_refresh),
|
| new NavRefreshElement(label: 'Clear', queue: _r.queue)
|
| - ..onRefresh.listen(_clearCpuProfile),
|
| + ..onRefresh.listen(_clearCpuProfile),
|
| new NavNotifyElement(_notifications, queue: _r.queue)
|
| ]),
|
| ];
|
| @@ -111,29 +111,36 @@ class CpuProfileElement extends HtmlElement implements Renderable {
|
| return;
|
| }
|
| content.add(new SampleBufferControlElement(_progress, _progressStream,
|
| - selectedTag: _tag, queue: _r.queue)
|
| + selectedTag: _tag, queue: _r.queue)
|
| ..onTagChange.listen((e) {
|
| _tag = e.element.selectedTag;
|
| _request();
|
| - }));
|
| + }));
|
| if (_progress.status == M.SampleProfileLoadingStatus.loaded) {
|
| CpuProfileVirtualTreeElement tree;
|
| content.addAll([
|
| new BRElement(),
|
| - new StackTraceTreeConfigElement(mode: _mode, direction: _direction,
|
| - filter: _filter, queue: _r.queue)
|
| - ..onModeChange.listen((e) {
|
| - _mode = tree.mode = e.element.mode;
|
| - })
|
| - ..onFilterChange.listen((e) {
|
| - _filter = e.element.filter.trim();
|
| - tree.filters = _filter.isNotEmpty
|
| - ? [(node) { return node.name.contains(_filter); }]
|
| + new StackTraceTreeConfigElement(
|
| + mode: _mode,
|
| + direction: _direction,
|
| + filter: _filter,
|
| + queue: _r.queue)
|
| + ..onModeChange.listen((e) {
|
| + _mode = tree.mode = e.element.mode;
|
| + })
|
| + ..onFilterChange.listen((e) {
|
| + _filter = e.element.filter.trim();
|
| + tree.filters = _filter.isNotEmpty
|
| + ? [
|
| + (node) {
|
| + return node.name.contains(_filter);
|
| + }
|
| + ]
|
| : const [];
|
| - })
|
| - ..onDirectionChange.listen((e) {
|
| - _direction = tree.direction = e.element.direction;
|
| - }),
|
| + })
|
| + ..onDirectionChange.listen((e) {
|
| + _direction = tree.direction = e.element.direction;
|
| + }),
|
| new BRElement(),
|
| tree = new CpuProfileVirtualTreeElement(_isolate, _progress.profile,
|
| queue: _r.queue)
|
| @@ -144,8 +151,8 @@ class CpuProfileElement extends HtmlElement implements Renderable {
|
|
|
| Future _request({bool clear: false, bool forceFetch: false}) async {
|
| _progress = null;
|
| - _progressStream = _profiles.get(isolate, _tag, clear: clear,
|
| - forceFetch: forceFetch);
|
| + _progressStream =
|
| + _profiles.get(isolate, _tag, clear: clear, forceFetch: forceFetch);
|
| _r.dirty();
|
| _progress = (await _progressStream.first).progress;
|
| _r.dirty();
|
|
|