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

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

Issue 291343009: Add initial Random Access File information to Observatory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 _updateTimer = new Timer(new Duration(seconds: 1), _updateHttpServer); 63 _updateTimer = new Timer(new Duration(seconds: 1), _updateHttpServer);
64 } 64 }
65 65
66 void leftView() { 66 void leftView() {
67 super.leftView(); 67 super.leftView();
68 if (_updateTimer != null) { 68 if (_updateTimer != null) {
69 _updateTimer.cancel(); 69 _updateTimer.cancel();
70 _updateTimer = null; 70 _updateTimer = null;
71 } 71 }
72 } 72 }
73 } 73 }
74
75 @CustomTag('io-random-access-file-list-view')
76 class IORandomAccessFileListViewElement extends ObservatoryElement {
77 @published ServiceMap list;
78
79 IORandomAccessFileListViewElement.created() : super.created();
80
81 void refresh(var done) {
82 list.reload().whenComplete(done);
83 }
84 }
85
86 @CustomTag('io-random-access-file-ref')
87 class IORandomAccessFileRefElement extends ServiceRefElement {
88 IORandomAccessFileRefElement.created() : super.created();
89 }
90
91 @CustomTag('io-random-access-file-view')
92 class IORandomAccessFileViewElement extends ObservatoryElement {
93 // TODO(ajohnsen): Create a RandomAccessFile object.
94 @published ServiceMap file;
95 Timer _updateTimer;
96
97 IORandomAccessFileViewElement.created() : super.created();
98
99 void refresh(var done) {
100 file.reload().whenComplete(done);
101 }
102
103 void _updateFile() {
104 refresh(() {
105 if (_updateTimer != null) {
106 _updateTimer = new Timer(new Duration(seconds: 1), _updateFile);
107 }
108 });
109 }
110
111 void enteredView() {
112 super.enteredView();
113 // Start a timer to update the isolate summary once a second.
114 _updateTimer = new Timer(new Duration(seconds: 1), _updateFile);
115 }
116
117 void leftView() {
118 super.leftView();
119 if (_updateTimer != null) {
120 _updateTimer.cancel();
121 _updateTimer = null;
122 }
123 }
124 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698