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 cpu_profile_element; | 5 library cpu_profile_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/cpu_profile/virtual_tree.dart'; | 10 import 'package:observatory/src/elements/cpu_profile/virtual_tree.dart'; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 new NavRefreshElement(queue: _r.queue)..onRefresh.listen(_refresh), | 103 new NavRefreshElement(queue: _r.queue)..onRefresh.listen(_refresh), |
104 new NavRefreshElement(label: 'Clear', queue: _r.queue) | 104 new NavRefreshElement(label: 'Clear', queue: _r.queue) |
105 ..onRefresh.listen(_clearCpuProfile), | 105 ..onRefresh.listen(_clearCpuProfile), |
106 new NavNotifyElement(_notifications, queue: _r.queue) | 106 new NavNotifyElement(_notifications, queue: _r.queue) |
107 ]), | 107 ]), |
108 ]; | 108 ]; |
109 if (_progress == null) { | 109 if (_progress == null) { |
110 children = content; | 110 children = content; |
111 return; | 111 return; |
112 } | 112 } |
113 content.add(new SampleBufferControlElement(_vm, _progress, _progressStream, | 113 content.add(new SampleBufferControlElement(_progress, _progressStream, |
114 selectedTag: _tag, queue: _r.queue) | 114 selectedTag: _tag, queue: _r.queue) |
115 ..onTagChange.listen((e) { | 115 ..onTagChange.listen((e) { |
116 _tag = e.element.selectedTag; | 116 _tag = e.element.selectedTag; |
117 _request(forceFetch: true); | 117 _request(); |
118 })); | 118 })); |
119 if (_progress.status == M.SampleProfileLoadingStatus.loaded) { | 119 if (_progress.status == M.SampleProfileLoadingStatus.loaded) { |
120 CpuProfileVirtualTreeElement tree; | 120 CpuProfileVirtualTreeElement tree; |
121 content.addAll([ | 121 content.addAll([ |
122 new BRElement(), | 122 new BRElement(), |
123 new StackTraceTreeConfigElement( | 123 new StackTraceTreeConfigElement( |
124 mode: _mode, | 124 mode: _mode, |
125 direction: _direction, | 125 direction: _direction, |
126 filter: _filter, | 126 filter: _filter, |
127 queue: _r.queue) | 127 queue: _r.queue) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 await _request(clear: true); | 167 await _request(clear: true); |
168 e.element.disabled = false; | 168 e.element.disabled = false; |
169 } | 169 } |
170 | 170 |
171 Future _refresh(e) async { | 171 Future _refresh(e) async { |
172 e.element.disabled = true; | 172 e.element.disabled = true; |
173 await _request(forceFetch: true); | 173 await _request(forceFetch: true); |
174 e.element.disabled = false; | 174 e.element.disabled = false; |
175 } | 175 } |
176 } | 176 } |
OLD | NEW |