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

Unified Diff: runtime/bin/vmservice/client/lib/src/observatory_elements/instance_ref.dart

Issue 164183003: Add expandable instances and lists to the vm service. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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/client/lib/src/observatory_elements/instance_ref.dart
diff --git a/runtime/bin/vmservice/client/lib/src/observatory_elements/instance_ref.dart b/runtime/bin/vmservice/client/lib/src/observatory_elements/instance_ref.dart
index 7f5368fde62ea5962fb73b7cacb33c3134887d4e..e50722300fa0914f2c1172a2d1dd01596e34aaef 100644
--- a/runtime/bin/vmservice/client/lib/src/observatory_elements/instance_ref.dart
+++ b/runtime/bin/vmservice/client/lib/src/observatory_elements/instance_ref.dart
@@ -11,10 +11,30 @@ import 'service_ref.dart';
class InstanceRefElement extends ServiceRefElement {
InstanceRefElement.created() : super.created();
+ @published bool expanded = false;
+
String get name {
if (ref == null) {
return super.name;
}
return ref['preview'];
}
-}
+
+ void toggleExpand(var a, var b, var c) {
+ if (expanded) {
+ ref['fields'] = null;
+ ref['elements'] = null;
+ expanded = false;
+ } else {
+ app.requestManager.requestMap(url.substring(1)).then((map) {
Cutch 2014/02/13 22:31:29 Could you change requestMap to detect if the url s
turnidge 2014/02/14 17:36:47 Done. I find myself wondering if it would be bett
+ print(map);
+ ref['fields'] = map['fields'];
+ ref['elements'] = map['elements'];
+ ref['length'] = map['length'];
+ expanded = true;
+ }).catchError((e, trace) {
+ Logger.root.severe('Error while expanding instance-ref: $e\n$trace');
+ });
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698