OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * TimelineView displays a zoomable and scrollable graph of a number of values | 6 * TimelineView displays a zoomable and scrollable graph of a number of values |
7 * over time. The TimelineView class itself is responsible primarily for | 7 * over time. The TimelineView class itself is responsible primarily for |
8 * updating the TimelineDataSeries its GraphView displays. | 8 * updating the TimelineDataSeries its GraphView displays. |
9 */ | 9 */ |
10 var TimelineView = (function() { | 10 var TimelineView = (function() { |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 183 |
184 /** | 184 /** |
185 * Recreate all DataSeries. Global constants must have been set before | 185 * Recreate all DataSeries. Global constants must have been set before |
186 * this is called. | 186 * this is called. |
187 */ | 187 */ |
188 createDataSeries_: function() { | 188 createDataSeries_: function() { |
189 this.graphRangeInitialized_ = false; | 189 this.graphRangeInitialized_ = false; |
190 this.dataSeries_ = []; | 190 this.dataSeries_ = []; |
191 | 191 |
192 this.addDataSeries_(new SourceCountDataSeries( | 192 this.addDataSeries_(new SourceCountDataSeries( |
193 LogSourceType.SOCKET, | 193 EventSourceType.SOCKET, |
194 LogEventType.SOCKET_ALIVE), | 194 EventType.SOCKET_ALIVE), |
195 TimelineView.OPEN_SOCKETS_ID); | 195 TimelineView.OPEN_SOCKETS_ID); |
196 | 196 |
197 this.addDataSeries_(new SocketsInUseDataSeries(), | 197 this.addDataSeries_(new SocketsInUseDataSeries(), |
198 TimelineView.IN_USE_SOCKETS_ID); | 198 TimelineView.IN_USE_SOCKETS_ID); |
199 | 199 |
200 this.addDataSeries_(new SourceCountDataSeries( | 200 this.addDataSeries_(new SourceCountDataSeries( |
201 LogSourceType.URL_REQUEST, | 201 EventSourceType.URL_REQUEST, |
202 LogEventType.REQUEST_ALIVE), | 202 EventType.REQUEST_ALIVE), |
203 TimelineView.URL_REQUESTS_ID); | 203 TimelineView.URL_REQUESTS_ID); |
204 | 204 |
205 this.addDataSeries_(new SourceCountDataSeries( | 205 this.addDataSeries_(new SourceCountDataSeries( |
206 LogSourceType.HOST_RESOLVER_IMPL_REQUEST, | 206 EventSourceType.HOST_RESOLVER_IMPL_REQUEST, |
207 LogEventType.HOST_RESOLVER_IMPL_REQUEST), | 207 EventType.HOST_RESOLVER_IMPL_REQUEST), |
208 TimelineView.DNS_REQUESTS_ID); | 208 TimelineView.DNS_REQUESTS_ID); |
209 | 209 |
210 this.addDataSeries_(new NetworkTransferRateDataSeries( | 210 this.addDataSeries_(new NetworkTransferRateDataSeries( |
211 LogEventType.SOCKET_BYTES_RECEIVED, | 211 EventType.SOCKET_BYTES_RECEIVED, |
212 LogEventType.UDP_BYTES_RECEIVED), | 212 EventType.UDP_BYTES_RECEIVED), |
213 TimelineView.BYTES_RECEIVED_ID); | 213 TimelineView.BYTES_RECEIVED_ID); |
214 | 214 |
215 this.addDataSeries_(new NetworkTransferRateDataSeries( | 215 this.addDataSeries_(new NetworkTransferRateDataSeries( |
216 LogEventType.SOCKET_BYTES_SENT, | 216 EventType.SOCKET_BYTES_SENT, |
217 LogEventType.UDP_BYTES_SENT), | 217 EventType.UDP_BYTES_SENT), |
218 TimelineView.BYTES_SENT_ID); | 218 TimelineView.BYTES_SENT_ID); |
219 | 219 |
220 this.addDataSeries_(new DiskCacheTransferRateDataSeries( | 220 this.addDataSeries_(new DiskCacheTransferRateDataSeries( |
221 LogEventType.ENTRY_READ_DATA), | 221 EventType.ENTRY_READ_DATA), |
222 TimelineView.DISK_CACHE_BYTES_READ_ID); | 222 TimelineView.DISK_CACHE_BYTES_READ_ID); |
223 | 223 |
224 this.addDataSeries_(new DiskCacheTransferRateDataSeries( | 224 this.addDataSeries_(new DiskCacheTransferRateDataSeries( |
225 LogEventType.ENTRY_WRITE_DATA), | 225 EventType.ENTRY_WRITE_DATA), |
226 TimelineView.DISK_CACHE_BYTES_WRITTEN_ID); | 226 TimelineView.DISK_CACHE_BYTES_WRITTEN_ID); |
227 | 227 |
228 this.graphView_.setDataSeries(this.dataSeries_); | 228 this.graphView_.setDataSeries(this.dataSeries_); |
229 }, | 229 }, |
230 | 230 |
231 /** | 231 /** |
232 * When we receive the constants, create or recreate the DataSeries. | 232 * When we receive the constants, create or recreate the DataSeries. |
233 */ | 233 */ |
234 onReceivedConstants: function(constants) { | 234 onReceivedConstants: function(constants) { |
235 this.createDataSeries_(); | 235 this.createDataSeries_(); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 this.leftView_.setGeometry(0, 0, newWidth, 100); | 294 this.leftView_.setGeometry(0, 0, newWidth, 100); |
295 | 295 |
296 // Force a re-layout now that the left view has changed width. | 296 // Force a re-layout now that the left view has changed width. |
297 this.setGeometry(this.getLeft(), this.getTop(), this.getWidth(), | 297 this.setGeometry(this.getLeft(), this.getTop(), this.getWidth(), |
298 this.getHeight()); | 298 this.getHeight()); |
299 } | 299 } |
300 }; | 300 }; |
301 | 301 |
302 return TimelineView; | 302 return TimelineView; |
303 })(); | 303 })(); |
OLD | NEW |