| OLD | NEW |
| 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 class_view_element; | 5 library class_view_element; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'observatory_element.dart'; | 8 import 'observatory_element.dart'; |
| 9 import 'package:observatory/cpu_profile.dart'; | 9 import 'package:observatory/cpu_profile.dart'; |
| 10 import 'package:observatory/elements.dart'; | 10 import 'package:observatory/elements.dart'; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 return cls.evaluate(expression); | 28 return cls.evaluate(expression); |
| 29 } | 29 } |
| 30 | 30 |
| 31 Future<ServiceObject> reachable(var limit) { | 31 Future<ServiceObject> reachable(var limit) { |
| 32 return cls.isolate.getInstances(cls, limit).then((ServiceMap obj) { | 32 return cls.isolate.getInstances(cls, limit).then((ServiceMap obj) { |
| 33 instances = obj; | 33 instances = obj; |
| 34 }); | 34 }); |
| 35 } | 35 } |
| 36 | 36 |
| 37 Future<ServiceObject> retainedToplist(var limit) { | 37 Future<ServiceObject> retainedToplist(var limit) { |
| 38 return cls.isolate.fetchHeapSnapshot().last | 38 return cls.isolate.fetchHeapSnapshot(true).last |
| 39 .then((HeapSnapshot snapshot) => | 39 .then((HeapSnapshot snapshot) => |
| 40 Future.wait(snapshot.getMostRetained(classId: cls.vmCid, | 40 Future.wait(snapshot.getMostRetained(classId: cls.vmCid, |
| 41 limit: 10))) | 41 limit: 10))) |
| 42 .then((List<ServiceObject> most) { | 42 .then((List<ServiceObject> most) { |
| 43 mostRetained = new ObservableList.from(most); | 43 mostRetained = new ObservableList.from(most); |
| 44 }); | 44 }); |
| 45 } | 45 } |
| 46 | 46 |
| 47 // TODO(koda): Add no-arg "calculate-link" instead of reusing "eval-link". | 47 // TODO(koda): Add no-arg "calculate-link" instead of reusing "eval-link". |
| 48 Future<ServiceObject> reachableSize(var dummy) { | 48 Future<ServiceObject> reachableSize(var dummy) { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 return sampleBufferControlElement.reload(cls.isolate); | 112 return sampleBufferControlElement.reload(cls.isolate); |
| 113 } | 113 } |
| 114 | 114 |
| 115 Future toggleAllocationTrace() { | 115 Future toggleAllocationTrace() { |
| 116 if (cls == null) { | 116 if (cls == null) { |
| 117 return new Future(refresh); | 117 return new Future(refresh); |
| 118 } | 118 } |
| 119 return cls.setTraceAllocations(!cls.traceAllocations).whenComplete(refresh); | 119 return cls.setTraceAllocations(!cls.traceAllocations).whenComplete(refresh); |
| 120 } | 120 } |
| 121 } | 121 } |
| OLD | NEW |