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'; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 Stream<RenderedEvent<IsolateViewElement>> get onRendered => _r.onRendered; | 54 Stream<RenderedEvent<IsolateViewElement>> get onRendered => _r.onRendered; |
55 | 55 |
56 M.VM _vm; | 56 M.VM _vm; |
57 M.Isolate _isolate; | 57 M.Isolate _isolate; |
58 M.EventRepository _events; | 58 M.EventRepository _events; |
59 M.NotificationRepository _notifications; | 59 M.NotificationRepository _notifications; |
60 M.IsolateRepository _isolates; | 60 M.IsolateRepository _isolates; |
61 M.ScriptRepository _scripts; | 61 M.ScriptRepository _scripts; |
62 M.FunctionRepository _functions; | 62 M.FunctionRepository _functions; |
63 M.LibraryRepository _libraries; | 63 M.LibraryRepository _libraries; |
64 M.InstanceRepository _instances; | 64 M.ObjectRepository _objects; |
65 M.EvalRepository _eval; | 65 M.EvalRepository _eval; |
66 M.Function _function; | 66 M.Function _function; |
67 M.ScriptRef _rootScript; | 67 M.ScriptRef _rootScript; |
68 StreamSubscription _subscription; | 68 StreamSubscription _subscription; |
69 | 69 |
70 M.VMRef get vm => _vm; | 70 M.VMRef get vm => _vm; |
71 M.Isolate get isolate => _isolate; | 71 M.Isolate get isolate => _isolate; |
72 M.NotificationRepository get notifications => _notifications; | 72 M.NotificationRepository get notifications => _notifications; |
73 | 73 |
74 factory IsolateViewElement( | 74 factory IsolateViewElement( |
75 M.VM vm, | 75 M.VM vm, |
76 M.Isolate isolate, | 76 M.Isolate isolate, |
77 M.EventRepository events, | 77 M.EventRepository events, |
78 M.NotificationRepository notifications, | 78 M.NotificationRepository notifications, |
79 M.IsolateRepository isolates, | 79 M.IsolateRepository isolates, |
80 M.ScriptRepository scripts, | 80 M.ScriptRepository scripts, |
81 M.FunctionRepository functions, | 81 M.FunctionRepository functions, |
82 M.LibraryRepository libraries, | 82 M.LibraryRepository libraries, |
83 M.InstanceRepository instances, | 83 M.ObjectRepository objects, |
84 M.EvalRepository eval, | 84 M.EvalRepository eval, |
85 {RenderingQueue queue}) { | 85 {RenderingQueue queue}) { |
86 assert(vm != null); | 86 assert(vm != null); |
87 assert(isolate != null); | 87 assert(isolate != null); |
88 assert(events != null); | 88 assert(events != null); |
89 assert(notifications != null); | 89 assert(notifications != null); |
90 assert(isolates != null); | 90 assert(isolates != null); |
91 assert(scripts != null); | 91 assert(scripts != null); |
92 assert(functions != null); | 92 assert(functions != null); |
93 assert(instances != null); | 93 assert(objects != null); |
94 assert(eval != null); | 94 assert(eval != null); |
95 assert(libraries != null); | 95 assert(libraries != null); |
96 IsolateViewElement e = document.createElement(tag.name); | 96 IsolateViewElement e = document.createElement(tag.name); |
97 e._r = new RenderingScheduler(e, queue: queue); | 97 e._r = new RenderingScheduler(e, queue: queue); |
98 e._vm = vm; | 98 e._vm = vm; |
99 e._isolate = isolate; | 99 e._isolate = isolate; |
100 e._events = events; | 100 e._events = events; |
101 e._notifications = notifications; | 101 e._notifications = notifications; |
102 e._isolates = isolates; | 102 e._isolates = isolates; |
103 e._scripts = scripts; | 103 e._scripts = scripts; |
104 e._functions = functions; | 104 e._functions = functions; |
105 e._instances = instances; | 105 e._objects = objects; |
106 e._eval = eval; | 106 e._eval = eval; |
107 e._libraries = libraries; | 107 e._libraries = libraries; |
108 return e; | 108 return e; |
109 } | 109 } |
110 | 110 |
111 IsolateViewElement.created() : super.created(); | 111 IsolateViewElement.created() : super.created(); |
112 | 112 |
113 @override | 113 @override |
114 attached() { | 114 attached() { |
115 super.attached(); | 115 super.attached(); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 new AnchorElement(href: Uris.debugger(_isolate)) | 174 new AnchorElement(href: Uris.debugger(_isolate)) |
175 ..text = 'debug', | 175 ..text = 'debug', |
176 new SpanElement()..text = ']' | 176 new SpanElement()..text = ']' |
177 ] | 177 ] |
178 ], | 178 ], |
179 new DivElement() | 179 new DivElement() |
180 ..children = _function != null | 180 ..children = _function != null |
181 ? [ | 181 ? [ |
182 new BRElement(), | 182 new BRElement(), |
183 new SourceInsetElement(_isolate, _function.location, | 183 new SourceInsetElement(_isolate, _function.location, |
184 _scripts, _instances, _events, | 184 _scripts, _objects, _events, |
185 currentPos: | 185 currentPos: |
186 M.topFrame(isolate.pauseEvent).location.tokenPos, | 186 M.topFrame(isolate.pauseEvent).location.tokenPos, |
187 queue: _r.queue) | 187 queue: _r.queue) |
188 ..classes = ['header_inset'] | 188 ..classes = ['header_inset'] |
189 ] | 189 ] |
190 : const [], | 190 : const [], |
191 new HRElement(), | 191 new HRElement(), |
192 new IsolateSharedSummaryElement(_isolate, _events, queue: _r.queue), | 192 new IsolateSharedSummaryElement(_isolate, _events, queue: _r.queue), |
193 new HRElement(), | 193 new HRElement(), |
194 new DivElement() | 194 new DivElement() |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 ..text = 'threads (${threads.length})', | 339 ..text = 'threads (${threads.length})', |
340 new DivElement() | 340 new DivElement() |
341 ..classes = ['memberValue'] | 341 ..classes = ['memberValue'] |
342 ..children = [ | 342 ..children = [ |
343 new CurlyBlockElement(queue: _r.queue) | 343 new CurlyBlockElement(queue: _r.queue) |
344 ..content = threads.map(_populateThreadInfo) | 344 ..content = threads.map(_populateThreadInfo) |
345 ] | 345 ] |
346 ] | 346 ] |
347 ], | 347 ], |
348 new HRElement(), | 348 new HRElement(), |
349 new EvalBoxElement(_isolate, _isolate.rootLibrary, _instances, _eval, | 349 new EvalBoxElement(_isolate, _isolate.rootLibrary, _objects, _eval, |
350 queue: _r.queue), | 350 queue: _r.queue), |
351 new DivElement() | 351 new DivElement() |
352 ..children = _rootScript != null | 352 ..children = _rootScript != null |
353 ? [ | 353 ? [ |
354 new HRElement(), | 354 new HRElement(), |
355 new ScriptInsetElement( | 355 new ScriptInsetElement( |
356 _isolate, _rootScript, _scripts, _instances, _events, | 356 _isolate, _rootScript, _scripts, _objects, _events, |
357 queue: _r.queue) | 357 queue: _r.queue) |
358 ] | 358 ] |
359 : const [], | 359 : const [], |
360 new HRElement(), | 360 new HRElement(), |
361 new ViewFooterElement(queue: _r.queue) | 361 new ViewFooterElement(queue: _r.queue) |
362 ] | 362 ] |
363 ]; | 363 ]; |
364 } | 364 } |
365 | 365 |
366 DivElement _populateThreadInfo(M.Thread t) { | 366 DivElement _populateThreadInfo(M.Thread t) { |
(...skipping 29 matching lines...) Expand all Loading... |
396 _function = await _functions.get(_isolate, frame.function.id); | 396 _function = await _functions.get(_isolate, frame.function.id); |
397 } | 397 } |
398 if (_isolate.rootLibrary != null) { | 398 if (_isolate.rootLibrary != null) { |
399 final rootLibrary = | 399 final rootLibrary = |
400 await _libraries.get(_isolate, _isolate.rootLibrary.id); | 400 await _libraries.get(_isolate, _isolate.rootLibrary.id); |
401 _rootScript = rootLibrary.rootScript; | 401 _rootScript = rootLibrary.rootScript; |
402 } | 402 } |
403 _r.dirty(); | 403 _r.dirty(); |
404 } | 404 } |
405 } | 405 } |
OLD | NEW |