OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * @constructor | 6 * @constructor |
7 * @param {!WebInspector.TracingManager} tracingManager | 7 * @param {!WebInspector.TracingManager} tracingManager |
8 * @param {!WebInspector.TracingModel} tracingModel | 8 * @param {!WebInspector.TracingModel} tracingModel |
9 * @param {!WebInspector.TimelineModel.Filter} recordFilter | 9 * @param {!WebInspector.TimelineModel.Filter} recordFilter |
10 * @extends {WebInspector.TimelineModel} | 10 * @extends {WebInspector.TimelineModel} |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 * @param {!WebInspector.TracingTimelineModel.VirtualThread} virtualThre
ad | 432 * @param {!WebInspector.TracingTimelineModel.VirtualThread} virtualThre
ad |
433 * @this {!WebInspector.TracingTimelineModel} | 433 * @this {!WebInspector.TracingTimelineModel} |
434 */ | 434 */ |
435 function processVirtualThreadEvents(virtualThread) | 435 function processVirtualThreadEvents(virtualThread) |
436 { | 436 { |
437 var threadRecords = this._buildTimelineRecordsForThread(virtualThrea
d.events); | 437 var threadRecords = this._buildTimelineRecordsForThread(virtualThrea
d.events); |
438 topLevelRecords = topLevelRecords.mergeOrdered(threadRecords, compar
eRecordStartTime); | 438 topLevelRecords = topLevelRecords.mergeOrdered(threadRecords, compar
eRecordStartTime); |
439 } | 439 } |
440 this.virtualThreads().forEach(processVirtualThreadEvents.bind(this)); | 440 this.virtualThreads().forEach(processVirtualThreadEvents.bind(this)); |
441 | 441 |
442 for (var i = 0; i < topLevelRecords.length; i++) | 442 |
443 this._addTopLevelRecord(topLevelRecords[i]); | 443 for (var i = 0; i < topLevelRecords.length; i++) { |
| 444 var record = topLevelRecords[i]; |
| 445 if (record.type() === WebInspector.TracingTimelineModel.RecordType.P
rogram) |
| 446 this._mainThreadTasks.push(record); |
| 447 if (record.type() === WebInspector.TracingTimelineModel.RecordType.G
PUTask) |
| 448 this._gpuThreadTasks.push(record); |
| 449 } |
| 450 this._records = topLevelRecords; |
444 }, | 451 }, |
445 | 452 |
446 /** | 453 /** |
447 * @param {!Array.<!WebInspector.TracingModel.Event>} threadEvents | 454 * @param {!Array.<!WebInspector.TracingModel.Event>} threadEvents |
448 * @return {!Array.<!WebInspector.TracingTimelineModel.TraceEventRecord>} | 455 * @return {!Array.<!WebInspector.TracingTimelineModel.TraceEventRecord>} |
449 */ | 456 */ |
450 _buildTimelineRecordsForThread: function(threadEvents) | 457 _buildTimelineRecordsForThread: function(threadEvents) |
451 { | 458 { |
452 var recordStack = []; | 459 var recordStack = []; |
453 var topLevelRecords = []; | 460 var topLevelRecords = []; |
(...skipping 21 matching lines...) Expand all Loading... |
475 if (event.endTime) | 482 if (event.endTime) |
476 recordStack.push(record); | 483 recordStack.push(record); |
477 } | 484 } |
478 | 485 |
479 if (recordStack.length) | 486 if (recordStack.length) |
480 topLevelRecords.push(recordStack[0]); | 487 topLevelRecords.push(recordStack[0]); |
481 | 488 |
482 return topLevelRecords; | 489 return topLevelRecords; |
483 }, | 490 }, |
484 | 491 |
485 /** | |
486 * @param {!WebInspector.TracingTimelineModel.TraceEventRecord} record | |
487 */ | |
488 _addTopLevelRecord: function(record) | |
489 { | |
490 this._records.push(record); | |
491 if (record.type() === WebInspector.TracingTimelineModel.RecordType.Progr
am) | |
492 this._mainThreadTasks.push(record); | |
493 if (record.type() === WebInspector.TracingTimelineModel.RecordType.GPUTa
sk) | |
494 this._gpuThreadTasks.push(record); | |
495 this.dispatchEventToListeners(WebInspector.TimelineModel.Events.RecordAd
ded, record); | |
496 }, | |
497 | |
498 _resetProcessingState: function() | 492 _resetProcessingState: function() |
499 { | 493 { |
500 this._sendRequestEvents = {}; | 494 this._sendRequestEvents = {}; |
501 this._timerEvents = {}; | 495 this._timerEvents = {}; |
502 this._requestAnimationFrameEvents = {}; | 496 this._requestAnimationFrameEvents = {}; |
503 this._invalidationTracker = new WebInspector.InvalidationTracker(); | 497 this._invalidationTracker = new WebInspector.InvalidationTracker(); |
504 this._layoutInvalidate = {}; | 498 this._layoutInvalidate = {}; |
505 this._lastScheduleStyleRecalculation = {}; | 499 this._lastScheduleStyleRecalculation = {}; |
506 this._webSocketCreateEvents = {}; | 500 this._webSocketCreateEvents = {}; |
507 this._paintImageEventByPixelRefId = {}; | 501 this._paintImageEventByPixelRefId = {}; |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1289 _initializePerFrameState: function() | 1283 _initializePerFrameState: function() |
1290 { | 1284 { |
1291 /** @type {!Array.<!WebInspector.InvalidationTrackingEvent>} */ | 1285 /** @type {!Array.<!WebInspector.InvalidationTrackingEvent>} */ |
1292 this._invalidationEvents = []; | 1286 this._invalidationEvents = []; |
1293 this._lastStyleRecalcEventIndex = 0; | 1287 this._lastStyleRecalcEventIndex = 0; |
1294 this._lastLayoutEventIndex = 0; | 1288 this._lastLayoutEventIndex = 0; |
1295 this._lastPaintWithLayer = undefined; | 1289 this._lastPaintWithLayer = undefined; |
1296 this._didPaint = false; | 1290 this._didPaint = false; |
1297 } | 1291 } |
1298 } | 1292 } |
OLD | NEW |