| 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 native_memory_profile; | 5 library native_memory_profile; |
| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 new NavVMMenuElement(_vm, _events, queue: _r.queue), | 94 new NavVMMenuElement(_vm, _events, queue: _r.queue), |
| 95 navMenu('native memory profile', link: Uris.nativeMemory()), | 95 navMenu('native memory profile', link: Uris.nativeMemory()), |
| 96 new NavRefreshElement(queue: _r.queue)..onRefresh.listen(_refresh), | 96 new NavRefreshElement(queue: _r.queue)..onRefresh.listen(_refresh), |
| 97 new NavNotifyElement(_notifications, queue: _r.queue) | 97 new NavNotifyElement(_notifications, queue: _r.queue) |
| 98 ]), | 98 ]), |
| 99 ]; | 99 ]; |
| 100 if (_progress == null) { | 100 if (_progress == null) { |
| 101 children = content; | 101 children = content; |
| 102 return; | 102 return; |
| 103 } | 103 } |
| 104 content.add(new SampleBufferControlElement(_progress, _progressStream, | 104 content.add(new SampleBufferControlElement(_vm, _progress, _progressStream, |
| 105 selectedTag: _tag, queue: _r.queue) | 105 selectedTag: _tag, queue: _r.queue) |
| 106 ..onTagChange.listen((e) { | 106 ..onTagChange.listen((e) { |
| 107 _tag = e.element.selectedTag; | 107 _tag = e.element.selectedTag; |
| 108 _request(); | 108 _request(forceFetch: true); |
| 109 })); | 109 })); |
| 110 if (_progress.status == M.SampleProfileLoadingStatus.loaded) { | 110 if (_progress.status == M.SampleProfileLoadingStatus.loaded) { |
| 111 CpuProfileVirtualTreeElement tree; | 111 CpuProfileVirtualTreeElement tree; |
| 112 content.addAll([ | 112 content.addAll([ |
| 113 new BRElement(), | 113 new BRElement(), |
| 114 new StackTraceTreeConfigElement( | 114 new StackTraceTreeConfigElement( |
| 115 mode: _mode, | 115 mode: _mode, |
| 116 direction: _direction, | 116 direction: _direction, |
| 117 filter: _filter, | 117 filter: _filter, |
| 118 queue: _r.queue) | 118 queue: _r.queue) |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 _r.dirty(); | 154 _r.dirty(); |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 | 157 |
| 158 Future _refresh(e) async { | 158 Future _refresh(e) async { |
| 159 e.element.disabled = true; | 159 e.element.disabled = true; |
| 160 await _request(forceFetch: true); | 160 await _request(forceFetch: true); |
| 161 e.element.disabled = false; | 161 e.element.disabled = false; |
| 162 } | 162 } |
| 163 } | 163 } |
| OLD | NEW |