| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.TimelineOverviewBase} | 7 * @extends {WebInspector.TimelineOverviewBase} |
| 8 */ | 8 */ |
| 9 WebInspector.NetworkOverview = function() | 9 WebInspector.NetworkOverview = function() |
| 10 { | 10 { |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 } | 244 } |
| 245 lines.push(y, start, end); | 245 lines.push(y, start, end); |
| 246 } | 246 } |
| 247 | 247 |
| 248 var requests = this._requestsList; | 248 var requests = this._requestsList; |
| 249 var n = requests.length; | 249 var n = requests.length; |
| 250 for (var i = 0; i < n; ++i) { | 250 for (var i = 0; i < n; ++i) { |
| 251 var request = requests[i]; | 251 var request = requests[i]; |
| 252 var band = this._bandId(request.connectionId); | 252 var band = this._bandId(request.connectionId); |
| 253 var y = (band === -1) ? 0 : (band % this._numBands + 1); | 253 var y = (band === -1) ? 0 : (band % this._numBands + 1); |
| 254 var timeRanges = WebInspector.RequestTimingView.calculateRequestTime
Ranges(request); | 254 var timeRanges = WebInspector.RequestTimingView.calculateRequestTime
Ranges(request, this._calculator.minimumBoundary()); |
| 255 for (var j = 0; j < timeRanges.length; ++j) { | 255 for (var j = 0; j < timeRanges.length; ++j) { |
| 256 var type = timeRanges[j].name; | 256 var type = timeRanges[j].name; |
| 257 if (band !== -1 || type === WebInspector.RequestTimeRangeNames.T
otal) | 257 if (band !== -1 || type === WebInspector.RequestTimeRangeNames.T
otal) |
| 258 addLine(type, y, timeRanges[j].start * 1000, timeRanges[j].e
nd * 1000); | 258 addLine(type, y, timeRanges[j].start * 1000, timeRanges[j].e
nd * 1000); |
| 259 } | 259 } |
| 260 } | 260 } |
| 261 | 261 |
| 262 context.clearRect(0, 0, this._canvas.width, this._canvas.height); | 262 context.clearRect(0, 0, this._canvas.width, this._canvas.height); |
| 263 context.save(); | 263 context.save(); |
| 264 context.scale(window.devicePixelRatio, window.devicePixelRatio); | 264 context.scale(window.devicePixelRatio, window.devicePixelRatio); |
| 265 context.lineWidth = 2; | 265 context.lineWidth = 2; |
| 266 drawLines(WebInspector.RequestTimeRangeNames.Total, "#CCCCCC"); | 266 drawLines(WebInspector.RequestTimeRangeNames.Total, "#CCCCCC"); |
| 267 drawLines(WebInspector.RequestTimeRangeNames.Blocking, "#AAAAAA"); | 267 drawLines(WebInspector.RequestTimeRangeNames.Blocking, "#AAAAAA"); |
| 268 drawLines(WebInspector.RequestTimeRangeNames.Connecting, "#FF9800"); | 268 drawLines(WebInspector.RequestTimeRangeNames.Connecting, "#FF9800"); |
| 269 drawLines(WebInspector.RequestTimeRangeNames.ServiceWorker, "#FF9800"); | 269 drawLines(WebInspector.RequestTimeRangeNames.ServiceWorker, "#FF9800"); |
| 270 drawLines(WebInspector.RequestTimeRangeNames.ServiceWorkerPreparation, "
#FF9800"); | 270 drawLines(WebInspector.RequestTimeRangeNames.ServiceWorkerPreparation, "
#FF9800"); |
| 271 drawLines(WebInspector.RequestTimeRangeNames.Push, "#8CDBff"); |
| 271 drawLines(WebInspector.RequestTimeRangeNames.Proxy, "#A1887F"); | 272 drawLines(WebInspector.RequestTimeRangeNames.Proxy, "#A1887F"); |
| 272 drawLines(WebInspector.RequestTimeRangeNames.DNS, "#009688"); | 273 drawLines(WebInspector.RequestTimeRangeNames.DNS, "#009688"); |
| 273 drawLines(WebInspector.RequestTimeRangeNames.SSL, "#9C27B0"); | 274 drawLines(WebInspector.RequestTimeRangeNames.SSL, "#9C27B0"); |
| 274 drawLines(WebInspector.RequestTimeRangeNames.Sending, "#B0BEC5"); | 275 drawLines(WebInspector.RequestTimeRangeNames.Sending, "#B0BEC5"); |
| 275 drawLines(WebInspector.RequestTimeRangeNames.Waiting, "#00C853"); | 276 drawLines(WebInspector.RequestTimeRangeNames.Waiting, "#00C853"); |
| 276 drawLines(WebInspector.RequestTimeRangeNames.Receiving, "#03A9F4"); | 277 drawLines(WebInspector.RequestTimeRangeNames.Receiving, "#03A9F4"); |
| 277 | 278 |
| 278 var height = this.element.offsetHeight; | 279 var height = this.element.offsetHeight; |
| 279 context.lineWidth = 1; | 280 context.lineWidth = 1; |
| 280 context.beginPath(); | 281 context.beginPath(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 302 var x = Math.round(calculator.computePosition(this._selectedFilmStri
pTime)); | 303 var x = Math.round(calculator.computePosition(this._selectedFilmStri
pTime)); |
| 303 context.moveTo(x, 0); | 304 context.moveTo(x, 0); |
| 304 context.lineTo(x, height); | 305 context.lineTo(x, height); |
| 305 context.stroke(); | 306 context.stroke(); |
| 306 } | 307 } |
| 307 context.restore(); | 308 context.restore(); |
| 308 }, | 309 }, |
| 309 | 310 |
| 310 __proto__: WebInspector.TimelineOverviewBase.prototype | 311 __proto__: WebInspector.TimelineOverviewBase.prototype |
| 311 } | 312 } |
| OLD | NEW |