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

Unified Diff: runtime/observatory/lib/src/elements/heap_map.dart

Issue 1291873002: Fix heap map (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/heap_map.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/elements/heap_map.dart
diff --git a/runtime/observatory/lib/src/elements/heap_map.dart b/runtime/observatory/lib/src/elements/heap_map.dart
index 7b7be4fbc8d4651285e4f57fb476c3df98a6b62e..a91e3166162024188bc2340a7cc243b7763f2a5c 100644
--- a/runtime/observatory/lib/src/elements/heap_map.dart
+++ b/runtime/observatory/lib/src/elements/heap_map.dart
@@ -51,7 +51,7 @@ class ObjectInfo {
@CustomTag('heap-map')
class HeapMapElement extends ObservatoryElement {
- var _fragmentationCanvas;
+ CanvasElement _fragmentationCanvas;
var _fragmentationData;
var _pageHeight;
var _classIdToColor = {};
@@ -125,6 +125,9 @@ class HeapMapElement extends ObservatoryElement {
}
ObjectInfo _objectAt(Point<int> point) {
+ if (fragmentation == null || _fragmentationCanvas == null) {
+ return null;
+ }
var pagePixels = _pageHeight * _fragmentationData.width;
var index = new PixelReference(_fragmentationData, point).index;
var pageIndex = index ~/ pagePixels;
@@ -153,6 +156,10 @@ class HeapMapElement extends ObservatoryElement {
void _handleMouseMove(MouseEvent event) {
var info = _objectAt(event.offset);
+ if (info == null) {
+ status = '';
+ return;
+ }
var addressString = '${info.size}B @ 0x${info.address.toRadixString(16)}';
var className = _classNameAt(event.offset);
status = (className == '') ? '-' : '$className $addressString';
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/heap_map.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698