| 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);
|
| }
|
| }
|
|
|