Index: runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart |
diff --git a/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart b/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart |
index 236b3952228b07075f5123fb116545c734754fcc..57c85a9aba6701717409444bba7200ae5309bc0e 100644 |
--- a/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart |
+++ b/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart |
@@ -31,19 +31,21 @@ class CpuProfileVirtualTreeElement extends HtmlElement implements Renderable { |
ProfileTreeMode _mode; |
M.IsolateRef _isolate; |
M.SampleProfile _profile; |
- M.CallTreeNodeFilter _filter; |
+ Iterable<M.CallTreeNodeFilter> _filters; |
M.ProfileTreeDirection get direction => _direction; |
ProfileTreeMode get mode => _mode; |
M.IsolateRef get isolate => _isolate; |
M.SampleProfile get profile => _profile; |
- M.CallTreeNodeFilter get filter => _filter; |
+ Iterable<M.CallTreeNodeFilter> get filters => _filters; |
set direction(M.ProfileTreeDirection value) => |
_direction = _r.checkAndReact(_direction, value); |
set mode(ProfileTreeMode value) => _mode = _r.checkAndReact(_mode, value); |
- set filter(M.CallTreeNodeFilter value) => |
- _filter = _r.checkAndReact(_filter, value); |
+ set filters(Iterable<M.CallTreeNodeFilter> value) { |
+ _filters = new List.unmodifiable(value); |
+ _r.dirty(); |
+ } |
factory CpuProfileVirtualTreeElement(M.IsolateRef isolate, |
M.SampleProfile profile, {ProfileTreeMode mode: ProfileTreeMode.function, |
@@ -94,15 +96,17 @@ class CpuProfileVirtualTreeElement extends HtmlElement implements Renderable { |
default: |
throw new Exception('Unknown ProfileTreeMode: $mode'); |
} |
+ if (filters != null) { |
+ tree = filters.fold(tree, (tree, filter) { |
+ return tree?.filtered(filter); |
+ }); |
+ } |
if (tree == null) { |
children = [ |
new HeadingElement.h1()..text = 'No Results' |
]; |
return; |
} |
- if (filter != null) { |
- tree = tree.filtered(filter); |
- } |
_tree = new VirtualTreeElement(_createRow, update, _getChildren, |
items: tree.root.children, queue: _r.queue); |
if (tree.root.children.length == 1) { |