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 isolate_view_element; | 5 library isolate_view_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/curly_block.dart'; | 10 import 'package:observatory/src/elements/curly_block.dart'; |
11 import 'package:observatory/src/elements/eval_box.dart'; | 11 import 'package:observatory/src/elements/eval_box.dart'; |
12 import 'package:observatory/src/elements/function_ref.dart'; | 12 import 'package:observatory/src/elements/function_ref.dart'; |
13 import 'package:observatory/src/elements/helpers/nav_bar.dart'; | 13 import 'package:observatory/src/elements/helpers/nav_bar.dart'; |
14 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 14 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
15 import 'package:observatory/src/elements/helpers/tag.dart'; | 15 import 'package:observatory/src/elements/helpers/tag.dart'; |
16 import 'package:observatory/src/elements/helpers/uris.dart'; | 16 import 'package:observatory/src/elements/helpers/uris.dart'; |
17 import 'package:observatory/src/elements/isolate/location.dart'; | 17 import 'package:observatory/src/elements/isolate/location.dart'; |
18 import 'package:observatory/src/elements/isolate/run_state.dart'; | 18 import 'package:observatory/src/elements/isolate/run_state.dart'; |
19 import 'package:observatory/src/elements/isolate/shared_summary.dart'; | 19 import 'package:observatory/src/elements/isolate/shared_summary.dart'; |
20 import 'package:observatory/src/elements/library_ref.dart'; | 20 import 'package:observatory/src/elements/library_ref.dart'; |
21 import 'package:observatory/src/elements/nav/class_menu.dart'; | 21 import 'package:observatory/src/elements/nav/class_menu.dart'; |
22 import 'package:observatory/src/elements/nav/isolate_menu.dart'; | 22 import 'package:observatory/src/elements/nav/isolate_menu.dart'; |
23 import 'package:observatory/src/elements/nav/notify.dart'; | 23 import 'package:observatory/src/elements/nav/notify.dart'; |
24 import 'package:observatory/src/elements/nav/refresh.dart'; | 24 import 'package:observatory/src/elements/nav/refresh.dart'; |
| 25 import 'package:observatory/src/elements/nav/reload.dart'; |
25 import 'package:observatory/src/elements/nav/top_menu.dart'; | 26 import 'package:observatory/src/elements/nav/top_menu.dart'; |
26 import 'package:observatory/src/elements/nav/vm_menu.dart'; | 27 import 'package:observatory/src/elements/nav/vm_menu.dart'; |
27 import 'package:observatory/src/elements/script_inset.dart'; | 28 import 'package:observatory/src/elements/script_inset.dart'; |
28 import 'package:observatory/src/elements/source_inset.dart'; | 29 import 'package:observatory/src/elements/source_inset.dart'; |
29 import 'package:observatory/src/elements/view_footer.dart'; | 30 import 'package:observatory/src/elements/view_footer.dart'; |
30 import 'package:observatory/utils.dart'; | 31 import 'package:observatory/utils.dart'; |
31 | 32 |
32 class IsolateViewElement extends HtmlElement implements Renderable { | 33 class IsolateViewElement extends HtmlElement implements Renderable { |
33 static const tag = | 34 static const tag = |
34 const Tag<IsolateViewElement>('isolate-view', dependencies: const [ | 35 const Tag<IsolateViewElement>('isolate-view', dependencies: const [ |
35 CurlyBlockElement.tag, | 36 CurlyBlockElement.tag, |
36 EvalBoxElement.tag, | 37 EvalBoxElement.tag, |
37 FunctionRefElement.tag, | 38 FunctionRefElement.tag, |
38 IsolateLocationElement.tag, | 39 IsolateLocationElement.tag, |
39 IsolateRunStateElement.tag, | 40 IsolateRunStateElement.tag, |
40 IsolateSharedSummaryElement.tag, | 41 IsolateSharedSummaryElement.tag, |
41 LibraryRefElement.tag, | 42 LibraryRefElement.tag, |
42 NavClassMenuElement.tag, | 43 NavClassMenuElement.tag, |
43 NavTopMenuElement.tag, | 44 NavTopMenuElement.tag, |
44 NavIsolateMenuElement.tag, | 45 NavIsolateMenuElement.tag, |
45 NavRefreshElement.tag, | 46 NavRefreshElement.tag, |
| 47 NavReloadElement.tag, |
46 NavNotifyElement.tag, | 48 NavNotifyElement.tag, |
47 ScriptInsetElement.tag, | 49 ScriptInsetElement.tag, |
48 SourceInsetElement.tag, | 50 SourceInsetElement.tag, |
49 ViewFooterElement.tag | 51 ViewFooterElement.tag |
50 ]); | 52 ]); |
51 | 53 |
52 RenderingScheduler<IsolateViewElement> _r; | 54 RenderingScheduler<IsolateViewElement> _r; |
53 | 55 |
54 Stream<RenderedEvent<IsolateViewElement>> get onRendered => _r.onRendered; | 56 Stream<RenderedEvent<IsolateViewElement>> get onRendered => _r.onRendered; |
55 | 57 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 135 |
134 void render() { | 136 void render() { |
135 final uptime = new DateTime.now().difference(_isolate.startTime); | 137 final uptime = new DateTime.now().difference(_isolate.startTime); |
136 final libraries = _isolate.libraries.toList(); | 138 final libraries = _isolate.libraries.toList(); |
137 final List<M.Thread> threads = _isolate.threads; | 139 final List<M.Thread> threads = _isolate.threads; |
138 children = [ | 140 children = [ |
139 navBar([ | 141 navBar([ |
140 new NavTopMenuElement(queue: _r.queue), | 142 new NavTopMenuElement(queue: _r.queue), |
141 new NavVMMenuElement(_vm, _events, queue: _r.queue), | 143 new NavVMMenuElement(_vm, _events, queue: _r.queue), |
142 new NavIsolateMenuElement(_isolate, _events, queue: _r.queue), | 144 new NavIsolateMenuElement(_isolate, _events, queue: _r.queue), |
143 new NavRefreshElement(label: 'Reload Source', queue: _r.queue) | 145 new NavReloadElement(_isolate, _isolates, _events, queue: _r.queue) |
144 ..onRefresh.listen((e) async { | 146 ..onReload.listen((_) async { |
145 e.element.disabled = true; | 147 _isolate = await _isolates.get(_isolate); |
146 await _isolates.reloadSources(_isolate); | 148 await _loadExtraData(); |
147 _r.dirty(); | 149 _r.dirty(); |
148 }), | 150 }), |
149 new NavRefreshElement(queue: _r.queue) | 151 new NavRefreshElement(queue: _r.queue) |
150 ..onRefresh.listen((e) async { | 152 ..onRefresh.listen((e) async { |
151 e.element.disabled = true; | 153 e.element.disabled = true; |
152 _isolate = await _isolates.get(_isolate); | 154 _isolate = await _isolates.get(_isolate); |
153 await _loadExtraData(); | 155 await _loadExtraData(); |
154 _r.dirty(); | 156 _r.dirty(); |
155 }), | 157 }), |
156 new NavNotifyElement(_notifications, queue: _r.queue) | 158 new NavNotifyElement(_notifications, queue: _r.queue) |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 _function = await _functions.get(_isolate, frame.function.id); | 397 _function = await _functions.get(_isolate, frame.function.id); |
396 } | 398 } |
397 if (_isolate.rootLibrary != null) { | 399 if (_isolate.rootLibrary != null) { |
398 final rootLibrary = | 400 final rootLibrary = |
399 await _libraries.get(_isolate, _isolate.rootLibrary.id); | 401 await _libraries.get(_isolate, _isolate.rootLibrary.id); |
400 _rootScript = rootLibrary.rootScript; | 402 _rootScript = rootLibrary.rootScript; |
401 } | 403 } |
402 _r.dirty(); | 404 _r.dirty(); |
403 } | 405 } |
404 } | 406 } |
OLD | NEW |