Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: runtime/observatory/lib/src/elements/instance_view.dart

Issue 2345023003: Use dartfmt on Observatory code (Closed)
Patch Set: merge Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 instance_view_element; 5 library instance_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 15 matching lines...) Expand all
26 import 'package:observatory/src/elements/nav/refresh.dart'; 26 import 'package:observatory/src/elements/nav/refresh.dart';
27 import 'package:observatory/src/elements/nav/top_menu.dart'; 27 import 'package:observatory/src/elements/nav/top_menu.dart';
28 import 'package:observatory/src/elements/nav/vm_menu.dart'; 28 import 'package:observatory/src/elements/nav/vm_menu.dart';
29 import 'package:observatory/src/elements/object_common.dart'; 29 import 'package:observatory/src/elements/object_common.dart';
30 import 'package:observatory/src/elements/source_inset.dart'; 30 import 'package:observatory/src/elements/source_inset.dart';
31 import 'package:observatory/src/elements/source_link.dart'; 31 import 'package:observatory/src/elements/source_link.dart';
32 import 'package:observatory/src/elements/view_footer.dart'; 32 import 'package:observatory/src/elements/view_footer.dart';
33 import 'package:observatory/utils.dart'; 33 import 'package:observatory/utils.dart';
34 34
35 class InstanceViewElement extends HtmlElement implements Renderable { 35 class InstanceViewElement extends HtmlElement implements Renderable {
36 static const tag = const Tag<InstanceViewElement>('instance-view', 36 static const tag =
37 dependencies: const [ 37 const Tag<InstanceViewElement>('instance-view', dependencies: const [
38 ClassRefElement.tag, 38 ClassRefElement.tag,
39 ContextRefElement.tag, 39 ContextRefElement.tag,
40 CurlyBlockElement.tag, 40 CurlyBlockElement.tag,
41 FieldRefElement.tag, 41 FieldRefElement.tag,
42 FunctionRefElement.tag, 42 FunctionRefElement.tag,
43 InstanceRefElement.tag, 43 InstanceRefElement.tag,
44 NavClassMenuElement.tag, 44 NavClassMenuElement.tag,
45 NavLibraryMenuElement.tag, 45 NavLibraryMenuElement.tag,
46 NavTopMenuElement.tag, 46 NavTopMenuElement.tag,
47 NavVMMenuElement.tag, 47 NavVMMenuElement.tag,
48 NavIsolateMenuElement.tag, 48 NavIsolateMenuElement.tag,
49 NavRefreshElement.tag, 49 NavRefreshElement.tag,
50 NavNotifyElement.tag, 50 NavNotifyElement.tag,
51 ObjectCommonElement.tag, 51 ObjectCommonElement.tag,
52 SourceInsetElement.tag, 52 SourceInsetElement.tag,
53 SourceLinkElement.tag, 53 SourceLinkElement.tag,
54 ViewFooterElement.tag 54 ViewFooterElement.tag
55 ]); 55 ]);
56 56
57 RenderingScheduler<InstanceViewElement> _r; 57 RenderingScheduler<InstanceViewElement> _r;
58 58
59 Stream<RenderedEvent<InstanceViewElement>> get onRendered => _r.onRendered; 59 Stream<RenderedEvent<InstanceViewElement>> get onRendered => _r.onRendered;
60 60
61 M.VM _vm; 61 M.VM _vm;
62 M.IsolateRef _isolate; 62 M.IsolateRef _isolate;
63 M.EventRepository _events; 63 M.EventRepository _events;
64 M.NotificationRepository _notifications; 64 M.NotificationRepository _notifications;
65 M.Instance _instance; 65 M.Instance _instance;
66 M.LibraryRef _library; 66 M.LibraryRef _library;
67 M.InstanceRepository _instances; 67 M.InstanceRepository _instances;
68 M.ClassRepository _classes; 68 M.ClassRepository _classes;
69 M.RetainedSizeRepository _retainedSizes; 69 M.RetainedSizeRepository _retainedSizes;
70 M.ReachableSizeRepository _reachableSizes; 70 M.ReachableSizeRepository _reachableSizes;
71 M.InboundReferencesRepository _references; 71 M.InboundReferencesRepository _references;
72 M.RetainingPathRepository _retainingPaths; 72 M.RetainingPathRepository _retainingPaths;
73 M.ScriptRepository _scripts; 73 M.ScriptRepository _scripts;
74 M.EvalRepository _eval; 74 M.EvalRepository _eval;
75 M.TypeArguments _typeArguments; 75 M.TypeArguments _typeArguments;
76 M.TypeArgumentsRepository _arguments; 76 M.TypeArgumentsRepository _arguments;
77 M.BreakpointRepository _breakpoints; 77 M.BreakpointRepository _breakpoints;
78 M.FunctionRepository _functions; 78 M.FunctionRepository _functions;
79 M.SourceLocation _location; 79 M.SourceLocation _location;
80 80
81
82 M.VMRef get vm => _vm; 81 M.VMRef get vm => _vm;
83 M.IsolateRef get isolate => _isolate; 82 M.IsolateRef get isolate => _isolate;
84 M.NotificationRepository get notifications => _notifications; 83 M.NotificationRepository get notifications => _notifications;
85 M.Instance get instance => _instance; 84 M.Instance get instance => _instance;
86 85
87 factory InstanceViewElement(M.VM vm, M.IsolateRef isolate, 86 factory InstanceViewElement(
88 M.Instance instance, 87 M.VM vm,
89 M.EventRepository events, 88 M.IsolateRef isolate,
90 M.NotificationRepository notifications, 89 M.Instance instance,
91 M.InstanceRepository instances, 90 M.EventRepository events,
92 M.ClassRepository classes, 91 M.NotificationRepository notifications,
93 M.RetainedSizeRepository retainedSizes, 92 M.InstanceRepository instances,
94 M.ReachableSizeRepository reachableSizes, 93 M.ClassRepository classes,
95 M.InboundReferencesRepository references, 94 M.RetainedSizeRepository retainedSizes,
96 M.RetainingPathRepository retainingPaths, 95 M.ReachableSizeRepository reachableSizes,
97 M.ScriptRepository scripts, 96 M.InboundReferencesRepository references,
98 M.EvalRepository eval, 97 M.RetainingPathRepository retainingPaths,
99 M.TypeArgumentsRepository arguments, 98 M.ScriptRepository scripts,
100 M.BreakpointRepository breakpoints, 99 M.EvalRepository eval,
101 M.FunctionRepository functions, 100 M.TypeArgumentsRepository arguments,
102 {RenderingQueue queue}) { 101 M.BreakpointRepository breakpoints,
102 M.FunctionRepository functions,
103 {RenderingQueue queue}) {
103 assert(vm != null); 104 assert(vm != null);
104 assert(isolate != null); 105 assert(isolate != null);
105 assert(events != null); 106 assert(events != null);
106 assert(notifications != null); 107 assert(notifications != null);
107 assert(instance != null); 108 assert(instance != null);
108 assert(instances != null); 109 assert(instances != null);
109 assert(classes != null); 110 assert(classes != null);
110 assert(retainedSizes != null); 111 assert(retainedSizes != null);
111 assert(reachableSizes != null); 112 assert(reachableSizes != null);
112 assert(references != null); 113 assert(references != null);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 149
149 @override 150 @override
150 detached() { 151 detached() {
151 super.detached(); 152 super.detached();
152 _r.disable(notify: true); 153 _r.disable(notify: true);
153 children = []; 154 children = [];
154 } 155 }
155 156
156 void render() { 157 void render() {
157 final content = [ 158 final content = [
158 new HeadingElement.h2()..text = M.isAbstractType(_instance.kind) 159 new HeadingElement.h2()
159 ? 'type ${_instance.name}' 160 ..text = M.isAbstractType(_instance.kind)
160 : 'instance of ${_instance.clazz.name}', 161 ? 'type ${_instance.name}'
162 : 'instance of ${_instance.clazz.name}',
161 new HRElement(), 163 new HRElement(),
162 new ObjectCommonElement(_isolate, _instance, _retainedSizes, 164 new ObjectCommonElement(_isolate, _instance, _retainedSizes,
163 _reachableSizes, _references, _retainingPaths, 165 _reachableSizes, _references, _retainingPaths, _instances,
164 _instances, queue: _r.queue), 166 queue: _r.queue),
165 new BRElement(), 167 new BRElement(),
166 new DivElement()..classes = ['memberList'] 168 new DivElement()
169 ..classes = ['memberList']
167 ..children = _createMembers(), 170 ..children = _createMembers(),
168 new HRElement(), 171 new HRElement(),
169 new EvalBoxElement(_isolate, _instance, _instances, _eval, 172 new EvalBoxElement(_isolate, _instance, _instances, _eval,
170 quickExpressions: const ['toString()', 173 quickExpressions: const ['toString()', 'runtimeType'],
171 'runtimeType'], 174 queue: _r.queue)
172 queue: _r.queue)
173 ]; 175 ];
174 if (_location != null) { 176 if (_location != null) {
175 content.addAll([ 177 content.addAll([
176 new HRElement(), 178 new HRElement(),
177 new SourceInsetElement(_isolate, _location, _scripts, _instances, 179 new SourceInsetElement(
178 _events, queue: _r.queue) 180 _isolate, _location, _scripts, _instances, _events,
181 queue: _r.queue)
179 ]); 182 ]);
180 } 183 }
181 content.addAll([ 184 content.addAll([new HRElement(), new ViewFooterElement(queue: _r.queue)]);
182 new HRElement(),
183 new ViewFooterElement(queue: _r.queue)
184 ]);
185 children = [ 185 children = [
186 navBar(_createMenu()), 186 navBar(_createMenu()),
187 new DivElement()..classes = ['content-centered-big'] 187 new DivElement()
188 ..classes = ['content-centered-big']
188 ..children = content 189 ..children = content
189 ]; 190 ];
190 } 191 }
191 192
192 List<Element> _createMenu() { 193 List<Element> _createMenu() {
193 final menu = [ 194 final menu = [
194 new NavTopMenuElement(queue: _r.queue), 195 new NavTopMenuElement(queue: _r.queue),
195 new NavVMMenuElement(_vm, _events, queue: _r.queue), 196 new NavVMMenuElement(_vm, _events, queue: _r.queue),
196 new NavIsolateMenuElement(_isolate, _events, queue: _r.queue) 197 new NavIsolateMenuElement(_isolate, _events, queue: _r.queue)
197 ]; 198 ];
198 if (_library != null) { 199 if (_library != null) {
199 menu.add(new NavLibraryMenuElement(_isolate, _library, 200 menu.add(new NavLibraryMenuElement(_isolate, _library, queue: _r.queue));
200 queue: _r.queue));
201 } 201 }
202 menu.addAll([ 202 menu.addAll([
203 new NavClassMenuElement(_isolate, _instance.clazz, queue: _r.queue), 203 new NavClassMenuElement(_isolate, _instance.clazz, queue: _r.queue),
204 navMenu('instance'), 204 navMenu('instance'),
205 new NavRefreshElement(queue: _r.queue) 205 new NavRefreshElement(queue: _r.queue)
206 ..onRefresh.listen((e) { 206 ..onRefresh.listen((e) {
207 e.element.disabled = true; 207 e.element.disabled = true;
208 _refresh(); 208 _refresh();
209 }), 209 }),
210 new NavNotifyElement(_notifications, queue: _r.queue) 210 new NavNotifyElement(_notifications, queue: _r.queue)
211 ]); 211 ]);
212 return menu; 212 return menu;
213 } 213 }
214 214
215 List<Element> _createMembers() { 215 List<Element> _createMembers() {
216 final members = <Element>[]; 216 final members = <Element>[];
217 if (_instance.valueAsString != null) { 217 if (_instance.valueAsString != null) {
218 members.add(new DivElement()..classes = ['memberItem'] 218 members.add(new DivElement()
219 ..classes = ['memberItem']
219 ..children = [ 220 ..children = [
220 new DivElement()..classes = ['memberName'] 221 new DivElement()
222 ..classes = ['memberName']
221 ..text = _instance.kind == M.InstanceKind.string 223 ..text = _instance.kind == M.InstanceKind.string
222 ? 'value as literal' 224 ? 'value as literal'
223 : 'value', 225 : 'value',
224 new DivElement()..classes = ['memberValue'] 226 new DivElement()
227 ..classes = ['memberValue']
225 ..text = _instance.kind == M.InstanceKind.string 228 ..text = _instance.kind == M.InstanceKind.string
226 ? Utils.formatStringAsLiteral(_instance.valueAsString, 229 ? Utils.formatStringAsLiteral(
227 _instance.valueAsStringIsTruncated) 230 _instance.valueAsString, _instance.valueAsStringIsTruncated)
228 : _instance.valueAsString 231 : _instance.valueAsString
229 ]); 232 ]);
230 } 233 }
231 if (_instance.typeClass != null) { 234 if (_instance.typeClass != null) {
232 members.add(new DivElement()..classes = ['memberItem'] 235 members.add(new DivElement()
236 ..classes = ['memberItem']
233 ..children = [ 237 ..children = [
234 new DivElement()..classes = ['memberName'] 238 new DivElement()
239 ..classes = ['memberName']
235 ..text = 'type class', 240 ..text = 'type class',
236 new DivElement()..classes = ['memberValue'] 241 new DivElement()
242 ..classes = ['memberValue']
237 ..children = [ 243 ..children = [
238 new ClassRefElement(_isolate, _instance.typeClass, 244 new ClassRefElement(_isolate, _instance.typeClass,
239 queue: _r.queue) 245 queue: _r.queue)
240 ] 246 ]
241 ]); 247 ]);
242 } 248 }
243 if (_typeArguments != null && _typeArguments.types.isNotEmpty) { 249 if (_typeArguments != null && _typeArguments.types.isNotEmpty) {
244 members.add(new DivElement()..classes = ['memberItem'] 250 members.add(new DivElement()
251 ..classes = ['memberItem']
245 ..children = [ 252 ..children = [
246 new DivElement()..classes = ['memberName'] 253 new DivElement()
254 ..classes = ['memberName']
247 ..text = 'type arguments', 255 ..text = 'type arguments',
248 new DivElement()..classes = ['memberValue'] 256 new DivElement()
249 ..children = ([ 257 ..classes = ['memberValue']
250 new SpanElement()..text = '< ' 258 ..children = ([new SpanElement()..text = '< ']
251 ] 259 ..addAll(_typeArguments.types.expand((type) => [
252 ..addAll(_typeArguments.types.expand((type) => [ 260 new InstanceRefElement(_isolate, type, _instances,
253 new InstanceRefElement(_isolate, type, _instances, queue: 261 queue: _r.queue),
254 _r.queue), 262 new SpanElement()..text = ', '
255 new SpanElement()..text = ', ' 263 ]))
256 ])) 264 ..removeLast()
257 ..removeLast() 265 ..add(new SpanElement()..text = ' >'))
258 ..add(new SpanElement()..text = ' >'))
259 ]); 266 ]);
260 } 267 }
261 if (_instance.parameterizedClass != null) { 268 if (_instance.parameterizedClass != null) {
262 members.add(new DivElement()..classes = ['memberItem'] 269 members.add(new DivElement()
270 ..classes = ['memberItem']
263 ..children = [ 271 ..children = [
264 new DivElement()..classes = ['memberName'] 272 new DivElement()
273 ..classes = ['memberName']
265 ..text = 'parameterized class', 274 ..text = 'parameterized class',
266 new DivElement()..classes = ['memberValue'] 275 new DivElement()
276 ..classes = ['memberValue']
267 ..children = [ 277 ..children = [
268 new ClassRefElement(_isolate, _instance.parameterizedClass, 278 new ClassRefElement(_isolate, _instance.parameterizedClass,
269 queue: _r.queue) 279 queue: _r.queue)
270 ] 280 ]
271 ]); 281 ]);
272 } 282 }
273 if (_instance.parameterIndex != null) { 283 if (_instance.parameterIndex != null) {
274 members.add(new DivElement()..classes = ['memberItem'] 284 members.add(new DivElement()
285 ..classes = ['memberItem']
275 ..children = [ 286 ..children = [
276 new DivElement()..classes = ['memberName'] 287 new DivElement()
288 ..classes = ['memberName']
277 ..text = 'parameter index', 289 ..text = 'parameter index',
278 new DivElement()..classes = ['memberValue'] 290 new DivElement()
291 ..classes = ['memberValue']
279 ..text = '${_instance.parameterIndex}' 292 ..text = '${_instance.parameterIndex}'
280 ]); 293 ]);
281 } 294 }
282 if (_instance.targetType != null) { 295 if (_instance.targetType != null) {
283 members.add(new DivElement()..classes = ['memberItem'] 296 members.add(new DivElement()
297 ..classes = ['memberItem']
284 ..children = [ 298 ..children = [
285 new DivElement()..classes = ['memberName'] 299 new DivElement()
300 ..classes = ['memberName']
286 ..text = 'target type', 301 ..text = 'target type',
287 new DivElement()..classes = ['memberValue'] 302 new DivElement()
303 ..classes = ['memberValue']
288 ..children = [ 304 ..children = [
289 new InstanceRefElement(_isolate, _instance.targetType, _instances, 305 new InstanceRefElement(_isolate, _instance.targetType, _instances,
290 queue: _r.queue) 306 queue: _r.queue)
291 ] 307 ]
292 ]); 308 ]);
293 } 309 }
294 if (_instance.bound != null) { 310 if (_instance.bound != null) {
295 members.add(new DivElement()..classes = ['memberItem'] 311 members.add(new DivElement()
312 ..classes = ['memberItem']
296 ..children = [ 313 ..children = [
297 new DivElement()..classes = ['memberName'] 314 new DivElement()
315 ..classes = ['memberName']
298 ..text = 'bound', 316 ..text = 'bound',
299 new DivElement()..classes = ['memberValue'] 317 new DivElement()
318 ..classes = ['memberValue']
300 ..children = [ 319 ..children = [
301 new InstanceRefElement(_isolate, _instance.bound, _instances, 320 new InstanceRefElement(_isolate, _instance.bound, _instances,
302 queue: _r.queue) 321 queue: _r.queue)
303 ] 322 ]
304 ]); 323 ]);
305 } 324 }
306 if (_instance.closureFunction != null) { 325 if (_instance.closureFunction != null) {
307 members.add(new DivElement()..classes = ['memberItem'] 326 members.add(new DivElement()
327 ..classes = ['memberItem']
308 ..children = [ 328 ..children = [
309 new DivElement()..classes = ['memberName'] 329 new DivElement()
330 ..classes = ['memberName']
310 ..text = 'closure function', 331 ..text = 'closure function',
311 new DivElement()..classes = ['memberValue'] 332 new DivElement()
333 ..classes = ['memberValue']
312 ..children = [ 334 ..children = [
313 new FunctionRefElement(_isolate, _instance.closureFunction, 335 new FunctionRefElement(_isolate, _instance.closureFunction,
314 queue: _r.queue) 336 queue: _r.queue)
315 ] 337 ]
316 ]); 338 ]);
317 } 339 }
318 if (_instance.closureContext != null) { 340 if (_instance.closureContext != null) {
319 members.add(new DivElement()..classes = ['memberItem'] 341 members.add(new DivElement()
342 ..classes = ['memberItem']
320 ..children = [ 343 ..children = [
321 new DivElement()..classes = ['memberName'] 344 new DivElement()
345 ..classes = ['memberName']
322 ..text = 'closure context', 346 ..text = 'closure context',
323 new DivElement()..classes = ['memberValue'] 347 new DivElement()
348 ..classes = ['memberValue']
324 ..children = [ 349 ..children = [
325 new ContextRefElement(_isolate, _instance.closureContext, 350 new ContextRefElement(_isolate, _instance.closureContext,
326 queue: _r.queue) 351 queue: _r.queue)
327 ] 352 ]
328 ]); 353 ]);
329 } 354 }
330 if (_instance.kind == M.InstanceKind.closure) { 355 if (_instance.kind == M.InstanceKind.closure) {
331 ButtonElement btn; 356 ButtonElement btn;
332 members.add(new DivElement()..classes = ['memberItem'] 357 members.add(new DivElement()
358 ..classes = ['memberItem']
333 ..children = [ 359 ..children = [
334 new DivElement()..classes = ['memberName'] 360 new DivElement()
361 ..classes = ['memberName']
335 ..text = 'closure breakpoint', 362 ..text = 'closure breakpoint',
336 new DivElement()..classes = ['memberValue'] 363 new DivElement()
364 ..classes = ['memberValue']
337 ..children = [ 365 ..children = [
338 btn = new ButtonElement() 366 btn = new ButtonElement()
339 ..text = _instance.activationBreakpoint == null 367 ..text = _instance.activationBreakpoint == null
340 ? 'break on activation' 368 ? 'break on activation'
341 : 'remove' 369 : 'remove'
342 ..onClick.listen((_) { 370 ..onClick.listen((_) {
343 btn.disabled = true; 371 btn.disabled = true;
344 _toggleBreakpoint(); 372 _toggleBreakpoint();
345 }) 373 })
346 ] 374 ]
347 ]); 375 ]);
348 } 376 }
349 377
350 if (_instance.nativeFields != null && _instance.nativeFields.isNotEmpty) { 378 if (_instance.nativeFields != null && _instance.nativeFields.isNotEmpty) {
351 int i = 0; 379 int i = 0;
352 members.add(new DivElement()..classes = ['memberItem'] 380 members.add(new DivElement()
381 ..classes = ['memberItem']
353 ..children = [ 382 ..children = [
354 new DivElement()..classes = ['memberName'] 383 new DivElement()
384 ..classes = ['memberName']
355 ..text = 'native fields (${_instance.nativeFields.length})', 385 ..text = 'native fields (${_instance.nativeFields.length})',
356 new DivElement()..classes = ['memberName'] 386 new DivElement()
387 ..classes = ['memberName']
357 ..children = [ 388 ..children = [
358 new CurlyBlockElement( 389 new CurlyBlockElement(
359 expanded: _instance.nativeFields.length <= 100, 390 expanded: _instance.nativeFields.length <= 100,
360 queue: _r.queue) 391 queue: _r.queue)
361 ..content = [ 392 ..content = [
362 new DivElement()..classes = ['memberList'] 393 new DivElement()
363 ..children = _instance.nativeFields.map((f) => 394 ..classes = ['memberList']
364 new DivElement()..classes = ['memberItem'] 395 ..children = _instance.nativeFields
365 ..children = [ 396 .map((f) => new DivElement()
366 new DivElement()..classes = ['memberName'] 397 ..classes = ['memberItem']
367 ..text = '[ ${i++} ]', 398 ..children = [
368 new DivElement()..classes = ['memberValue'] 399 new DivElement()
369 ..text = '[ ${f.value} ]' 400 ..classes = ['memberName']
370 ]).toList() 401 ..text = '[ ${i++} ]',
402 new DivElement()
403 ..classes = ['memberValue']
404 ..text = '[ ${f.value} ]'
405 ])
406 .toList()
371 ] 407 ]
372 ] 408 ]
373 ]); 409 ]);
374 } 410 }
375 411
376 if (_instance.fields != null && _instance.fields.isNotEmpty) { 412 if (_instance.fields != null && _instance.fields.isNotEmpty) {
377 final fields = _instance.fields.toList(); 413 final fields = _instance.fields.toList();
378 members.add(new DivElement()..classes = ['memberItem'] 414 members.add(new DivElement()
415 ..classes = ['memberItem']
379 ..children = [ 416 ..children = [
380 new DivElement()..classes = ['memberName'] 417 new DivElement()
418 ..classes = ['memberName']
381 ..text = 'fields (${fields.length})', 419 ..text = 'fields (${fields.length})',
382 new DivElement()..classes = ['memberName'] 420 new DivElement()
421 ..classes = ['memberName']
383 ..children = [ 422 ..children = [
384 new CurlyBlockElement( 423 new CurlyBlockElement(
385 expanded: fields.length <= 100, 424 expanded: fields.length <= 100, queue: _r.queue)
386 queue: _r.queue)
387 ..content = [ 425 ..content = [
388 new DivElement()..classes = ['memberList'] 426 new DivElement()
389 ..children = fields.map((f) => 427 ..classes = ['memberList']
390 new DivElement()..classes = ['memberItem'] 428 ..children = fields
391 ..children = [ 429 .map((f) => new DivElement()
392 new DivElement()..classes = ['memberName'] 430 ..classes = ['memberItem']
393 ..children = [ 431 ..children = [
394 new FieldRefElement(_isolate, f.decl, _instances, 432 new DivElement()
395 queue: _r.queue) 433 ..classes = ['memberName']
396 ], 434 ..children = [
397 new DivElement()..classes = ['memberValue'] 435 new FieldRefElement(
398 ..children = [ 436 _isolate, f.decl, _instances,
399 new SpanElement()..text = ' = ', 437 queue: _r.queue)
400 anyRef(_isolate, f.value, _instances, 438 ],
401 queue: _r.queue) 439 new DivElement()
402 ] 440 ..classes = ['memberValue']
403 ]).toList() 441 ..children = [
442 new SpanElement()..text = ' = ',
443 anyRef(_isolate, f.value, _instances,
444 queue: _r.queue)
445 ]
446 ])
447 .toList()
404 ] 448 ]
405 ] 449 ]
406 ]); 450 ]);
407 } 451 }
408 452
409 if (_instance.elements != null && _instance.elements.isNotEmpty) { 453 if (_instance.elements != null && _instance.elements.isNotEmpty) {
410 final elements = _instance.elements.toList(); 454 final elements = _instance.elements.toList();
411 int i = 0; 455 int i = 0;
412 members.add(new DivElement()..classes = ['memberItem'] 456 members.add(new DivElement()
457 ..classes = ['memberItem']
413 ..children = [ 458 ..children = [
414 new DivElement()..classes = ['memberName'] 459 new DivElement()
460 ..classes = ['memberName']
415 ..text = 'elements (${_instance.length})', 461 ..text = 'elements (${_instance.length})',
416 new DivElement()..classes = ['memberValue'] 462 new DivElement()
463 ..classes = ['memberValue']
417 ..children = [ 464 ..children = [
418 new CurlyBlockElement( 465 new CurlyBlockElement(
419 expanded: elements.length <= 100, 466 expanded: elements.length <= 100, queue: _r.queue)
420 queue: _r.queue)
421 ..content = [ 467 ..content = [
422 new DivElement()..classes = ['memberList'] 468 new DivElement()
423 ..children = elements.map((element) => 469 ..classes = ['memberList']
424 new DivElement()..classes = ['memberItem'] 470 ..children = elements
425 ..children = [ 471 .map((element) => new DivElement()
426 new DivElement()..classes = ['memberName'] 472 ..classes = ['memberItem']
427 ..text = '[ ${i++} ]', 473 ..children = [
428 new DivElement()..classes = ['memberValue'] 474 new DivElement()
429 ..children = [ 475 ..classes = ['memberName']
430 anyRef(_isolate, element, _instances, 476 ..text = '[ ${i++} ]',
431 queue: _r.queue) 477 new DivElement()
432 ] 478 ..classes = ['memberValue']
433 ]).toList() 479 ..children = [
480 anyRef(_isolate, element, _instances,
481 queue: _r.queue)
482 ]
483 ])
484 .toList()
434 ] 485 ]
435 ] 486 ]
436 ]); 487 ]);
437 if (_instance.length != elements.length) { 488 if (_instance.length != elements.length) {
438 members.add(new DivElement()..classes = ['memberItem'] 489 members.add(new DivElement()
490 ..classes = ['memberItem']
439 ..children = [ 491 ..children = [
440 new DivElement()..classes = ['memberName'] 492 new DivElement()
493 ..classes = ['memberName']
441 ..text = '...', 494 ..text = '...',
442 new DivElement()..classes = ['memberValue'] 495 new DivElement()
496 ..classes = ['memberValue']
443 ..text = '${_instance.length - elements.length} omitted elements' 497 ..text = '${_instance.length - elements.length} omitted elements'
444 ]); 498 ]);
445 } 499 }
446 } 500 }
447 501
448 if (_instance.associations != null && _instance.associations.isNotEmpty) { 502 if (_instance.associations != null && _instance.associations.isNotEmpty) {
449 final associations = _instance.associations.toList(); 503 final associations = _instance.associations.toList();
450 members.add(new DivElement()..classes = ['memberItem'] 504 members.add(new DivElement()
505 ..classes = ['memberItem']
451 ..children = [ 506 ..children = [
452 new DivElement()..classes = ['memberName'] 507 new DivElement()
508 ..classes = ['memberName']
453 ..text = 'associations (${_instance.length})', 509 ..text = 'associations (${_instance.length})',
454 new DivElement()..classes = ['memberName'] 510 new DivElement()
511 ..classes = ['memberName']
455 ..children = [ 512 ..children = [
456 new CurlyBlockElement( 513 new CurlyBlockElement(
457 expanded: associations.length <= 100, 514 expanded: associations.length <= 100, queue: _r.queue)
458 queue: _r.queue)
459 ..content = [ 515 ..content = [
460 new DivElement()..classes = ['memberList'] 516 new DivElement()
461 ..children = associations.map((a) => 517 ..classes = ['memberList']
462 new DivElement()..classes = ['memberItem'] 518 ..children = associations
463 ..children = [ 519 .map((a) => new DivElement()
464 new DivElement()..classes = ['memberName'] 520 ..classes = ['memberItem']
465 ..children = [ 521 ..children = [
466 new SpanElement()..text = '[ ', 522 new DivElement()
467 anyRef(_isolate, a.key, _instances, 523 ..classes = ['memberName']
468 queue: _r.queue), 524 ..children = [
469 new SpanElement()..text = ' ]', 525 new SpanElement()..text = '[ ',
470 ], 526 anyRef(_isolate, a.key, _instances,
471 new DivElement()..classes = ['memberValue'] 527 queue: _r.queue),
472 ..children = [ 528 new SpanElement()..text = ' ]',
473 anyRef(_isolate, a.value, _instances, 529 ],
474 queue: _r.queue) 530 new DivElement()
475 ] 531 ..classes = ['memberValue']
476 ]).toList() 532 ..children = [
533 anyRef(_isolate, a.value, _instances,
534 queue: _r.queue)
535 ]
536 ])
537 .toList()
477 ] 538 ]
478 ] 539 ]
479 ]); 540 ]);
480 if (_instance.length != associations.length) { 541 if (_instance.length != associations.length) {
481 members.add(new DivElement()..classes = ['memberItem'] 542 members.add(new DivElement()
543 ..classes = ['memberItem']
482 ..children = [ 544 ..children = [
483 new DivElement()..classes = ['memberName'] 545 new DivElement()
546 ..classes = ['memberName']
484 ..text = '...', 547 ..text = '...',
485 new DivElement()..classes = ['memberValue'] 548 new DivElement()
549 ..classes = ['memberValue']
486 ..text = '${_instance.length - associations.length} ' 550 ..text = '${_instance.length - associations.length} '
487 'omitted elements' 551 'omitted elements'
488 ]); 552 ]);
489 } 553 }
490 } 554 }
491 555
492 if (_instance.typedElements != null && _instance.typedElements.isNotEmpty) { 556 if (_instance.typedElements != null && _instance.typedElements.isNotEmpty) {
493 final typedElements = _instance.typedElements.toList(); 557 final typedElements = _instance.typedElements.toList();
494 int i = 0; 558 int i = 0;
495 members.add(new DivElement()..classes = ['memberItem'] 559 members.add(new DivElement()
560 ..classes = ['memberItem']
496 ..children = [ 561 ..children = [
497 new DivElement()..classes = ['memberName'] 562 new DivElement()
563 ..classes = ['memberName']
498 ..text = 'elements (${_instance.length})', 564 ..text = 'elements (${_instance.length})',
499 new DivElement()..classes = ['memberValue'] 565 new DivElement()
566 ..classes = ['memberValue']
500 ..children = [ 567 ..children = [
501 new CurlyBlockElement( 568 new CurlyBlockElement(
502 expanded: typedElements.length <= 100, 569 expanded: typedElements.length <= 100, queue: _r.queue)
503 queue: _r.queue)
504 ..content = [ 570 ..content = [
505 new DivElement()..classes = ['memberList'] 571 new DivElement()
506 ..children = typedElements.map((e) => 572 ..classes = ['memberList']
507 new DivElement()..classes = ['memberItem'] 573 ..children = typedElements
508 ..children = [ 574 .map((e) => new DivElement()
509 new DivElement()..classes = ['memberName'] 575 ..classes = ['memberItem']
510 ..text = '[ ${i++} ]', 576 ..children = [
511 new DivElement()..classes = ['memberValue'] 577 new DivElement()
512 ..text = '$e' 578 ..classes = ['memberName']
513 ]).toList() 579 ..text = '[ ${i++} ]',
580 new DivElement()
581 ..classes = ['memberValue']
582 ..text = '$e'
583 ])
584 .toList()
514 ] 585 ]
515 ] 586 ]
516 ]); 587 ]);
517 if (_instance.length != typedElements.length) { 588 if (_instance.length != typedElements.length) {
518 members.add(new DivElement()..classes = ['memberItem'] 589 members.add(new DivElement()
519 ..children = [ 590 ..classes = ['memberItem']
520 new DivElement()..classes = ['memberName'] 591 ..children = [
592 new DivElement()
593 ..classes = ['memberName']
521 ..text = '...', 594 ..text = '...',
522 new DivElement()..classes = ['memberValue'] 595 new DivElement()
596 ..classes = ['memberValue']
523 ..text = '${_instance.length - typedElements.length} ' 597 ..text = '${_instance.length - typedElements.length} '
524 'omitted elements' 598 'omitted elements'
525 ]); 599 ]);
526 } 600 }
527 } 601 }
528 602
529 if (_instance.kind == M.InstanceKind.regExp) { 603 if (_instance.kind == M.InstanceKind.regExp) {
530 members.addAll([ 604 members.addAll([
531 new DivElement()..classes = ['memberItem'] 605 new DivElement()
532 ..children = [ 606 ..classes = ['memberItem']
533 new DivElement()..classes = ['memberName'] 607 ..children = [
608 new DivElement()
609 ..classes = ['memberName']
534 ..text = 'pattern', 610 ..text = 'pattern',
535 new DivElement()..classes = ['memberValue'] 611 new DivElement()
612 ..classes = ['memberValue']
536 ..children = [ 613 ..children = [
537 anyRef(_isolate, _instance.pattern, _instances, queue: _r.queue) 614 anyRef(_isolate, _instance.pattern, _instances, queue: _r.queue)
538 ] 615 ]
539 ], 616 ],
540 new DivElement()..classes = ['memberItem'] 617 new DivElement()
541 ..children = [ 618 ..classes = ['memberItem']
542 new DivElement()..classes = ['memberName'] 619 ..children = [
620 new DivElement()
621 ..classes = ['memberName']
543 ..text = 'isCaseSensitive', 622 ..text = 'isCaseSensitive',
544 new DivElement()..classes = ['memberValue'] 623 new DivElement()
624 ..classes = ['memberValue']
545 ..text = _instance.isCaseSensitive ? 'yes' : 'no' 625 ..text = _instance.isCaseSensitive ? 'yes' : 'no'
546 ], 626 ],
547 new DivElement()..classes = ['memberItem'] 627 new DivElement()
548 ..children = [ 628 ..classes = ['memberItem']
549 new DivElement()..classes = ['memberName'] 629 ..children = [
630 new DivElement()
631 ..classes = ['memberName']
550 ..text = 'isMultiLine', 632 ..text = 'isMultiLine',
551 new DivElement()..classes = ['memberValue'] 633 new DivElement()
634 ..classes = ['memberValue']
552 ..text = _instance.isMultiLine ? 'yes' : 'no' 635 ..text = _instance.isMultiLine ? 'yes' : 'no'
553 ], 636 ],
554 new DivElement()..classes = ['memberItem'] 637 new DivElement()
555 ..children = [ 638 ..classes = ['memberItem']
556 new DivElement()..classes = ['memberName'] 639 ..children = [
640 new DivElement()
641 ..classes = ['memberName']
557 ..text = 'oneByteFunction', 642 ..text = 'oneByteFunction',
558 new DivElement()..classes = ['memberValue'] 643 new DivElement()
644 ..classes = ['memberValue']
559 ..children = [ 645 ..children = [
560 new FunctionRefElement(_isolate, _instance.oneByteFunction, 646 new FunctionRefElement(_isolate, _instance.oneByteFunction,
561 queue: _r.queue) 647 queue: _r.queue)
562 ] 648 ]
563 ], 649 ],
564 new DivElement()..classes = ['memberItem'] 650 new DivElement()
565 ..children = [ 651 ..classes = ['memberItem']
566 new DivElement()..classes = ['memberName'] 652 ..children = [
653 new DivElement()
654 ..classes = ['memberName']
567 ..text = 'twoByteFunction', 655 ..text = 'twoByteFunction',
568 new DivElement()..classes = ['memberValue'] 656 new DivElement()
657 ..classes = ['memberValue']
569 ..children = [ 658 ..children = [
570 new FunctionRefElement(_isolate, _instance.twoByteFunction, 659 new FunctionRefElement(_isolate, _instance.twoByteFunction,
571 queue: _r.queue) 660 queue: _r.queue)
572 ] 661 ]
573 ], 662 ],
574 new DivElement()..classes = ['memberItem'] 663 new DivElement()
575 ..children = [ 664 ..classes = ['memberItem']
576 new DivElement()..classes = ['memberName'] 665 ..children = [
666 new DivElement()
667 ..classes = ['memberName']
577 ..text = 'externalOneByteFunction', 668 ..text = 'externalOneByteFunction',
578 new DivElement()..classes = ['memberValue'] 669 new DivElement()
579 ..children = [ 670 ..classes = ['memberValue']
580 new FunctionRefElement(_isolate, 671 ..children = [
581 _instance.externalOneByteFunction, 672 new FunctionRefElement(
582 queue: _r.queue) 673 _isolate, _instance.externalOneByteFunction,
583 ] 674 queue: _r.queue)
584 ], 675 ]
585 new DivElement()..classes = ['memberItem'] 676 ],
586 ..children = [ 677 new DivElement()
587 new DivElement()..classes = ['memberName'] 678 ..classes = ['memberItem']
679 ..children = [
680 new DivElement()
681 ..classes = ['memberName']
588 ..text = 'externalTwoByteFunction', 682 ..text = 'externalTwoByteFunction',
589 new DivElement()..classes = ['memberValue'] 683 new DivElement()
590 ..children = [ 684 ..classes = ['memberValue']
591 new FunctionRefElement(_isolate, 685 ..children = [
592 _instance.externalTwoByteFunction, 686 new FunctionRefElement(
593 queue: _r.queue) 687 _isolate, _instance.externalTwoByteFunction,
594 ] 688 queue: _r.queue)
595 ], 689 ]
596 new DivElement()..classes = ['memberItem'] 690 ],
597 ..children = [ 691 new DivElement()
598 new DivElement()..classes = ['memberName'] 692 ..classes = ['memberItem']
693 ..children = [
694 new DivElement()
695 ..classes = ['memberName']
599 ..text = 'oneByteBytecode', 696 ..text = 'oneByteBytecode',
600 new DivElement()..classes = ['memberValue'] 697 new DivElement()
601 ..children = [ 698 ..classes = ['memberValue']
602 new InstanceRefElement(_isolate, _instance.oneByteBytecode, 699 ..children = [
603 _instances, queue: _r.queue) 700 new InstanceRefElement(
604 ] 701 _isolate, _instance.oneByteBytecode, _instances,
605 ], 702 queue: _r.queue)
606 new DivElement()..classes = ['memberItem'] 703 ]
607 ..children = [ 704 ],
608 new DivElement()..classes = ['memberName'] 705 new DivElement()
706 ..classes = ['memberItem']
707 ..children = [
708 new DivElement()
709 ..classes = ['memberName']
609 ..text = 'twoByteBytecode', 710 ..text = 'twoByteBytecode',
610 new DivElement()..classes = ['memberValue'] 711 new DivElement()
611 ..children = [ 712 ..classes = ['memberValue']
612 new InstanceRefElement(_isolate, _instance.twoByteBytecode, 713 ..children = [
613 _instances, queue: _r.queue) 714 new InstanceRefElement(
715 _isolate, _instance.twoByteBytecode, _instances,
716 queue: _r.queue)
614 ] 717 ]
615 ] 718 ]
616 ]); 719 ]);
617 } 720 }
618 721
619 if (_instance.kind == M.InstanceKind.mirrorReference) { 722 if (_instance.kind == M.InstanceKind.mirrorReference) {
620 members.add(new DivElement()..classes = ['memberItem'] 723 members.add(new DivElement()
724 ..classes = ['memberItem']
621 ..children = [ 725 ..children = [
622 new DivElement()..classes = ['memberName'] 726 new DivElement()
727 ..classes = ['memberName']
623 ..text = 'referent', 728 ..text = 'referent',
624 new DivElement()..classes = ['memberValue'] 729 new DivElement()
730 ..classes = ['memberValue']
625 ..children = [ 731 ..children = [
626 new ContextRefElement(_isolate, _instance.referent, 732 new ContextRefElement(_isolate, _instance.referent,
627 queue: _r.queue) 733 queue: _r.queue)
628 ] 734 ]
629 ]); 735 ]);
630 } 736 }
631 if (_instance.kind == M.InstanceKind.weakProperty) { 737 if (_instance.kind == M.InstanceKind.weakProperty) {
632 members.addAll([ 738 members.addAll([
633 new DivElement()..classes = ['memberItem'] 739 new DivElement()
634 ..children = [ 740 ..classes = ['memberItem']
635 new DivElement()..classes = ['memberName'] 741 ..children = [
742 new DivElement()
743 ..classes = ['memberName']
636 ..text = 'key', 744 ..text = 'key',
637 new DivElement()..classes = ['memberValue'] 745 new DivElement()
746 ..classes = ['memberValue']
638 ..children = [ 747 ..children = [
639 new InstanceRefElement(_isolate, _instance.key, _instances, 748 new InstanceRefElement(_isolate, _instance.key, _instances,
640 queue: _r.queue), 749 queue: _r.queue),
641 ] 750 ]
642 ], 751 ],
643 new DivElement()..classes = ['memberItem'] 752 new DivElement()
644 ..children = [ 753 ..classes = ['memberItem']
645 new DivElement()..classes = ['memberName'] 754 ..children = [
755 new DivElement()
756 ..classes = ['memberName']
646 ..text = 'value', 757 ..text = 'value',
647 new DivElement()..classes = ['memberValue'] 758 new DivElement()
759 ..classes = ['memberValue']
648 ..children = [ 760 ..children = [
649 new InstanceRefElement(_isolate, _instance.value, _instances, 761 new InstanceRefElement(_isolate, _instance.value, _instances,
650 queue: _r.queue), 762 queue: _r.queue),
651 ] 763 ]
652 ] 764 ]
653 ]); 765 ]);
654 } 766 }
655 return members; 767 return members;
656 } 768 }
657 769
658 Future _refresh() async { 770 Future _refresh() async {
659 _instance = await _instances.get(_isolate, _instance.id); 771 _instance = await _instances.get(_isolate, _instance.id);
660 await _loadExtraData(); 772 await _loadExtraData();
661 _r.dirty(); 773 _r.dirty();
662 } 774 }
663 775
664 Future _loadExtraData() async { 776 Future _loadExtraData() async {
665 _library = (await _classes.get(_isolate, _instance.clazz.id)).library; 777 _library = (await _classes.get(_isolate, _instance.clazz.id)).library;
666 if (_instance.typeArguments != null) { 778 if (_instance.typeArguments != null) {
667 _typeArguments = await _arguments.get(_isolate, 779 _typeArguments =
668 _instance.typeArguments.id); 780 await _arguments.get(_isolate, _instance.typeArguments.id);
669 } else { 781 } else {
670 _typeArguments = null; 782 _typeArguments = null;
671 } 783 }
672 if (_instance.closureFunction != null) { 784 if (_instance.closureFunction != null) {
673 _location = (await _functions.get(_isolate, 785 _location = (await _functions.get(_isolate, _instance.closureFunction.id))
674 _instance.closureFunction.id)).location; 786 .location;
675 } else if (_instance.typeClass != null) { 787 } else if (_instance.typeClass != null) {
676 _location = (await _classes.get(_isolate, 788 _location =
677 _instance.typeClass.id)).location; 789 (await _classes.get(_isolate, _instance.typeClass.id)).location;
678 } 790 }
679 _r.dirty(); 791 _r.dirty();
680 } 792 }
681 793
682 Future _toggleBreakpoint() async { 794 Future _toggleBreakpoint() async {
683 if (_instance.activationBreakpoint == null) { 795 if (_instance.activationBreakpoint == null) {
684 await _breakpoints.addOnActivation(_isolate, _instance); 796 await _breakpoints.addOnActivation(_isolate, _instance);
685 } else { 797 } else {
686 await _breakpoints.remove(_isolate, _instance.activationBreakpoint); 798 await _breakpoints.remove(_isolate, _instance.activationBreakpoint);
687 } 799 }
688 await _refresh(); 800 await _refresh();
689 } 801 }
690 } 802 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698