| 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 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 TimelineModel.TimelineIRModel = class { | 7 TimelineModel.TimelineIRModel = class { |
| 8 constructor() { | 8 constructor() { |
| 9 this.reset(); | 9 this.reset(); |
| 10 } | 10 } |
| 11 | 11 |
| 12 /** | 12 /** |
| 13 * @param {!SDK.TracingModel.Event} event | 13 * @param {!SDK.TracingModel.Event} event |
| 14 * @return {!TimelineModel.TimelineIRModel.Phases} | 14 * @return {!TimelineModel.TimelineIRModel.Phases} |
| 15 */ | 15 */ |
| 16 static phaseForEvent(event) { | 16 static phaseForEvent(event) { |
| 17 return event[TimelineModel.TimelineIRModel._eventIRPhase]; | 17 return event[TimelineModel.TimelineIRModel._eventIRPhase]; |
| 18 } | 18 } |
| 19 | 19 |
| 20 /** | 20 /** |
| 21 * @param {?Array<!SDK.TracingModel.AsyncEvent>} inputLatencies | 21 * @param {?Array<!SDK.TracingModel.AsyncEvent>} inputLatencies |
| 22 * @param {?Array<!SDK.TracingModel.AsyncEvent>} animations | 22 * @param {?Array<!SDK.TracingModel.AsyncEvent>} animations |
| 23 */ | 23 */ |
| 24 populate(inputLatencies, animations) { | 24 populate(inputLatencies, animations) { |
| 25 var eventTypes = TimelineModel.TimelineIRModel.InputEvents; | |
| 26 var phases = TimelineModel.TimelineIRModel.Phases; | |
| 27 | |
| 28 this.reset(); | 25 this.reset(); |
| 29 if (!inputLatencies) | 26 if (!inputLatencies) |
| 30 return; | 27 return; |
| 31 this._processInputLatencies(inputLatencies); | 28 this._processInputLatencies(inputLatencies); |
| 32 if (animations) | 29 if (animations) |
| 33 this._processAnimations(animations); | 30 this._processAnimations(animations); |
| 34 var range = new Common.SegmentedRange(); | 31 var range = new Common.SegmentedRange(); |
| 35 range.appendRange(this._drags); // Drags take lower precedence than animati
on, as we can't detect them reliably. | 32 range.appendRange(this._drags); // Drags take lower precedence than animati
on, as we can't detect them reliably. |
| 36 range.appendRange(this._cssAnimations); | 33 range.appendRange(this._cssAnimations); |
| 37 range.appendRange(this._scrolls); | 34 range.appendRange(this._scrolls); |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 TouchMove: 'TouchMove', | 307 TouchMove: 'TouchMove', |
| 311 TouchStart: 'TouchStart' | 308 TouchStart: 'TouchStart' |
| 312 }; | 309 }; |
| 313 | 310 |
| 314 TimelineModel.TimelineIRModel._mergeThresholdsMs = { | 311 TimelineModel.TimelineIRModel._mergeThresholdsMs = { |
| 315 animation: 1, | 312 animation: 1, |
| 316 mouse: 40, | 313 mouse: 40, |
| 317 }; | 314 }; |
| 318 | 315 |
| 319 TimelineModel.TimelineIRModel._eventIRPhase = Symbol('eventIRPhase'); | 316 TimelineModel.TimelineIRModel._eventIRPhase = Symbol('eventIRPhase'); |
| OLD | NEW |