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

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

Issue 2204973003: Converted Observatory class-ref & library-ref elements (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fixed indentation Created 4 years, 4 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 heap_snapshot_element; 5 library heap_snapshot_element;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'class_ref_wrapper.dart';
9 import 'observatory_element.dart'; 10 import 'observatory_element.dart';
10 import 'package:observatory/app.dart'; 11 import 'package:observatory/app.dart';
11 import 'package:observatory/service.dart'; 12 import 'package:observatory/service.dart';
12 import 'package:observatory/elements.dart'; 13 import 'package:observatory/elements.dart';
13 import 'package:observatory/object_graph.dart'; 14 import 'package:observatory/object_graph.dart';
14 import 'package:polymer/polymer.dart'; 15 import 'package:polymer/polymer.dart';
15 import 'package:logging/logging.dart'; 16 import 'package:logging/logging.dart';
16 17
17 class DominatorTreeRow extends TableTreeRow { 18 class DominatorTreeRow extends TableTreeRow {
18 final ObjectVertex vertex; 19 final ObjectVertex vertex;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 percentNode.text = "${vertex.instances} instances of"; 156 percentNode.text = "${vertex.instances} instances of";
156 percentNode.style.minWidth = '5em'; 157 percentNode.style.minWidth = '5em';
157 percentNode.style.textAlign = 'right'; 158 percentNode.style.textAlign = 'right';
158 firstColumn.children.add(percentNode); 159 firstColumn.children.add(percentNode);
159 160
160 var gap = new SpanElement(); 161 var gap = new SpanElement();
161 gap.style.minWidth = '1em'; 162 gap.style.minWidth = '1em';
162 gap.style.display = 'inline-block'; 163 gap.style.display = 'inline-block';
163 firstColumn.children.add(gap); 164 firstColumn.children.add(gap);
164 165
165 ClassRefElement classRef = new Element.tag("class-ref"); 166 ClassRefElementWrapper classRef = new Element.tag("class-ref");
166 classRef.ref = isolate.getClassByCid(vertex.cid); 167 classRef.ref = isolate.getClassByCid(vertex.cid);
167 classRef.style.alignSelf = 'center'; 168 classRef.style.alignSelf = 'center';
168 firstColumn.children.add(classRef); 169 firstColumn.children.add(classRef);
169 170
170 var secondColumn = flexColumns[1]; 171 var secondColumn = flexColumns[1];
171 secondColumn.style.justifyContent = 'flex-end'; 172 secondColumn.style.justifyContent = 'flex-end';
172 secondColumn.style.position = 'relative'; 173 secondColumn.style.position = 'relative';
173 secondColumn.style.alignItems = 'center'; 174 secondColumn.style.alignItems = 'center';
174 secondColumn.style.paddingRight = '0.5em'; 175 secondColumn.style.paddingRight = '0.5em';
175 secondColumn.text = Utils.formatSize(vertex.shallowSize); 176 secondColumn.text = Utils.formatSize(vertex.shallowSize);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 gap.style.minWidth = '1em'; 290 gap.style.minWidth = '1em';
290 gap.style.display = 'inline-block'; 291 gap.style.display = 'inline-block';
291 firstColumn.children.add(gap); 292 firstColumn.children.add(gap);
292 293
293 MergedVertex v = outgoing ? edge.target : edge.source; 294 MergedVertex v = outgoing ? edge.target : edge.source;
294 if (v.cid == 0) { 295 if (v.cid == 0) {
295 var rootName = new SpanElement(); 296 var rootName = new SpanElement();
296 rootName.text = '<root>'; 297 rootName.text = '<root>';
297 firstColumn.children.add(rootName); 298 firstColumn.children.add(rootName);
298 } else { 299 } else {
299 ClassRefElement classRef = new Element.tag("class-ref"); 300 ClassRefElementWrapper classRef = new Element.tag("class-ref");
300 classRef.ref = isolate.getClassByCid(v.cid); 301 classRef.ref = isolate.getClassByCid(v.cid);
301 classRef.style.alignSelf = 'center'; 302 classRef.style.alignSelf = 'center';
302 firstColumn.children.add(classRef); 303 firstColumn.children.add(classRef);
303 } 304 }
304 305
305 var secondColumn = flexColumns[1]; 306 var secondColumn = flexColumns[1];
306 secondColumn.style.justifyContent = 'flex-end'; 307 secondColumn.style.justifyContent = 'flex-end';
307 secondColumn.style.position = 'relative'; 308 secondColumn.style.position = 'relative';
308 secondColumn.style.alignItems = 'center'; 309 secondColumn.style.alignItems = 'center';
309 secondColumn.style.paddingRight = '0.5em'; 310 secondColumn.style.paddingRight = '0.5em';
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 461
461 new Future.delayed(const Duration(milliseconds: 500), () { 462 new Future.delayed(const Duration(milliseconds: 500), () {
462 buildMergedVertices(snapshot.graph).then((vertices) { 463 buildMergedVertices(snapshot.graph).then((vertices) {
463 state = 'Loaded'; 464 state = 'Loaded';
464 var rootRow = new MergedVerticesRow(tree, null, isolate, vertices); 465 var rootRow = new MergedVerticesRow(tree, null, isolate, vertices);
465 tree.initialize(rootRow); 466 tree.initialize(rootRow);
466 }); 467 });
467 }); 468 });
468 } 469 }
469 } 470 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/heap_profile.html ('k') | runtime/observatory/lib/src/elements/heap_snapshot.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698