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 function_view_element; | 5 library function_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/class_ref.dart'; | 10 import 'package:observatory/src/elements/class_ref.dart'; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 M.NotificationRepository _notifications; | 60 M.NotificationRepository _notifications; |
61 M.Function _function; | 61 M.Function _function; |
62 M.LibraryRef _library; | 62 M.LibraryRef _library; |
63 M.FunctionRepository _functions; | 63 M.FunctionRepository _functions; |
64 M.ClassRepository _classes; | 64 M.ClassRepository _classes; |
65 M.RetainedSizeRepository _retainedSizes; | 65 M.RetainedSizeRepository _retainedSizes; |
66 M.ReachableSizeRepository _reachableSizes; | 66 M.ReachableSizeRepository _reachableSizes; |
67 M.InboundReferencesRepository _references; | 67 M.InboundReferencesRepository _references; |
68 M.RetainingPathRepository _retainingPaths; | 68 M.RetainingPathRepository _retainingPaths; |
69 M.ScriptRepository _scripts; | 69 M.ScriptRepository _scripts; |
70 M.InstanceRepository _instances; | 70 M.ObjectRepository _objects; |
71 | 71 |
72 M.VMRef get vm => _vm; | 72 M.VMRef get vm => _vm; |
73 M.IsolateRef get isolate => _isolate; | 73 M.IsolateRef get isolate => _isolate; |
74 M.NotificationRepository get notifications => _notifications; | 74 M.NotificationRepository get notifications => _notifications; |
75 M.Function get function => _function; | 75 M.Function get function => _function; |
76 | 76 |
77 factory FunctionViewElement( | 77 factory FunctionViewElement( |
78 M.VM vm, | 78 M.VM vm, |
79 M.IsolateRef isolate, | 79 M.IsolateRef isolate, |
80 M.Function function, | 80 M.Function function, |
81 M.EventRepository events, | 81 M.EventRepository events, |
82 M.NotificationRepository notifications, | 82 M.NotificationRepository notifications, |
83 M.FunctionRepository functions, | 83 M.FunctionRepository functions, |
84 M.ClassRepository classes, | 84 M.ClassRepository classes, |
85 M.RetainedSizeRepository retainedSizes, | 85 M.RetainedSizeRepository retainedSizes, |
86 M.ReachableSizeRepository reachableSizes, | 86 M.ReachableSizeRepository reachableSizes, |
87 M.InboundReferencesRepository references, | 87 M.InboundReferencesRepository references, |
88 M.RetainingPathRepository retainingPaths, | 88 M.RetainingPathRepository retainingPaths, |
89 M.ScriptRepository scripts, | 89 M.ScriptRepository scripts, |
90 M.InstanceRepository instances, | 90 M.ObjectRepository objects, |
91 {RenderingQueue queue}) { | 91 {RenderingQueue queue}) { |
92 assert(vm != null); | 92 assert(vm != null); |
93 assert(isolate != null); | 93 assert(isolate != null); |
94 assert(events != null); | 94 assert(events != null); |
95 assert(notifications != null); | 95 assert(notifications != null); |
96 assert(function != null); | 96 assert(function != null); |
97 assert(functions != null); | 97 assert(functions != null); |
98 assert(classes != null); | 98 assert(classes != null); |
99 assert(retainedSizes != null); | 99 assert(retainedSizes != null); |
100 assert(reachableSizes != null); | 100 assert(reachableSizes != null); |
101 assert(references != null); | 101 assert(references != null); |
102 assert(retainingPaths != null); | 102 assert(retainingPaths != null); |
103 assert(scripts != null); | 103 assert(scripts != null); |
104 assert(instances != null); | 104 assert(objects != null); |
105 FunctionViewElement e = document.createElement(tag.name); | 105 FunctionViewElement e = document.createElement(tag.name); |
106 e._r = new RenderingScheduler(e, queue: queue); | 106 e._r = new RenderingScheduler(e, queue: queue); |
107 e._vm = vm; | 107 e._vm = vm; |
108 e._isolate = isolate; | 108 e._isolate = isolate; |
109 e._events = events; | 109 e._events = events; |
110 e._notifications = notifications; | 110 e._notifications = notifications; |
111 e._function = function; | 111 e._function = function; |
112 e._functions = functions; | 112 e._functions = functions; |
113 e._classes = classes; | 113 e._classes = classes; |
114 e._retainedSizes = retainedSizes; | 114 e._retainedSizes = retainedSizes; |
115 e._reachableSizes = reachableSizes; | 115 e._reachableSizes = reachableSizes; |
116 e._references = references; | 116 e._references = references; |
117 e._retainingPaths = retainingPaths; | 117 e._retainingPaths = retainingPaths; |
118 e._scripts = scripts; | 118 e._scripts = scripts; |
119 e._instances = instances; | 119 e._objects = objects; |
120 if (function.dartOwner is M.LibraryRef) { | 120 if (function.dartOwner is M.LibraryRef) { |
121 e._library = function.dartOwner; | 121 e._library = function.dartOwner; |
122 } | 122 } |
123 return e; | 123 return e; |
124 } | 124 } |
125 | 125 |
126 FunctionViewElement.created() : super.created(); | 126 FunctionViewElement.created() : super.created(); |
127 | 127 |
128 @override | 128 @override |
129 attached() { | 129 attached() { |
(...skipping 11 matching lines...) Expand all Loading... |
141 | 141 |
142 void render() { | 142 void render() { |
143 children = [ | 143 children = [ |
144 navBar(_createMenu()), | 144 navBar(_createMenu()), |
145 new DivElement() | 145 new DivElement() |
146 ..classes = ['content-centered-big'] | 146 ..classes = ['content-centered-big'] |
147 ..children = [ | 147 ..children = [ |
148 new HeadingElement.h2()..text = 'Function ${_function.name}', | 148 new HeadingElement.h2()..text = 'Function ${_function.name}', |
149 new HRElement(), | 149 new HRElement(), |
150 new ObjectCommonElement(_isolate, _function, _retainedSizes, | 150 new ObjectCommonElement(_isolate, _function, _retainedSizes, |
151 _reachableSizes, _references, _retainingPaths, _instances, | 151 _reachableSizes, _references, _retainingPaths, _objects, |
152 queue: _r.queue), | 152 queue: _r.queue), |
153 new BRElement(), | 153 new BRElement(), |
154 new DivElement() | 154 new DivElement() |
155 ..classes = ['memberList'] | 155 ..classes = ['memberList'] |
156 ..children = _createMembers(), | 156 ..children = _createMembers(), |
157 new HRElement(), | 157 new HRElement(), |
158 new DivElement() | 158 new DivElement() |
159 ..children = _function.location == null | 159 ..children = _function.location == null |
160 ? const [] | 160 ? const [] |
161 : [ | 161 : [ |
162 new SourceInsetElement(_isolate, _function.location, | 162 new SourceInsetElement(_isolate, _function.location, |
163 _scripts, _instances, _events, | 163 _scripts, _objects, _events, |
164 queue: _r.queue) | 164 queue: _r.queue) |
165 ], | 165 ], |
166 new ViewFooterElement(queue: _r.queue) | 166 new ViewFooterElement(queue: _r.queue) |
167 ] | 167 ] |
168 ]; | 168 ]; |
169 } | 169 } |
170 | 170 |
171 List<Element> _createMenu() { | 171 List<Element> _createMenu() { |
172 final menu = [ | 172 final menu = [ |
173 new NavTopMenuElement(queue: _r.queue), | 173 new NavTopMenuElement(queue: _r.queue), |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 ..classes = ['memberItem'] | 214 ..classes = ['memberItem'] |
215 ..children = [ | 215 ..children = [ |
216 new DivElement() | 216 new DivElement() |
217 ..classes = ['memberName'] | 217 ..classes = ['memberName'] |
218 ..text = 'owner', | 218 ..text = 'owner', |
219 new DivElement() | 219 new DivElement() |
220 ..classes = ['memberName'] | 220 ..classes = ['memberName'] |
221 ..children = [ | 221 ..children = [ |
222 _function.dartOwner == null | 222 _function.dartOwner == null |
223 ? (new SpanElement()..text = '...') | 223 ? (new SpanElement()..text = '...') |
224 : anyRef(_isolate, _function.dartOwner, _instances, | 224 : anyRef(_isolate, _function.dartOwner, _objects, |
225 queue: _r.queue) | 225 queue: _r.queue) |
226 ] | 226 ] |
227 ] | 227 ] |
228 ]; | 228 ]; |
229 if (_function.field != null) { | 229 if (_function.field != null) { |
230 members.add(new DivElement() | 230 members.add(new DivElement() |
231 ..classes = ['memberItem'] | 231 ..classes = ['memberItem'] |
232 ..children = [ | 232 ..children = [ |
233 new DivElement() | 233 new DivElement() |
234 ..classes = ['memberName'] | 234 ..classes = ['memberName'] |
235 ..text = 'script', | 235 ..text = 'script', |
236 new DivElement() | 236 new DivElement() |
237 ..classes = ['memberName'] | 237 ..classes = ['memberName'] |
238 ..children = [ | 238 ..children = [ |
239 new FieldRefElement(_isolate, _function.field, _instances, | 239 new FieldRefElement(_isolate, _function.field, _objects, |
240 queue: _r.queue) | 240 queue: _r.queue) |
241 ] | 241 ] |
242 ]); | 242 ]); |
243 } | 243 } |
244 members.add(new DivElement() | 244 members.add(new DivElement() |
245 ..classes = ['memberItem'] | 245 ..classes = ['memberItem'] |
246 ..children = [ | 246 ..children = [ |
247 new DivElement() | 247 new DivElement() |
248 ..classes = ['memberName'] | 248 ..classes = ['memberName'] |
249 ..text = 'script', | 249 ..text = 'script', |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 if (_function.icDataArray != null) { | 295 if (_function.icDataArray != null) { |
296 members.add(new DivElement() | 296 members.add(new DivElement() |
297 ..classes = ['memberItem'] | 297 ..classes = ['memberItem'] |
298 ..children = [ | 298 ..children = [ |
299 new DivElement() | 299 new DivElement() |
300 ..classes = ['memberName'] | 300 ..classes = ['memberName'] |
301 ..text = 'ic data array', | 301 ..text = 'ic data array', |
302 new DivElement() | 302 new DivElement() |
303 ..classes = ['memberName'] | 303 ..classes = ['memberName'] |
304 ..children = [ | 304 ..children = [ |
305 new InstanceRefElement( | 305 new InstanceRefElement(_isolate, _function.icDataArray, _objects, |
306 _isolate, _function.icDataArray, _instances, | |
307 queue: _r.queue) | 306 queue: _r.queue) |
308 ] | 307 ] |
309 ]); | 308 ]); |
310 } | 309 } |
311 | 310 |
312 members.addAll([ | 311 members.addAll([ |
313 new DivElement() | 312 new DivElement() |
314 ..classes = ['memberItem'] | 313 ..classes = ['memberItem'] |
315 ..children = [ | 314 ..children = [ |
316 new DivElement() | 315 new DivElement() |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 case M.FunctionKind.stub: | 428 case M.FunctionKind.stub: |
430 return 'stub'; | 429 return 'stub'; |
431 case M.FunctionKind.tag: | 430 case M.FunctionKind.tag: |
432 return 'tag'; | 431 return 'tag'; |
433 case M.FunctionKind.signatureFunction: | 432 case M.FunctionKind.signatureFunction: |
434 return 'signature function'; | 433 return 'signature function'; |
435 } | 434 } |
436 throw new Exception('Unknown Functionkind ($kind)'); | 435 throw new Exception('Unknown Functionkind ($kind)'); |
437 } | 436 } |
438 } | 437 } |
OLD | NEW |