| Index: runtime/bin/vmservice/client/lib/src/elements/heap_profile.dart
|
| diff --git a/runtime/bin/vmservice/client/lib/src/observatory_elements/heap_profile.dart b/runtime/bin/vmservice/client/lib/src/elements/heap_profile.dart
|
| similarity index 91%
|
| rename from runtime/bin/vmservice/client/lib/src/observatory_elements/heap_profile.dart
|
| rename to runtime/bin/vmservice/client/lib/src/elements/heap_profile.dart
|
| index e281a0720e365990c91901e664e1a4529722c367..b7c60630c4a1e201e812a9d1e71d534bf7a533c3 100644
|
| --- a/runtime/bin/vmservice/client/lib/src/observatory_elements/heap_profile.dart
|
| +++ b/runtime/bin/vmservice/client/lib/src/elements/heap_profile.dart
|
| @@ -5,13 +5,14 @@
|
| library heap_profile_element;
|
|
|
| import 'dart:html';
|
| +import 'isolate_element.dart';
|
| import 'package:logging/logging.dart';
|
| import 'package:polymer/polymer.dart';
|
| -import 'observatory_element.dart';
|
| +import 'package:observatory/app.dart';
|
|
|
| /// Displays an Error response.
|
| @CustomTag('heap-profile')
|
| -class HeapProfileElement extends ObservatoryElement {
|
| +class HeapProfileElement extends IsolateElement {
|
| // Indexes into VM provided map.
|
| static const ALLOCATED_BEFORE_GC = 0;
|
| static const ALLOCATED_BEFORE_GC_SIZE = 1;
|
| @@ -105,8 +106,7 @@ class HeapProfileElement extends ObservatoryElement {
|
| continue;
|
| }
|
| var vm_name = cls['class']['name'];
|
| - var url =
|
| - app.locationManager.currentIsolateRelativeLink(cls['class']['id']);
|
| + var url = isolate.relativeLink(cls['class']['id']);
|
| _fullDataTable.addRow([
|
| '<a title="$vm_name" href="$url">'
|
| '${_fullTableColumnValue(cls, 0)}</a>',
|
| @@ -223,14 +223,7 @@ class HeapProfileElement extends ObservatoryElement {
|
| }
|
|
|
| void refresh(var done) {
|
| - var isolateId = app.locationManager.currentIsolateId();
|
| - var isolate = app.isolateManager.getIsolate(isolateId);
|
| - if (isolate == null) {
|
| - Logger.root.info('No isolate found.');
|
| - return;
|
| - }
|
| - var request = '/$isolateId/allocationprofile';
|
| - app.requestManager.requestMap(request).then((Map response) {
|
| + isolate.getMap('/allocationprofile').then((Map response) {
|
| assert(response['type'] == 'AllocationProfile');
|
| profile = response;
|
| }).catchError((e, st) {
|
| @@ -239,14 +232,7 @@ class HeapProfileElement extends ObservatoryElement {
|
| }
|
|
|
| void resetAccumulator(Event e, var detail, Node target) {
|
| - var isolateId = app.locationManager.currentIsolateId();
|
| - var isolate = app.isolateManager.getIsolate(isolateId);
|
| - if (isolate == null) {
|
| - Logger.root.info('No isolate found.');
|
| - return;
|
| - }
|
| - var request = '/$isolateId/allocationprofile/reset';
|
| - app.requestManager.requestMap(request).then((Map response) {
|
| + isolate.getMap('/allocationprofile/reset').then((Map response) {
|
| assert(response['type'] == 'AllocationProfile');
|
| profile = response;
|
| }).catchError((e, st) {
|
|
|