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

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

Issue 302173007: Add HttpServerConnection to Observatory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add test. Created 6 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
« no previous file with comments | « runtime/bin/service_object_patch.dart ('k') | runtime/bin/vmservice/client/lib/src/elements/io_view.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9e93387e4137c5a295a285cac7b8e102450f770b..c0196b240c0860f51656bcb41926a26f344cdd99 100644
--- a/runtime/bin/vmservice/client/lib/src/elements/io_view.dart
+++ b/runtime/bin/vmservice/client/lib/src/elements/io_view.dart
@@ -77,6 +77,45 @@ class IOHttpServerViewElement extends ObservatoryElement {
}
}
+@CustomTag('io-http-server-connection-view')
+class IOHttpServerConnectionViewElement extends ObservatoryElement {
+ @published ServiceMap connection;
+ Timer _updateTimer;
+
+ IOHttpServerConnectionViewElement.created() : super.created();
+
+ void refresh(var done) {
+ connection.reload().whenComplete(done);
+ }
+
+ void _updateHttpServer() {
+ refresh(() {
+ if (_updateTimer != null) {
+ _updateTimer = new Timer(new Duration(seconds: 1), _updateHttpServer);
+ }
+ });
+ }
+
+ void enteredView() {
+ super.enteredView();
+ // Start a timer to update the isolate summary once a second.
+ _updateTimer = new Timer(new Duration(seconds: 1), _updateHttpServer);
+ }
+
+ void leftView() {
+ super.leftView();
+ if (_updateTimer != null) {
+ _updateTimer.cancel();
+ _updateTimer = null;
+ }
+ }
+}
+
+@CustomTag('io-http-server-connection-ref')
+class IOHttpServerConnectionRefElement extends ServiceRefElement {
+ IOHttpServerConnectionRefElement.created() : super.created();
+}
+
@CustomTag('io-socket-ref')
class IOSocketRefElement extends ServiceRefElement {
IOSocketRefElement.created() : super.created();
« no previous file with comments | « runtime/bin/service_object_patch.dart ('k') | runtime/bin/vmservice/client/lib/src/elements/io_view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698