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 {UI.FlameChartDataProvider} | 6 * @implements {UI.FlameChartDataProvider} |
7 * @unrestricted | 7 * @unrestricted |
8 */ | 8 */ |
9 Timeline.TimelineFlameChartDataProviderBase = class { | 9 Timeline.TimelineFlameChartDataProviderBase = class { |
10 /** | 10 constructor() { |
11 * @param {!TimelineModel.TimelineModel} model | |
12 * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters | |
13 */ | |
14 constructor(model, filters) { | |
15 UI.FlameChartDataProvider.call(this); | 11 UI.FlameChartDataProvider.call(this); |
16 this.reset(); | 12 this.reset(); |
17 this._model = model; | |
18 /** @type {?UI.FlameChart.TimelineData} */ | |
19 this._timelineData; | |
20 this._font = '11px ' + Host.fontFamily(); | 13 this._font = '11px ' + Host.fontFamily(); |
21 this._filters = filters; | 14 } |
| 15 |
| 16 /** @return {string} */ |
| 17 font() { |
| 18 return this._font; |
22 } | 19 } |
23 | 20 |
24 /** | 21 /** |
25 * @override | 22 * @override |
26 * @return {number} | 23 * @return {number} |
27 */ | 24 */ |
28 barHeight() { | 25 barHeight() { |
29 return 17; | 26 return 17; |
30 } | 27 } |
31 | 28 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 return null; | 176 return null; |
180 } | 177 } |
181 | 178 |
182 /** | 179 /** |
183 * @override | 180 * @override |
184 * @return {!UI.FlameChart.TimelineData} | 181 * @return {!UI.FlameChart.TimelineData} |
185 */ | 182 */ |
186 timelineData() { | 183 timelineData() { |
187 throw new Error('Not implemented'); | 184 throw new Error('Not implemented'); |
188 } | 185 } |
189 | |
190 /** | |
191 * @param {!SDK.TracingModel.Event} event | |
192 * @return {boolean} | |
193 */ | |
194 _isVisible(event) { | |
195 return this._filters.every(function(filter) { | |
196 return filter.accept(event); | |
197 }); | |
198 } | |
199 }; | 186 }; |
200 | 187 |
201 /** | 188 /** |
202 * @enum {symbol} | 189 * @enum {symbol} |
203 */ | 190 */ |
204 Timeline.TimelineFlameChartEntryType = { | 191 Timeline.TimelineFlameChartEntryType = { |
205 Frame: Symbol('Frame'), | 192 Frame: Symbol('Frame'), |
206 Event: Symbol('Event'), | 193 Event: Symbol('Event'), |
207 InteractionRecord: Symbol('InteractionRecord'), | 194 InteractionRecord: Symbol('InteractionRecord'), |
208 }; | 195 }; |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 Timeline.TimelineFlameChartView.Selection = class { | 469 Timeline.TimelineFlameChartView.Selection = class { |
483 /** | 470 /** |
484 * @param {!Timeline.TimelineSelection} selection | 471 * @param {!Timeline.TimelineSelection} selection |
485 * @param {number} entryIndex | 472 * @param {number} entryIndex |
486 */ | 473 */ |
487 constructor(selection, entryIndex) { | 474 constructor(selection, entryIndex) { |
488 this.timelineSelection = selection; | 475 this.timelineSelection = selection; |
489 this.entryIndex = entryIndex; | 476 this.entryIndex = entryIndex; |
490 } | 477 } |
491 }; | 478 }; |
OLD | NEW |