OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:html'; | 5 import 'dart:html'; |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 import 'package:observatory/models.dart' as M; | 7 import 'package:observatory/models.dart' as M; |
8 import 'package:observatory/src/elements/cpu_profile/virtual_tree.dart'; | 8 import 'package:observatory/src/elements/cpu_profile/virtual_tree.dart'; |
9 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 9 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
10 import 'package:observatory/src/elements/helpers/tag.dart'; | 10 import 'package:observatory/src/elements/helpers/tag.dart'; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 children = []; | 66 children = []; |
67 _r.disable(notify: true); | 67 _r.disable(notify: true); |
68 } | 68 } |
69 | 69 |
70 void render() { | 70 void render() { |
71 if (_progress == null) { | 71 if (_progress == null) { |
72 children = const []; | 72 children = const []; |
73 return; | 73 return; |
74 } | 74 } |
75 final content = [ | 75 final content = [ |
76 new SampleBufferControlElement(isolate.vm, _progress, _progressStream, | 76 new SampleBufferControlElement(_progress, _progressStream, |
77 selectedTag: _tag, queue: _r.queue) | 77 selectedTag: _tag, queue: _r.queue) |
78 ..onTagChange.listen((e) { | 78 ..onTagChange.listen((e) { |
79 _tag = e.element.selectedTag; | 79 _tag = e.element.selectedTag; |
80 _request(forceFetch: true); | 80 _request(); |
81 }) | 81 }) |
82 ]; | 82 ]; |
83 if (_progress.status == M.SampleProfileLoadingStatus.loaded) { | 83 if (_progress.status == M.SampleProfileLoadingStatus.loaded) { |
84 CpuProfileVirtualTreeElement tree; | 84 CpuProfileVirtualTreeElement tree; |
85 content.addAll([ | 85 content.addAll([ |
86 new BRElement(), | 86 new BRElement(), |
87 new StackTraceTreeConfigElement( | 87 new StackTraceTreeConfigElement( |
88 mode: _mode, | 88 mode: _mode, |
89 direction: _direction, | 89 direction: _direction, |
90 showFilter: false, | 90 showFilter: false, |
(...skipping 17 matching lines...) Expand all Loading... |
108 _progressStream = _profiles.get(_isolate, _cls, _tag); | 108 _progressStream = _profiles.get(_isolate, _cls, _tag); |
109 _r.dirty(); | 109 _r.dirty(); |
110 _progress = (await _progressStream.first).progress; | 110 _progress = (await _progressStream.first).progress; |
111 _r.dirty(); | 111 _r.dirty(); |
112 if (M.isSampleProcessRunning(_progress.status)) { | 112 if (M.isSampleProcessRunning(_progress.status)) { |
113 _progress = (await _progressStream.last).progress; | 113 _progress = (await _progressStream.last).progress; |
114 _r.dirty(); | 114 _r.dirty(); |
115 } | 115 } |
116 } | 116 } |
117 } | 117 } |
OLD | NEW |