OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 part of service; | 5 part of service; |
6 | 6 |
7 /// Helper function for canceling a Future<StreamSubscription>. | 7 /// Helper function for canceling a Future<StreamSubscription>. |
8 Future cancelFutureSubscription( | 8 Future cancelFutureSubscription( |
9 Future<StreamSubscription> subscriptionFuture) async { | 9 Future<StreamSubscription> subscriptionFuture) async { |
10 if (subscriptionFuture != null) { | 10 if (subscriptionFuture != null) { |
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 final Isolate isolate; | 929 final Isolate isolate; |
930 | 930 |
931 HeapSnapshot(this.isolate, chunks, nodeCount) : | 931 HeapSnapshot(this.isolate, chunks, nodeCount) : |
932 graph = new ObjectGraph(chunks, nodeCount), | 932 graph = new ObjectGraph(chunks, nodeCount), |
933 timeStamp = new DateTime.now(); | 933 timeStamp = new DateTime.now(); |
934 | 934 |
935 List<Future<ServiceObject>> getMostRetained({int classId, int limit}) { | 935 List<Future<ServiceObject>> getMostRetained({int classId, int limit}) { |
936 var result = []; | 936 var result = []; |
937 for (ObjectVertex v in graph.getMostRetained(classId: classId, | 937 for (ObjectVertex v in graph.getMostRetained(classId: classId, |
938 limit: limit)) { | 938 limit: limit)) { |
939 result.add(isolate.getObjectByAddress(v.address.toRadixString(16)) | 939 result.add(isolate.getObjectByAddress(v.address) |
940 .then((ServiceObject obj) { | 940 .then((ServiceObject obj) { |
941 if (obj is Instance) { | 941 if (obj is Instance) { |
942 // TODO(rmacnak): size/retainedSize are properties of all heap | 942 // TODO(rmacnak): size/retainedSize are properties of all heap |
943 // objects, not just Instances. | 943 // objects, not just Instances. |
944 obj.retainedSize = v.retainedSize; | 944 obj.retainedSize = v.retainedSize; |
945 } | 945 } |
946 return obj; | 946 return obj; |
947 })); | 947 })); |
948 } | 948 } |
949 return result; | 949 return result; |
(...skipping 2606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3556 var v = list[i]; | 3556 var v = list[i]; |
3557 if ((v is ObservableMap) && _isServiceMap(v)) { | 3557 if ((v is ObservableMap) && _isServiceMap(v)) { |
3558 list[i] = owner.getFromMap(v); | 3558 list[i] = owner.getFromMap(v); |
3559 } else if (v is ObservableList) { | 3559 } else if (v is ObservableList) { |
3560 _upgradeObservableList(v, owner); | 3560 _upgradeObservableList(v, owner); |
3561 } else if (v is ObservableMap) { | 3561 } else if (v is ObservableMap) { |
3562 _upgradeObservableMap(v, owner); | 3562 _upgradeObservableMap(v, owner); |
3563 } | 3563 } |
3564 } | 3564 } |
3565 } | 3565 } |
OLD | NEW |