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: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/class_ref.dart'; | 8 import 'package:observatory/src/elements/class_ref.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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 void render() { | 88 void render() { |
89 _path = _path ?? new RetainingPathElement(_isolate, _object, | 89 _path = _path ?? new RetainingPathElement(_isolate, _object, |
90 _retainingPaths, _instances, | 90 _retainingPaths, _instances, |
91 queue: _r.queue); | 91 queue: _r.queue); |
92 _inbounds = _inbounds ?? new InboundReferencesElement(_isolate, _object, | 92 _inbounds = _inbounds ?? new InboundReferencesElement(_isolate, _object, |
93 _references, | 93 _references, |
94 _instances, | 94 _instances, |
95 queue: _r.queue); | 95 queue: _r.queue); |
96 children = [ | 96 children = [ |
97 new DivElement()..classes = const ['memberList'] | 97 new DivElement()..classes = ['memberList'] |
98 ..children = [ | 98 ..children = [ |
99 new DivElement()..classes = const ['memberItem'] | 99 new DivElement()..classes = ['memberItem'] |
100 ..children = [ | 100 ..children = [ |
101 new DivElement()..classes = const ['memberName'] | 101 new DivElement()..classes = ['memberName'] |
102 ..text = 'Class ', | 102 ..text = 'Class ', |
103 new DivElement()..classes = const ['memberValue'] | 103 new DivElement()..classes = ['memberValue'] |
104 ..children = [ | 104 ..children = [ |
105 _object.clazz == null | 105 _object.clazz == null |
106 ? (new SpanElement()..text = '...') | 106 ? (new SpanElement()..text = '...') |
107 : new ClassRefElement(_isolate, _object.clazz, | 107 : new ClassRefElement(_isolate, _object.clazz, |
108 queue: _r.queue) | 108 queue: _r.queue) |
109 ] | 109 ] |
110 ], | 110 ], |
111 new DivElement()..classes = const ['memberItem'] | 111 new DivElement()..classes = ['memberItem'] |
112 ..title = 'Space for this object in memory' | 112 ..title = 'Space for this object in memory' |
113 ..children = [ | 113 ..children = [ |
114 new DivElement()..classes = const ['memberName'] | 114 new DivElement()..classes = ['memberName'] |
115 ..text = 'Shallow size ', | 115 ..text = 'Shallow size ', |
116 new DivElement()..classes = const ['memberValue'] | 116 new DivElement()..classes = ['memberValue'] |
117 ..text = Utils.formatSize(_object.size ?? 0) | 117 ..text = Utils.formatSize(_object.size ?? 0) |
118 ], | 118 ], |
119 new DivElement()..classes = const ['memberItem'] | 119 new DivElement()..classes = ['memberItem'] |
120 ..title = 'Space reachable from this object, ' | 120 ..title = 'Space reachable from this object, ' |
121 'excluding class references' | 121 'excluding class references' |
122 ..children = [ | 122 ..children = [ |
123 new DivElement()..classes = const ['memberName'] | 123 new DivElement()..classes = ['memberName'] |
124 ..text = 'Reachable size ', | 124 ..text = 'Reachable size ', |
125 new DivElement()..classes = const ['memberValue'] | 125 new DivElement()..classes = ['memberValue'] |
126 ..children = _createReachableSizeValue() | 126 ..children = _createReachableSizeValue() |
127 ], | 127 ], |
128 new DivElement()..classes = const ['memberItem'] | 128 new DivElement()..classes = ['memberItem'] |
129 ..title = 'Space that would be reclaimed if references to this ' | 129 ..title = 'Space that would be reclaimed if references to this ' |
130 'object were replaced with null' | 130 'object were replaced with null' |
131 ..children = [ | 131 ..children = [ |
132 new DivElement()..classes = const ['memberName'] | 132 new DivElement()..classes = ['memberName'] |
133 ..text = 'Retained size ', | 133 ..text = 'Retained size ', |
134 new DivElement()..classes = const ['memberValue'] | 134 new DivElement()..classes = ['memberValue'] |
135 ..children = _createRetainedSizeValue() | 135 ..children = _createRetainedSizeValue() |
136 ], | 136 ], |
137 new DivElement()..classes = const ['memberItem'] | 137 new DivElement()..classes = ['memberItem'] |
138 ..children = [ | 138 ..children = [ |
139 new DivElement()..classes = const ['memberName'] | 139 new DivElement()..classes = ['memberName'] |
140 ..text = 'Retaining path ', | 140 ..text = 'Retaining path ', |
141 new DivElement()..classes = const ['memberValue'] | 141 new DivElement()..classes = ['memberValue'] |
142 ..children = [_path] | 142 ..children = [_path] |
143 ], | 143 ], |
144 new DivElement()..classes = const ['memberItem'] | 144 new DivElement()..classes = ['memberItem'] |
145 ..title = 'Objects which directly reference this object' | 145 ..title = 'Objects which directly reference this object' |
146 ..children = [ | 146 ..children = [ |
147 new DivElement()..classes = const ['memberName'] | 147 new DivElement()..classes = ['memberName'] |
148 ..text = 'Inbound references ', | 148 ..text = 'Inbound references ', |
149 new DivElement()..classes = const ['memberValue'] | 149 new DivElement()..classes = ['memberValue'] |
150 ..children = [_inbounds] | 150 ..children = [_inbounds] |
151 ] | 151 ] |
152 ] | 152 ] |
153 ]; | 153 ]; |
154 } | 154 } |
155 | 155 |
156 List<Element> _createReachableSizeValue() { | 156 List<Element> _createReachableSizeValue() { |
157 final content = <Element>[]; | 157 final content = <Element>[]; |
158 if (_reachableSize != null) { | 158 if (_reachableSize != null) { |
159 if (_reachableSize.isSentinel) { | 159 if (_reachableSize.isSentinel) { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 button.onClick.listen((_) async { | 208 button.onClick.listen((_) async { |
209 button.disabled = true; | 209 button.disabled = true; |
210 _loadingRetainedBytes = true; | 210 _loadingRetainedBytes = true; |
211 _retainedSize = await _retainedSizes.get(_isolate, _object.id); | 211 _retainedSize = await _retainedSizes.get(_isolate, _object.id); |
212 _r.dirty(); | 212 _r.dirty(); |
213 }); | 213 }); |
214 content.add(button); | 214 content.add(button); |
215 return content; | 215 return content; |
216 } | 216 } |
217 } | 217 } |
OLD | NEW |