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

Unified Diff: runtime/bin/vmservice/client/lib/src/elements/io_view.dart

Issue 307503002: Add processes to Observatory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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/elements/io_view.dart
diff --git a/runtime/bin/vmservice/client/lib/src/elements/io_view.dart b/runtime/bin/vmservice/client/lib/src/elements/io_view.dart
index 24c137a6d445a0cd0ae231c905e04fe9bd964986..0016d8347f60ec5bc09e60b8f4b146bd6196b288 100644
--- a/runtime/bin/vmservice/client/lib/src/elements/io_view.dart
+++ b/runtime/bin/vmservice/client/lib/src/elements/io_view.dart
@@ -149,3 +149,56 @@ class IORandomAccessFileViewElement extends ObservatoryElement {
}
}
}
+
+@CustomTag('io-process-list-view')
+class IOProcessListViewElement extends ObservatoryElement {
+ @published ServiceMap list;
+
+ IOProcessListViewElement.created() : super.created();
+
+ void refresh(var done) {
+ list.reload().whenComplete(done);
+ }
+}
+
+@CustomTag('io-process-ref')
+class IOProcessRefElement extends ServiceRefElement {
+ // Only display the process name when small is set.
+ @published bool small = false;
+ IOProcessRefElement.created() : super.created();
+}
+
+@CustomTag('io-process-view')
+class IOProcessViewElement extends ObservatoryElement {
+ // TODO(ajohnsen): Create a Process object.
+ @published ServiceMap process;
+ Timer _updateTimer;
+
+ IOProcessViewElement.created() : super.created();
+
+ void refresh(var done) {
+ process.reload().whenComplete(done);
+ }
+
+ void _updateFile() {
+ refresh(() {
+ if (_updateTimer != null) {
+ _updateTimer = new Timer(new Duration(seconds: 1), _updateFile);
+ }
+ });
+ }
+
+ void enteredView() {
+ super.enteredView();
+ // Start a timer to update the isolate summary once a second.
+ _updateTimer = new Timer(new Duration(seconds: 1), _updateFile);
+ }
+
+ void leftView() {
+ super.leftView();
+ if (_updateTimer != null) {
+ _updateTimer.cancel();
+ _updateTimer = null;
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698