Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: Source/devtools/front_end/timeline/TracingTimelineModel.js

Issue 710113002: DevTools: remove TimelineModel.Events.RecordAdded event (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comment Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineView.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698