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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineModel.js

Issue 1815573002: DevTools: Move GPU activity on timeline out of experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comment Created 4 years, 9 months 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 continue; 494 continue;
495 this._processThreadEvents(startTime, endTime, metaEvent.thread, thread); 495 this._processThreadEvents(startTime, endTime, metaEvent.thread, thread);
496 } 496 }
497 startTime = endTime; 497 startTime = endTime;
498 } 498 }
499 this._inspectedTargetEvents.sort(WebInspector.TracingModel.Event.compare StartTime); 499 this._inspectedTargetEvents.sort(WebInspector.TracingModel.Event.compare StartTime);
500 500
501 this._cpuProfiles = null; 501 this._cpuProfiles = null;
502 this._processBrowserEvents(tracingModel); 502 this._processBrowserEvents(tracingModel);
503 this._buildTimelineRecords(); 503 this._buildTimelineRecords();
504 this._buildGPUTasks(tracingModel); 504 this._buildGPUEvents(tracingModel);
505 this._insertFirstPaintEvent(); 505 this._insertFirstPaintEvent();
506 this._resetProcessingState(); 506 this._resetProcessingState();
507 }, 507 },
508 508
509 /** 509 /**
510 * @param {!WebInspector.TracingModel} tracingModel 510 * @param {!WebInspector.TracingModel} tracingModel
511 * @param {boolean} produceTraceStartedInPage 511 * @param {boolean} produceTraceStartedInPage
512 * @return {!WebInspector.TimelineModel.MetadataEvents} 512 * @return {!WebInspector.TimelineModel.MetadataEvents}
513 */ 513 */
514 _processMetadataEvents: function(tracingModel, produceTraceStartedInPage) 514 _processMetadataEvents: function(tracingModel, produceTraceStartedInPage)
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 var threadRecords = this._buildTimelineRecordsForThread(virtualThrea d.events); 638 var threadRecords = this._buildTimelineRecordsForThread(virtualThrea d.events);
639 topLevelRecords = topLevelRecords.mergeOrdered(threadRecords, WebIns pector.TimelineModel.Record._compareStartTime); 639 topLevelRecords = topLevelRecords.mergeOrdered(threadRecords, WebIns pector.TimelineModel.Record._compareStartTime);
640 } 640 }
641 this.virtualThreads().forEach(processVirtualThreadEvents.bind(this)); 641 this.virtualThreads().forEach(processVirtualThreadEvents.bind(this));
642 this._records = topLevelRecords; 642 this._records = topLevelRecords;
643 }, 643 },
644 644
645 /** 645 /**
646 * @param {!WebInspector.TracingModel} tracingModel 646 * @param {!WebInspector.TracingModel} tracingModel
647 */ 647 */
648 _buildGPUTasks: function(tracingModel) 648 _buildGPUEvents: function(tracingModel)
649 { 649 {
650 var mainThread = tracingModel.threadByName("GPU Process", "CrGpuMain"); 650 var thread = tracingModel.threadByName("GPU Process", "CrGpuMain");
651 if (!mainThread) 651 if (!thread)
652 return; 652 return;
653 var events = mainThread.events(); 653 var gpuEventName = WebInspector.TimelineModel.RecordType.GPUTask;
654 var recordTypes = WebInspector.TimelineModel.RecordType; 654 this._gpuEvents = thread.events().filter(event => event.name === gpuEven tName);
655 for (var i = 0; i < events.length; ++i) {
656 if (events[i].name === recordTypes.GPUTask)
657 this._gpuTasks.push(new WebInspector.TimelineModel.Record(events [i]));
658 }
659 }, 655 },
660 656
661 /** 657 /**
662 * @param {!Array.<!WebInspector.TracingModel.Event>} threadEvents 658 * @param {!Array.<!WebInspector.TracingModel.Event>} threadEvents
663 * @return {!Array.<!WebInspector.TimelineModel.Record>} 659 * @return {!Array.<!WebInspector.TimelineModel.Record>}
664 */ 660 */
665 _buildTimelineRecordsForThread: function(threadEvents) 661 _buildTimelineRecordsForThread: function(threadEvents)
666 { 662 {
667 var recordStack = []; 663 var recordStack = [];
668 var topLevelRecords = []; 664 var topLevelRecords = [];
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 var events = target.get(group) || []; 1055 var events = target.get(group) || [];
1060 events = events.mergeOrdered(source.get(group) || [], WebInspector.T racingModel.Event.compareStartAndEndTime); 1056 events = events.mergeOrdered(source.get(group) || [], WebInspector.T racingModel.Event.compareStartAndEndTime);
1061 target.set(group, events); 1057 target.set(group, events);
1062 } 1058 }
1063 }, 1059 },
1064 1060
1065 reset: function() 1061 reset: function()
1066 { 1062 {
1067 this._lineLevelCPUProfile = new WebInspector.TimelineModel.LineLevelProf ile(); 1063 this._lineLevelCPUProfile = new WebInspector.TimelineModel.LineLevelProf ile();
1068 this._virtualThreads = []; 1064 this._virtualThreads = [];
1069 /** @type {!Array.<!WebInspector.TracingModel.Event>} */ 1065 /** @type {!Array<!WebInspector.TracingModel.Event>} */
1070 this._mainThreadEvents = []; 1066 this._mainThreadEvents = [];
1071 /** @type {!Map<!WebInspector.AsyncEventGroup, !Array<!WebInspector.Trac ingModel.AsyncEvent>>} */ 1067 /** @type {!Map<!WebInspector.AsyncEventGroup, !Array<!WebInspector.Trac ingModel.AsyncEvent>>} */
1072 this._mainThreadAsyncEventsByGroup = new Map(); 1068 this._mainThreadAsyncEventsByGroup = new Map();
1073 /** @type {!Array.<!WebInspector.TracingModel.Event>} */ 1069 /** @type {!Array<!WebInspector.TracingModel.Event>} */
1074 this._inspectedTargetEvents = []; 1070 this._inspectedTargetEvents = [];
1075 /** @type {!Array.<!WebInspector.TimelineModel.Record>} */ 1071 /** @type {!Array<!WebInspector.TimelineModel.Record>} */
1076 this._records = []; 1072 this._records = [];
1077 /** @type {!Array.<!WebInspector.TimelineModel.Record>} */ 1073 /** @type {!Array<!WebInspector.TimelineModel.Record>} */
1078 this._mainThreadTasks = []; 1074 this._mainThreadTasks = [];
1079 /** @type {!Array.<!WebInspector.TimelineModel.Record>} */ 1075 /** @type {!Array<!WebInspector.TracingModel.Event>} */
1080 this._gpuTasks = []; 1076 this._gpuEvents = [];
1081 /** @type {!Array.<!WebInspector.TimelineModel.Record>} */ 1077 /** @type {!Array<!WebInspector.TimelineModel.Record>} */
1082 this._eventDividerRecords = []; 1078 this._eventDividerRecords = [];
1083 /** @type {?string} */ 1079 /** @type {?string} */
1084 this._sessionId = null; 1080 this._sessionId = null;
1085 /** @type {?number} */ 1081 /** @type {?number} */
1086 this._mainFrameNodeId = null; 1082 this._mainFrameNodeId = null;
1087 this._minimumRecordTime = 0; 1083 this._minimumRecordTime = 0;
1088 this._maximumRecordTime = 0; 1084 this._maximumRecordTime = 0;
1089 }, 1085 },
1090 1086
1091 /** 1087 /**
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 1158
1163 /** 1159 /**
1164 * @return {!Array.<!WebInspector.TimelineModel.Record>} 1160 * @return {!Array.<!WebInspector.TimelineModel.Record>}
1165 */ 1161 */
1166 mainThreadTasks: function() 1162 mainThreadTasks: function()
1167 { 1163 {
1168 return this._mainThreadTasks; 1164 return this._mainThreadTasks;
1169 }, 1165 },
1170 1166
1171 /** 1167 /**
1172 * @return {!Array.<!WebInspector.TimelineModel.Record>} 1168 * @return {!Array<!WebInspector.TracingModel.Event>}
1173 */ 1169 */
1174 gpuTasks: function() 1170 gpuEvents: function()
1175 { 1171 {
1176 return this._gpuTasks; 1172 return this._gpuEvents;
1177 }, 1173 },
1178 1174
1179 /** 1175 /**
1180 * @return {!Array.<!WebInspector.TimelineModel.Record>} 1176 * @return {!Array.<!WebInspector.TimelineModel.Record>}
1181 */ 1177 */
1182 eventDividerRecords: function() 1178 eventDividerRecords: function()
1183 { 1179 {
1184 return this._eventDividerRecords; 1180 return this._eventDividerRecords;
1185 }, 1181 },
1186 1182
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
1776 }, 1772 },
1777 1773
1778 /** 1774 /**
1779 * @return {!Map<string, !Map<number, number>>} 1775 * @return {!Map<string, !Map<number, number>>}
1780 */ 1776 */
1781 files: function() 1777 files: function()
1782 { 1778 {
1783 return this._files; 1779 return this._files;
1784 } 1780 }
1785 } 1781 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698