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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/vmservice/observatory/lib/src/elements/object_common.dart
diff --git a/runtime/bin/vmservice/observatory/lib/src/elements/instance_view.dart b/runtime/bin/vmservice/observatory/lib/src/elements/object_common.dart
similarity index 61%
copy from runtime/bin/vmservice/observatory/lib/src/elements/instance_view.dart
copy to runtime/bin/vmservice/observatory/lib/src/elements/object_common.dart
index ae7fca9f3e0e34182187e388f31322b97c70022c..b1814e4acca48805e6681d9db0d53bdb864ef009 100644
--- a/runtime/bin/vmservice/observatory/lib/src/elements/instance_view.dart
+++ b/runtime/bin/vmservice/observatory/lib/src/elements/object_common.dart
@@ -2,50 +2,45 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library instance_view_element;
+library object_common_element;
import 'dart:async';
import 'observatory_element.dart';
import 'package:observatory/service.dart';
import 'package:polymer/polymer.dart';
-@CustomTag('instance-view')
-class InstanceViewElement extends ObservatoryElement {
- @published Instance instance;
+@CustomTag('object-common')
+class ObjectCommonElement extends ObservatoryElement {
+ @published ServiceObject object;
@published ServiceMap path;
@published ServiceMap inboundReferences;
@observable int retainedBytes = null;
- InstanceViewElement.created() : super.created();
-
- Future<ServiceObject> eval(String text) {
- return instance.isolate.get(
- instance.id + "/eval?expr=${Uri.encodeComponent(text)}");
- }
+ ObjectCommonElement.created() : super.created();
// TODO(koda): Add no-arg "calculate-link" instead of reusing "eval-link".
Future<ServiceObject> retainedSize(var dummy) {
- return instance.isolate.get(instance.id + "/retained")
+ return object.isolate.get(object.id + "/retained")
.then((ServiceMap obj) {
retainedBytes = int.parse(obj['valueAsString']);
});
}
Future<ServiceObject> retainingPath(var arg) {
- return instance.isolate.get(instance.id + "/retaining_path?limit=$arg")
+ return object.isolate.get(object.id + "/retaining_path?limit=$arg")
.then((ServiceObject obj) {
path = obj;
});
}
Future<ServiceObject> fetchInboundReferences(var arg) {
- return instance.isolate.get(instance.id + "/inbound_references?limit=$arg")
+ return object.isolate.get(object.id + "/inbound_references?limit=$arg")
.then((ServiceObject obj) {
inboundReferences = obj;
});
}
- void refresh(var done) {
- instance.reload().whenComplete(done);
+ void refresh(Function onDone) {
+ object.reload().whenComplete(onDone);
}
}

Powered by Google App Engine
This is Rietveld 408576698