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

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

Issue 532063002: Teach the Observatory about Contexts. Factor out object graph information from the instance view. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
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 instance_view_element; 5 library object_common_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('instance-view') 12 @CustomTag('object-common')
13 class InstanceViewElement extends ObservatoryElement { 13 class ObjectCommonElement extends ObservatoryElement {
14 @published Instance instance; 14 @published ServiceObject object;
15 @published ServiceMap path; 15 @published ServiceMap path;
16 @published ServiceMap inboundReferences; 16 @published ServiceMap inboundReferences;
17 @observable int retainedBytes = null; 17 @observable int retainedBytes = null;
18 18
19 InstanceViewElement.created() : super.created(); 19 ObjectCommonElement.created() : super.created();
20
21 Future<ServiceObject> eval(String text) {
22 return instance.isolate.get(
23 instance.id + "/eval?expr=${Uri.encodeComponent(text)}");
24 }
25 20
26 // TODO(koda): Add no-arg "calculate-link" instead of reusing "eval-link". 21 // TODO(koda): Add no-arg "calculate-link" instead of reusing "eval-link".
27 Future<ServiceObject> retainedSize(var dummy) { 22 Future<ServiceObject> retainedSize(var dummy) {
28 return instance.isolate.get(instance.id + "/retained") 23 return object.isolate.get(object.id + "/retained")
29 .then((ServiceMap obj) { 24 .then((ServiceMap obj) {
30 retainedBytes = int.parse(obj['valueAsString']); 25 retainedBytes = int.parse(obj['valueAsString']);
31 }); 26 });
32 } 27 }
33 28
34 Future<ServiceObject> retainingPath(var arg) { 29 Future<ServiceObject> retainingPath(var arg) {
35 return instance.isolate.get(instance.id + "/retaining_path?limit=$arg") 30 return object.isolate.get(object.id + "/retaining_path?limit=$arg")
36 .then((ServiceObject obj) { 31 .then((ServiceObject obj) {
37 path = obj; 32 path = obj;
38 }); 33 });
39 } 34 }
40 35
41 Future<ServiceObject> fetchInboundReferences(var arg) { 36 Future<ServiceObject> fetchInboundReferences(var arg) {
42 return instance.isolate.get(instance.id + "/inbound_references?limit=$arg") 37 return object.isolate.get(object.id + "/inbound_references?limit=$arg")
43 .then((ServiceObject obj) { 38 .then((ServiceObject obj) {
44 inboundReferences = obj; 39 inboundReferences = obj;
45 }); 40 });
46 } 41 }
47 42
48 void refresh(var done) { 43 void refresh(Function onDone) {
49 instance.reload().whenComplete(done); 44 object.reload().whenComplete(onDone);
50 } 45 }
51 } 46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698