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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library io_view_element; 5 library io_view_element;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'observatory_element.dart'; 8 import 'observatory_element.dart';
9 import 'service_ref.dart'; 9 import 'service_ref.dart';
10 import 'package:observatory/service.dart'; 10 import 'package:observatory/service.dart';
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 void leftView() { 71 void leftView() {
72 super.leftView(); 72 super.leftView();
73 if (_updateTimer != null) { 73 if (_updateTimer != null) {
74 _updateTimer.cancel(); 74 _updateTimer.cancel();
75 _updateTimer = null; 75 _updateTimer = null;
76 } 76 }
77 } 77 }
78 } 78 }
79 79
80 @CustomTag('io-http-server-connection-view')
81 class IOHttpServerConnectionViewElement extends ObservatoryElement {
82 @published ServiceMap connection;
83 Timer _updateTimer;
84
85 IOHttpServerConnectionViewElement.created() : super.created();
86
87 void refresh(var done) {
88 connection.reload().whenComplete(done);
89 }
90
91 void _updateHttpServer() {
92 refresh(() {
93 if (_updateTimer != null) {
94 _updateTimer = new Timer(new Duration(seconds: 1), _updateHttpServer);
95 }
96 });
97 }
98
99 void enteredView() {
100 super.enteredView();
101 // Start a timer to update the isolate summary once a second.
102 _updateTimer = new Timer(new Duration(seconds: 1), _updateHttpServer);
103 }
104
105 void leftView() {
106 super.leftView();
107 if (_updateTimer != null) {
108 _updateTimer.cancel();
109 _updateTimer = null;
110 }
111 }
112 }
113
114 @CustomTag('io-http-server-connection-ref')
115 class IOHttpServerConnectionRefElement extends ServiceRefElement {
116 IOHttpServerConnectionRefElement.created() : super.created();
117 }
118
80 @CustomTag('io-socket-ref') 119 @CustomTag('io-socket-ref')
81 class IOSocketRefElement extends ServiceRefElement { 120 class IOSocketRefElement extends ServiceRefElement {
82 IOSocketRefElement.created() : super.created(); 121 IOSocketRefElement.created() : super.created();
83 } 122 }
84 123
85 @CustomTag('io-socket-list-view') 124 @CustomTag('io-socket-list-view')
86 class IOSocketListViewElement extends ObservatoryElement { 125 class IOSocketListViewElement extends ObservatoryElement {
87 @published ServiceMap list; 126 @published ServiceMap list;
88 127
89 IOSocketListViewElement.created() : super.created(); 128 IOSocketListViewElement.created() : super.created();
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 } 266 }
228 267
229 void leftView() { 268 void leftView() {
230 super.leftView(); 269 super.leftView();
231 if (_updateTimer != null) { 270 if (_updateTimer != null) {
232 _updateTimer.cancel(); 271 _updateTimer.cancel();
233 _updateTimer = null; 272 _updateTimer = null;
234 } 273 }
235 } 274 }
236 } 275 }
OLDNEW
« 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