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

Unified Diff: runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart

Issue 2273993002: Converted Observatory cpu-profile-table element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Addressed comments Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
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) {
« no previous file with comments | « runtime/observatory/lib/src/elements/cpu_profile.dart ('k') | runtime/observatory/lib/src/elements/cpu_profile_table.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698