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

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

Issue 823403004: Begin migrating the vm service from a rest-style interface to a json-rpc style interface. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove old-style standalone tests. Created 5 years, 11 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
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 1f37c234187111f3eed73511ddc18b181fcae3e0..2e36c2dc40cbd87463bce9241b3f5fe3fcfac442 100644
--- a/runtime/observatory/lib/src/elements/heap_map.dart
+++ b/runtime/observatory/lib/src/elements/heap_map.dart
@@ -66,7 +66,8 @@ class HeapMapElement extends ObservatoryElement {
static const _MAX_CANVAS_HEIGHT = 6000;
@observable String status;
- @published ServiceMap fragmentation;
+ @published Isolate isolate;
+ @observable ServiceMap fragmentation;
HeapMapElement.created() : super.created() {
}
@@ -97,7 +98,11 @@ class HeapMapElement extends ObservatoryElement {
void _updateClassList(classList, int freeClassId) {
for (var member in classList['members']) {
if (member is! Class) {
- Logger.root.info('$member');
+ // TODO(turnidge): The printing for some of these non-class
+ // members is broken. Fix this:
+ //
+ // Logger.root.info('$member');
+ Logger.root.info('Ignoring non-class in class list');
continue;
}
var classId = int.parse(member.id.split('/').last);
@@ -156,7 +161,7 @@ class HeapMapElement extends ObservatoryElement {
void _handleClick(MouseEvent event) {
var address = _objectAt(event.offset).address.toRadixString(16);
app.locationManager.go(app.locationManager.makeLink(
- "${fragmentation.isolate.relativeLink('address/$address')}"));
+ "${isolate.relativeLink('address/$address')}"));
}
void _updateFragmentationData() {
@@ -211,11 +216,24 @@ class HeapMapElement extends ObservatoryElement {
});
}
+ void isolateChanged(oldValue) {
+ if (isolate == null) {
+ fragmentation = null;
+ return;
+ }
+ isolate.invokeRpc('getHeapMap', {}).then((ServiceMap response) {
+ assert(response['type'] == 'HeapMap');
+ fragmentation = response;
+ }).catchError((e, st) {
+ Logger.root.info('$e $st');
+ });
+ }
+
void refresh(var done) {
- if (fragmentation == null) {
+ if (isolate == null) {
return;
}
- fragmentation.isolate.get('heapmap').then((ServiceMap response) {
+ isolate.invokeRpc('getHeapMap', {}).then((ServiceMap response) {
assert(response['type'] == 'HeapMap');
fragmentation = response;
}).catchError((e, st) {
@@ -229,4 +247,4 @@ class HeapMapElement extends ObservatoryElement {
_updateFragmentationData();
});
}
-}
+}
« no previous file with comments | « runtime/observatory/lib/src/elements/debugger.html ('k') | runtime/observatory/lib/src/elements/heap_profile.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698