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 * @unrestricted | 5 * @unrestricted |
6 */ | 6 */ |
7 Network.NetworkOverview = class extends UI.TimelineOverviewBase { | 7 Network.NetworkOverview = class extends PerfUI.TimelineOverviewBase { |
8 constructor() { | 8 constructor() { |
9 super(); | 9 super(); |
10 this.element.classList.add('network-overview'); | 10 this.element.classList.add('network-overview'); |
11 | 11 |
12 /** @type {number} */ | 12 /** @type {number} */ |
13 this._numBands = 1; | 13 this._numBands = 1; |
14 /** @type {boolean} */ | 14 /** @type {boolean} */ |
15 this._updateScheduled = false; | 15 this._updateScheduled = false; |
16 | 16 |
17 SDK.targetManager.addModelListener( | 17 SDK.targetManager.addModelListener( |
18 SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.Load, this._loadEven
tFired, this); | 18 SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.Load, this._loadEven
tFired, this); |
19 SDK.targetManager.addModelListener( | 19 SDK.targetManager.addModelListener( |
20 SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.DOMContentLoaded, th
is._domContentLoadedEventFired, this); | 20 SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.DOMContentLoaded, th
is._domContentLoadedEventFired, this); |
21 | 21 |
22 this.reset(); | 22 this.reset(); |
23 } | 23 } |
24 | 24 |
25 /** | 25 /** |
26 * @param {?Components.FilmStripModel} filmStripModel | 26 * @param {?SDK.FilmStripModel} filmStripModel |
27 */ | 27 */ |
28 setFilmStripModel(filmStripModel) { | 28 setFilmStripModel(filmStripModel) { |
29 this._filmStripModel = filmStripModel; | 29 this._filmStripModel = filmStripModel; |
30 this.scheduleUpdate(); | 30 this.scheduleUpdate(); |
31 } | 31 } |
32 | 32 |
33 /** | 33 /** |
34 * @param {number} time | 34 * @param {number} time |
35 */ | 35 */ |
36 selectFilmStripFrame(time) { | 36 selectFilmStripFrame(time) { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 this.resetCanvas(); | 105 this.resetCanvas(); |
106 var numBands = (((height - 1) / Network.NetworkOverview._bandHeight) - 1) |
0; | 106 var numBands = (((height - 1) / Network.NetworkOverview._bandHeight) - 1) |
0; |
107 this._numBands = (numBands > 0) ? numBands : 1; | 107 this._numBands = (numBands > 0) ? numBands : 1; |
108 this.scheduleUpdate(); | 108 this.scheduleUpdate(); |
109 } | 109 } |
110 | 110 |
111 /** | 111 /** |
112 * @override | 112 * @override |
113 */ | 113 */ |
114 reset() { | 114 reset() { |
115 /** @type {?Components.FilmStripModel} */ | 115 /** @type {?SDK.FilmStripModel} */ |
116 this._filmStripModel = null; | 116 this._filmStripModel = null; |
117 | 117 |
118 /** @type {number} */ | 118 /** @type {number} */ |
119 this._span = 1; | 119 this._span = 1; |
120 /** @type {?Network.NetworkTimeBoundary} */ | 120 /** @type {?Network.NetworkTimeBoundary} */ |
121 this._lastBoundary = null; | 121 this._lastBoundary = null; |
122 /** @type {number} */ | 122 /** @type {number} */ |
123 this._nextBand = 0; | 123 this._nextBand = 0; |
124 /** @type {!Map.<string, number>} */ | 124 /** @type {!Map.<string, number>} */ |
125 this._bandMap = new Map(); | 125 this._bandMap = new Map(); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 } | 269 } |
270 context.restore(); | 270 context.restore(); |
271 } | 271 } |
272 }; | 272 }; |
273 | 273 |
274 /** @type {number} */ | 274 /** @type {number} */ |
275 Network.NetworkOverview._bandHeight = 3; | 275 Network.NetworkOverview._bandHeight = 3; |
276 | 276 |
277 /** @typedef {{start: number, end: number}} */ | 277 /** @typedef {{start: number, end: number}} */ |
278 Network.NetworkOverview.Window; | 278 Network.NetworkOverview.Window; |
OLD | NEW |