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

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

Issue 552903002: Fix UI for retained size of a class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: sync and build Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « runtime/bin/vmservice/observatory/deployed/web/packages/web_components/platform.js ('k') | 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 'package:observatory/service.dart'; 9 import 'package:observatory/service.dart';
10 import 'package:polymer/polymer.dart'; 10 import 'package:polymer/polymer.dart';
11 11
12 @CustomTag('class-view') 12 @CustomTag('class-view')
13 class ClassViewElement extends ObservatoryElement { 13 class ClassViewElement extends ObservatoryElement {
14 @published Class cls; 14 @published Class cls;
15 @observable ServiceMap instances; 15 @observable ServiceMap instances;
16 @observable int retainedBytes; 16 @observable int retainedBytes;
17 ClassViewElement.created() : super.created(); 17 ClassViewElement.created() : super.created();
18 18
19 Future<ServiceObject> eval(String text) { 19 Future<ServiceObject> eval(String text) {
20 return cls.get("eval?expr=${Uri.encodeComponent(text)}"); 20 return cls.get("eval?expr=${Uri.encodeComponent(text)}");
21 } 21 }
22 22
23 Future<ServiceObject> reachable(var limit) { 23 Future<ServiceObject> reachable(var limit) {
24 return cls.get("instances?limit=$limit") 24 return cls.get("instances?limit=$limit")
25 .then((ServiceMap obj) { 25 .then((ServiceMap obj) {
26 instances = obj; 26 instances = obj;
27 }); 27 });
28 } 28 }
29 29
30 // TODO(koda): Add no-arg "calculate-link" instead of reusing "eval-link". 30 // TODO(koda): Add no-arg "calculate-link" instead of reusing "eval-link".
31 Future<ServiceObject> retainedSize(var dummy) { 31 Future<ServiceObject> retainedSize(var dummy) {
32 return cls.get("retained") 32 return cls.get("retained").then((Instance obj) {
33 .then((ServiceMap obj) { 33 retainedBytes = int.parse(obj.valueAsString);
34 retainedBytes = int.parse(obj['valueAsString']); 34 });
35 });
36 } 35 }
37 36
38 void refresh(var done) { 37 void refresh(var done) {
39 instances = null; 38 instances = null;
40 retainedBytes = null; 39 retainedBytes = null;
41 cls.reload().whenComplete(done); 40 cls.reload().whenComplete(done);
42 } 41 }
43 42
44 void refreshCoverage(var done) { 43 void refreshCoverage(var done) {
45 cls.refreshCoverage().whenComplete(done); 44 cls.refreshCoverage().whenComplete(done);
46 } 45 }
47 } 46 }
OLDNEW
« no previous file with comments | « runtime/bin/vmservice/observatory/deployed/web/packages/web_components/platform.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698