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

Unified Diff: runtime/bin/vmservice/observatory/lib/src/elements/context_ref.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/context_ref.dart
diff --git a/runtime/bin/vmservice/observatory/lib/src/elements/context_ref.dart b/runtime/bin/vmservice/observatory/lib/src/elements/context_ref.dart
new file mode 100644
index 0000000000000000000000000000000000000000..7072e6632c47a876d5f267f079335e013a213ad8
--- /dev/null
+++ b/runtime/bin/vmservice/observatory/lib/src/elements/context_ref.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// 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 context_ref_element;
+
+import 'package:polymer/polymer.dart';
+import 'package:observatory/service.dart';
+import 'service_ref.dart';
+
+@CustomTag('context-ref')
+class ContextRefElement extends ServiceRefElement {
+ ContextRefElement.created() : super.created();
+
+ // TODO(turnidge): This is here to workaround vm/dart2js differences.
+ dynamic expander() {
+ return expandEvent;
+ }
+
+ void expandEvent(bool expand, Function onDone) {
+ assert(ref is Context);
+ if (expand) {
+ ref.reload().then((result) {
+ ref = result;
+ notifyPropertyChange(#ref, 0, 1);
+ }).whenComplete(onDone);
+ } else {
+ Context refMap = ref;
+ refMap.elements = null;
+ onDone();
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698