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

Unified Diff: runtime/observatory/lib/src/elements/objectpool_view.dart

Issue 1212933003: Observatory improvements for exploring compiled code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/observatory/lib/src/elements/objectpool_view.dart
diff --git a/runtime/observatory/lib/src/elements/objectpool_view.dart b/runtime/observatory/lib/src/elements/objectpool_view.dart
new file mode 100644
index 0000000000000000000000000000000000000000..9bc5a4e666184e119af9b94034223dbf0382075c
--- /dev/null
+++ b/runtime/observatory/lib/src/elements/objectpool_view.dart
@@ -0,0 +1,43 @@
+// Copyright (c) 2015, 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 objectpool_view;
+
+import 'dart:async';
+import 'observatory_element.dart';
+import 'package:observatory/service.dart';
+import 'package:polymer/polymer.dart';
+
+@CustomTag('objectpool-view')
+class ObjectPoolViewElement extends ObservatoryElement {
+ @published ObjectPool pool;
+ @published List annotatedEntries;
+
+ ObjectPoolViewElement.created() : super.created();
+
+ bool isServiceObject(o) => o is ServiceObject;
+
+ void poolChanged(oldValue) {
+ annotateRawEntries();
+ }
+
+ Future annotateRawEntries() {
+ var tasks = pool.entries.map((entry) {
+ if (entry is int) {
+ var addr = entry.toRadixString(16);
+ return pool.isolate.getObjectByAddress(addr).then((result) {
+ return result is ServiceObject ? result : null;
+ });
+ } else {
+ return new Future.value(null);
+ }
+ });
+
+ return Future.wait(tasks).then((results) => annotatedEntries = results);
+ }
+
+ Future refresh() {
+ return pool.reload().then((_) => annotateRawEntries());
+ }
+}
« no previous file with comments | « runtime/observatory/lib/src/elements/instructions_view.html ('k') | runtime/observatory/lib/src/elements/objectpool_view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698