| 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 /** @type {?TimelineModel.TimelineModel} */ | 12 this.setModel(null); |
| 13 this._model = null; | |
| 14 this.reset(); | |
| 15 this._style = { | 13 this._style = { |
| 16 padding: 4, | 14 padding: 4, |
| 17 height: 17, | 15 height: 17, |
| 18 collapsible: true, | 16 collapsible: true, |
| 19 color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreg
round), | 17 color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreg
round), |
| 20 font: this._font, | 18 font: this._font, |
| 21 backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.Color
Usage.Background), | 19 backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.Color
Usage.Background), |
| 22 nestingLevel: 0, | 20 nestingLevel: 0, |
| 23 useFirstLineForOverview: false, | 21 useFirstLineForOverview: false, |
| 24 useDecoratorsForOverview: true, | 22 useDecoratorsForOverview: true, |
| 25 shareHeaderLine: false | 23 shareHeaderLine: false |
| 26 }; | 24 }; |
| 27 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}; |
| 28 } | 26 } |
| 29 | 27 |
| 30 /** | 28 /** |
| 31 * @param {?Timeline.PerformanceModel} performanceModel | 29 * @param {?Timeline.PerformanceModel} performanceModel |
| 32 */ | 30 */ |
| 33 setModel(performanceModel) { | 31 setModel(performanceModel) { |
| 34 this._model = performanceModel && performanceModel.timelineModel(); | 32 this._model = performanceModel && performanceModel.timelineModel(); |
| 33 this._maxLevel = 0; |
| 34 this._timelineData = null; |
| 35 /** @type {!Array<!TimelineModel.TimelineModel.NetworkRequest>} */ |
| 36 this._requests = []; |
| 35 } | 37 } |
| 36 | 38 |
| 37 /** | 39 /** |
| 38 * @return {boolean} | 40 * @return {boolean} |
| 39 */ | 41 */ |
| 40 isEmpty() { | 42 isEmpty() { |
| 41 this.timelineData(); | 43 this.timelineData(); |
| 42 return !this._requests.length; | 44 return !this._requests.length; |
| 43 } | 45 } |
| 44 | 46 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 74 } | 76 } |
| 75 | 77 |
| 76 /** | 78 /** |
| 77 * @override | 79 * @override |
| 78 * @return {number} | 80 * @return {number} |
| 79 */ | 81 */ |
| 80 totalTime() { | 82 totalTime() { |
| 81 return this._timeSpan; | 83 return this._timeSpan; |
| 82 } | 84 } |
| 83 | 85 |
| 84 reset() { | |
| 85 this._maxLevel = 0; | |
| 86 this._timelineData = null; | |
| 87 /** @type {!Array<!TimelineModel.TimelineModel.NetworkRequest>} */ | |
| 88 this._requests = []; | |
| 89 } | |
| 90 | |
| 91 /** | 86 /** |
| 92 * @param {number} startTime | 87 * @param {number} startTime |
| 93 * @param {number} endTime | 88 * @param {number} endTime |
| 94 */ | 89 */ |
| 95 setWindowTimes(startTime, endTime) { | 90 setWindowTimes(startTime, endTime) { |
| 96 this._startTime = startTime; | 91 this._startTime = startTime; |
| 97 this._endTime = endTime; | 92 this._endTime = endTime; |
| 98 this._updateTimelineData(); | 93 this._updateTimelineData(); |
| 99 } | 94 } |
| 100 | 95 |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 | 386 |
| 392 /** | 387 /** |
| 393 * @override | 388 * @override |
| 394 * @param {number} entryIndex | 389 * @param {number} entryIndex |
| 395 * @return {boolean} | 390 * @return {boolean} |
| 396 */ | 391 */ |
| 397 canJumpToEntry(entryIndex) { | 392 canJumpToEntry(entryIndex) { |
| 398 return false; | 393 return false; |
| 399 } | 394 } |
| 400 }; | 395 }; |
| OLD | NEW |