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/service.dart'; | 9 import 'package:observatory/service.dart'; |
10 import 'package:polymer/polymer.dart'; | 10 import 'package:polymer/polymer.dart'; |
(...skipping 26 matching lines...) Expand all Loading... |
37 }); | 37 }); |
38 } | 38 } |
39 | 39 |
40 // TODO(koda): Add no-arg "calculate-link" instead of reusing "eval-link". | 40 // TODO(koda): Add no-arg "calculate-link" instead of reusing "eval-link". |
41 Future<ServiceObject> retainedSize(var dummy) { | 41 Future<ServiceObject> retainedSize(var dummy) { |
42 return cls.isolate.getRetainedSize(cls).then((Instance obj) { | 42 return cls.isolate.getRetainedSize(cls).then((Instance obj) { |
43 retainedBytes = int.parse(obj.valueAsString); | 43 retainedBytes = int.parse(obj.valueAsString); |
44 }); | 44 }); |
45 } | 45 } |
46 | 46 |
| 47 void attached() { |
| 48 library.variables.forEach((variable) => variable.reload()); |
| 49 } |
| 50 |
47 Future refresh() { | 51 Future refresh() { |
48 // TODO(turnidge): Reload all static fields as well, so we can detect | |
49 // changes to their values. | |
50 instances = null; | 52 instances = null; |
51 retainedBytes = null; | 53 retainedBytes = null; |
52 mostRetained = null; | 54 mostRetained = null; |
53 return cls.reload(); | 55 var loads = []; |
| 56 loads.add(cls.reload()); |
| 57 cls.variables.forEach((variable) => loads.add(variable.reload())); |
| 58 return Future.wait(loads); |
54 } | 59 } |
55 | 60 |
56 Future refreshCoverage() { | 61 Future refreshCoverage() { |
57 return cls.refreshCoverage(); | 62 return cls.refreshCoverage(); |
58 } | 63 } |
59 } | 64 } |
OLD | NEW |