| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:html'; | 6 import 'dart:html'; |
| 7 import 'package:observatory/models.dart' as M; | 7 import 'package:observatory/models.dart' as M; |
| 8 import 'package:observatory/src/elements/context_ref.dart'; | 8 import 'package:observatory/src/elements/context_ref.dart'; |
| 9 import 'package:observatory/src/elements/curly_block.dart'; | 9 import 'package:observatory/src/elements/curly_block.dart'; |
| 10 import 'package:observatory/src/elements/helpers/any_ref.dart'; | 10 import 'package:observatory/src/elements/helpers/any_ref.dart'; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 M.VM _vm; | 43 M.VM _vm; |
| 44 M.IsolateRef _isolate; | 44 M.IsolateRef _isolate; |
| 45 M.EventRepository _events; | 45 M.EventRepository _events; |
| 46 M.NotificationRepository _notifications; | 46 M.NotificationRepository _notifications; |
| 47 M.Context _context; | 47 M.Context _context; |
| 48 M.ContextRepository _contexts; | 48 M.ContextRepository _contexts; |
| 49 M.RetainedSizeRepository _retainedSizes; | 49 M.RetainedSizeRepository _retainedSizes; |
| 50 M.ReachableSizeRepository _reachableSizes; | 50 M.ReachableSizeRepository _reachableSizes; |
| 51 M.InboundReferencesRepository _references; | 51 M.InboundReferencesRepository _references; |
| 52 M.RetainingPathRepository _retainingPaths; | 52 M.RetainingPathRepository _retainingPaths; |
| 53 M.InstanceRepository _instances; | 53 M.ObjectRepository _objects; |
| 54 | 54 |
| 55 M.VMRef get vm => _vm; | 55 M.VMRef get vm => _vm; |
| 56 M.IsolateRef get isolate => _isolate; | 56 M.IsolateRef get isolate => _isolate; |
| 57 M.NotificationRepository get notifications => _notifications; | 57 M.NotificationRepository get notifications => _notifications; |
| 58 M.Context get context => _context; | 58 M.Context get context => _context; |
| 59 | 59 |
| 60 factory ContextViewElement( | 60 factory ContextViewElement( |
| 61 M.VM vm, | 61 M.VM vm, |
| 62 M.IsolateRef isolate, | 62 M.IsolateRef isolate, |
| 63 M.Context context, | 63 M.Context context, |
| 64 M.EventRepository events, | 64 M.EventRepository events, |
| 65 M.NotificationRepository notifications, | 65 M.NotificationRepository notifications, |
| 66 M.ContextRepository contexts, | 66 M.ContextRepository contexts, |
| 67 M.RetainedSizeRepository retainedSizes, | 67 M.RetainedSizeRepository retainedSizes, |
| 68 M.ReachableSizeRepository reachableSizes, | 68 M.ReachableSizeRepository reachableSizes, |
| 69 M.InboundReferencesRepository references, | 69 M.InboundReferencesRepository references, |
| 70 M.RetainingPathRepository retainingPaths, | 70 M.RetainingPathRepository retainingPaths, |
| 71 M.InstanceRepository instances, | 71 M.ObjectRepository objects, |
| 72 {RenderingQueue queue}) { | 72 {RenderingQueue queue}) { |
| 73 assert(vm != null); | 73 assert(vm != null); |
| 74 assert(isolate != null); | 74 assert(isolate != null); |
| 75 assert(events != null); | 75 assert(events != null); |
| 76 assert(notifications != null); | 76 assert(notifications != null); |
| 77 assert(context != null); | 77 assert(context != null); |
| 78 assert(contexts != null); | 78 assert(contexts != null); |
| 79 assert(retainedSizes != null); | 79 assert(retainedSizes != null); |
| 80 assert(reachableSizes != null); | 80 assert(reachableSizes != null); |
| 81 assert(references != null); | 81 assert(references != null); |
| 82 assert(retainingPaths != null); | 82 assert(retainingPaths != null); |
| 83 assert(instances != null); | 83 assert(objects != null); |
| 84 ContextViewElement e = document.createElement(tag.name); | 84 ContextViewElement e = document.createElement(tag.name); |
| 85 e._r = new RenderingScheduler(e, queue: queue); | 85 e._r = new RenderingScheduler(e, queue: queue); |
| 86 e._vm = vm; | 86 e._vm = vm; |
| 87 e._isolate = isolate; | 87 e._isolate = isolate; |
| 88 e._events = events; | 88 e._events = events; |
| 89 e._notifications = notifications; | 89 e._notifications = notifications; |
| 90 e._context = context; | 90 e._context = context; |
| 91 e._contexts = contexts; | 91 e._contexts = contexts; |
| 92 e._retainedSizes = retainedSizes; | 92 e._retainedSizes = retainedSizes; |
| 93 e._reachableSizes = reachableSizes; | 93 e._reachableSizes = reachableSizes; |
| 94 e._references = references; | 94 e._references = references; |
| 95 e._retainingPaths = retainingPaths; | 95 e._retainingPaths = retainingPaths; |
| 96 e._instances = instances; | 96 e._objects = objects; |
| 97 return e; | 97 return e; |
| 98 } | 98 } |
| 99 | 99 |
| 100 ContextViewElement.created() : super.created(); | 100 ContextViewElement.created() : super.created(); |
| 101 | 101 |
| 102 @override | 102 @override |
| 103 attached() { | 103 attached() { |
| 104 super.attached(); | 104 super.attached(); |
| 105 _r.enable(); | 105 _r.enable(); |
| 106 } | 106 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 127 _r.dirty(); | 127 _r.dirty(); |
| 128 }), | 128 }), |
| 129 new NavNotifyElement(_notifications, queue: _r.queue) | 129 new NavNotifyElement(_notifications, queue: _r.queue) |
| 130 ]), | 130 ]), |
| 131 new DivElement() | 131 new DivElement() |
| 132 ..classes = ['content-centered-big'] | 132 ..classes = ['content-centered-big'] |
| 133 ..children = [ | 133 ..children = [ |
| 134 new HeadingElement.h2()..text = 'Context', | 134 new HeadingElement.h2()..text = 'Context', |
| 135 new HRElement(), | 135 new HRElement(), |
| 136 new ObjectCommonElement(_isolate, _context, _retainedSizes, | 136 new ObjectCommonElement(_isolate, _context, _retainedSizes, |
| 137 _reachableSizes, _references, _retainingPaths, _instances, | 137 _reachableSizes, _references, _retainingPaths, _objects, |
| 138 queue: _r.queue) | 138 queue: _r.queue) |
| 139 ] | 139 ] |
| 140 ]; | 140 ]; |
| 141 if (_context.parentContext != null) { | 141 if (_context.parentContext != null) { |
| 142 content.addAll([ | 142 content.addAll([ |
| 143 new BRElement(), | 143 new BRElement(), |
| 144 new DivElement() | 144 new DivElement() |
| 145 ..classes = ['content-centered-big'] | 145 ..classes = ['content-centered-big'] |
| 146 ..children = [ | 146 ..children = [ |
| 147 new DivElement() | 147 new DivElement() |
| 148 ..classes = ['memberList'] | 148 ..classes = ['memberList'] |
| 149 ..children = [ | 149 ..children = [ |
| 150 new DivElement() | 150 new DivElement() |
| 151 ..classes = ['memberItem'] | 151 ..classes = ['memberItem'] |
| 152 ..children = [ | 152 ..children = [ |
| 153 new DivElement() | 153 new DivElement() |
| 154 ..classes = ['memberName'] | 154 ..classes = ['memberName'] |
| 155 ..text = 'parent context', | 155 ..text = 'parent context', |
| 156 new DivElement() | 156 new DivElement() |
| 157 ..classes = ['memberName'] | 157 ..classes = ['memberName'] |
| 158 ..children = [ | 158 ..children = [ |
| 159 new ContextRefElement(_isolate, _context.parentContext, | 159 new ContextRefElement( |
| 160 _isolate, _context.parentContext, _objects, |
| 160 queue: _r.queue) | 161 queue: _r.queue) |
| 161 ] | 162 ] |
| 162 ] | 163 ] |
| 163 ] | 164 ] |
| 164 ] | 165 ] |
| 165 ]); | 166 ]); |
| 166 } | 167 } |
| 167 content.add(new HRElement()); | 168 content.add(new HRElement()); |
| 168 if (_context.variables.isNotEmpty) { | 169 if (_context.variables.isNotEmpty) { |
| 169 int index = 0; | 170 int index = 0; |
| 170 content.addAll([ | 171 content.addAll([ |
| 171 new DivElement() | 172 new DivElement() |
| 172 ..classes = ['content-centered-big'] | 173 ..classes = ['content-centered-big'] |
| 173 ..children = [ | 174 ..children = [ |
| 174 new SpanElement()..text = 'Variables ', | 175 new SpanElement()..text = 'Variables ', |
| 175 new CurlyBlockElement( | 176 new CurlyBlockElement(expanded: true, queue: _r.queue) |
| 176 expanded: _context.variables.length > 8, queue: _r.queue) | |
| 177 ..content = [ | 177 ..content = [ |
| 178 new DivElement() | 178 new DivElement() |
| 179 ..classes = ['memberList'] | 179 ..classes = ['memberList'] |
| 180 ..children = _context.variables | 180 ..children = _context.variables |
| 181 .map((variable) => new DivElement() | 181 .map((variable) => new DivElement() |
| 182 ..classes = ['memberItem'] | 182 ..classes = ['memberItem'] |
| 183 ..children = [ | 183 ..children = [ |
| 184 new DivElement() | 184 new DivElement() |
| 185 ..classes = ['memberName'] | 185 ..classes = ['memberName'] |
| 186 ..text = '[ ${++index} ]', | 186 ..text = '[ ${++index} ]', |
| 187 new DivElement() | 187 new DivElement() |
| 188 ..classes = ['memberName'] | 188 ..classes = ['memberName'] |
| 189 ..children = [ | 189 ..children = [ |
| 190 anyRef(_isolate, variable.value, _instances, | 190 anyRef(_isolate, variable.value, _objects, |
| 191 queue: _r.queue) | 191 queue: _r.queue) |
| 192 ] | 192 ] |
| 193 ]) | 193 ]) |
| 194 .toList() | 194 .toList() |
| 195 ] | 195 ] |
| 196 ] | 196 ] |
| 197 ]); | 197 ]); |
| 198 } | 198 } |
| 199 content.add(new DivElement() | 199 content.add(new DivElement() |
| 200 ..classes = ['content-centered-big'] | 200 ..classes = ['content-centered-big'] |
| 201 ..children = [new ViewFooterElement(queue: _r.queue)]); | 201 ..children = [new ViewFooterElement(queue: _r.queue)]); |
| 202 children = content; | 202 children = content; |
| 203 } | 203 } |
| 204 } | 204 } |
| OLD | NEW |