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

Side by Side Diff: runtime/observatory/lib/src/elements/class_view.dart

Issue 2271653003: Fixed crash during retainedTopList computation (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 'sample_buffer_control.dart'; 9 import 'sample_buffer_control.dart';
10 import 'stack_trace_tree_config.dart'; 10 import 'stack_trace_tree_config.dart';
(...skipping 23 matching lines...) Expand all
34 Future<ServiceObject> evaluate(String expression) { 34 Future<ServiceObject> evaluate(String expression) {
35 return cls.evaluate(expression); 35 return cls.evaluate(expression);
36 } 36 }
37 37
38 Future<ServiceObject> reachable(var limit) { 38 Future<ServiceObject> reachable(var limit) {
39 return cls.isolate.getInstances(cls, limit).then((ServiceMap obj) { 39 return cls.isolate.getInstances(cls, limit).then((ServiceMap obj) {
40 instances = obj; 40 instances = obj;
41 }); 41 });
42 } 42 }
43 43
44 Future<ServiceObject> retainedToplist(var limit) { 44 Future retainedToplist(var limit) async {
45 return cls.isolate.fetchHeapSnapshot(true).last 45 final raw = await cls.isolate.fetchHeapSnapshot(true).last;
46 .then((RawHeapSnapshot raw) async { 46 final snapshot = new HeapSnapshot();
47 final snapshot = new HeapSnapshot(); 47 await snapshot.loadProgress(cls.isolate, raw).last;
48 await snapshot.loadProgress(cls.isolate, raw); 48 final most = await Future.wait(snapshot.getMostRetained(cls.isolate,
49 return snapshot; 49 classId: cls.vmCid ,
50 }) 50 limit: 10));
51 .then((HeapSnapshot snapshot) => 51 mostRetained = new ObservableList.from(most);
52 Future.wait(snapshot.getMostRetained(cls.isolate, classId: cls.vmCid,
53 limit: 10)))
54 .then((List<ServiceObject> most) {
55 mostRetained = new ObservableList.from(most);
56 });
57 } 52 }
58 53
59 // TODO(koda): Add no-arg "calculate-link" instead of reusing "eval-link". 54 // TODO(koda): Add no-arg "calculate-link" instead of reusing "eval-link".
60 Future<ServiceObject> reachableSize(var dummy) { 55 Future<ServiceObject> reachableSize(var dummy) {
61 return cls.isolate.getReachableSize(cls).then((Instance obj) { 56 return cls.isolate.getReachableSize(cls).then((Instance obj) {
62 reachableBytes = int.parse(obj.valueAsString); 57 reachableBytes = int.parse(obj.valueAsString);
63 }); 58 });
64 } 59 }
65 60
66 Future<ServiceObject> retainedSize(var dummy) { 61 Future<ServiceObject> retainedSize(var dummy) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 Future toggleAllocationTrace() { 118 Future toggleAllocationTrace() {
124 if (cls == null) { 119 if (cls == null) {
125 return new Future(refresh); 120 return new Future(refresh);
126 } 121 }
127 if (cls.traceAllocations) { 122 if (cls.traceAllocations) {
128 refreshAllocationProfile(); 123 refreshAllocationProfile();
129 } 124 }
130 return cls.setTraceAllocations(!cls.traceAllocations).whenComplete(refresh); 125 return cls.setTraceAllocations(!cls.traceAllocations).whenComplete(refresh);
131 } 126 }
132 } 127 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698