| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 * @implements {PerfUI.FlameChartDataProvider} | 6 * @implements {PerfUI.FlameChartDataProvider} |
| 7 * @unrestricted | 7 * @unrestricted |
| 8 */ | 8 */ |
| 9 Timeline.TimelineFlameChartNetworkDataProvider = class { | 9 Timeline.TimelineFlameChartNetworkDataProvider = class { |
| 10 constructor() { | 10 constructor() { |
| 11 this._font = '11px ' + Host.fontFamily(); | 11 this._font = '11px ' + Host.fontFamily(); |
| 12 this.setModel(null); | 12 this.setModel(null); |
| 13 this._style = { | 13 this._style = { |
| 14 padding: 4, | 14 padding: 4, |
| 15 height: 17, | 15 height: 17, |
| 16 collapsible: true, | 16 collapsible: true, |
| 17 color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreg
round), | 17 color: UI.themeSupport.patchColorText('#222', UI.ThemeSupport.ColorUsage.F
oreground), |
| 18 font: this._font, | 18 font: this._font, |
| 19 backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.Color
Usage.Background), | 19 backgroundColor: UI.themeSupport.patchColorText('white', UI.ThemeSupport.C
olorUsage.Background), |
| 20 nestingLevel: 0, | 20 nestingLevel: 0, |
| 21 useFirstLineForOverview: false, | 21 useFirstLineForOverview: false, |
| 22 useDecoratorsForOverview: true, | 22 useDecoratorsForOverview: true, |
| 23 shareHeaderLine: false | 23 shareHeaderLine: false |
| 24 }; | 24 }; |
| 25 this._group = {startLevel: 0, name: Common.UIString('Network'), expanded: fa
lse, style: this._style}; | 25 this._group = {startLevel: 0, name: Common.UIString('Network'), expanded: fa
lse, style: this._style}; |
| 26 } | 26 } |
| 27 | 27 |
| 28 /** | 28 /** |
| 29 * @param {?Timeline.PerformanceModel} performanceModel | 29 * @param {?Timeline.PerformanceModel} performanceModel |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 var startTime = request.startTime; | 198 var startTime = request.startTime; |
| 199 var endTime = request.endTime; | 199 var endTime = request.endTime; |
| 200 var requestTime = request.timing.requestTime * 1000; | 200 var requestTime = request.timing.requestTime * 1000; |
| 201 var sendStart = Math.max(timeToPixel(requestTime + request.timing.sendStart)
, unclippedBarX); | 201 var sendStart = Math.max(timeToPixel(requestTime + request.timing.sendStart)
, unclippedBarX); |
| 202 var headersEnd = Math.max(timeToPixel(requestTime + request.timing.receiveHe
adersEnd), sendStart); | 202 var headersEnd = Math.max(timeToPixel(requestTime + request.timing.receiveHe
adersEnd), sendStart); |
| 203 var finish = Math.max(timeToPixel(request.finishTime || endTime), headersEnd
+ minBarWidthPx); | 203 var finish = Math.max(timeToPixel(request.finishTime || endTime), headersEnd
+ minBarWidthPx); |
| 204 var end = Math.max(timeToPixel(endTime), finish); | 204 var end = Math.max(timeToPixel(endTime), finish); |
| 205 | 205 |
| 206 context.fillStyle = 'hsla(0, 100%, 100%, 0.8)'; | 206 context.fillStyle = 'hsla(0, 100%, 100%, 0.8)'; |
| 207 context.fillRect(sendStart + 0.5, barY + 0.5, headersEnd - sendStart - 0.5,
barHeight - 2); | 207 context.fillRect(sendStart + 0.5, barY + 0.5, headersEnd - sendStart - 0.5,
barHeight - 2); |
| 208 context.fillStyle = UI.themeSupport.patchColor('white', UI.ThemeSupport.Colo
rUsage.Background); | 208 context.fillStyle = UI.themeSupport.patchColorText('white', UI.ThemeSupport.
ColorUsage.Background); |
| 209 context.fillRect(barX, barY - 0.5, sendStart - barX, barHeight); | 209 context.fillRect(barX, barY - 0.5, sendStart - barX, barHeight); |
| 210 context.fillRect(finish, barY - 0.5, barX + barWidth - finish, barHeight); | 210 context.fillRect(finish, barY - 0.5, barX + barWidth - finish, barHeight); |
| 211 | 211 |
| 212 /** | 212 /** |
| 213 * @param {number} begin | 213 * @param {number} begin |
| 214 * @param {number} end | 214 * @param {number} end |
| 215 * @param {number} y | 215 * @param {number} y |
| 216 */ | 216 */ |
| 217 function drawTick(begin, end, y) { | 217 function drawTick(begin, end, y) { |
| 218 var /** @const */ tickHeightPx = 6; | 218 var /** @const */ tickHeightPx = 6; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 | 386 |
| 387 /** | 387 /** |
| 388 * @override | 388 * @override |
| 389 * @param {number} entryIndex | 389 * @param {number} entryIndex |
| 390 * @return {boolean} | 390 * @return {boolean} |
| 391 */ | 391 */ |
| 392 canJumpToEntry(entryIndex) { | 392 canJumpToEntry(entryIndex) { |
| 393 return false; | 393 return false; |
| 394 } | 394 } |
| 395 }; | 395 }; |
| OLD | NEW |