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

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

Issue 363343004: DevTools: Unify main thread name across vanilla and tracing timeline modes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 if (!this._aggregatedMainThreadWork && this._findRecordRecursively(W ebInspector.TimelineFrameModel._mainFrameMarkers, programRecord)) 268 if (!this._aggregatedMainThreadWork && this._findRecordRecursively(W ebInspector.TimelineFrameModel._mainFrameMarkers, programRecord))
269 this._aggregatedMainThreadWork = {}; 269 this._aggregatedMainThreadWork = {};
270 } 270 }
271 /** type {Array.<!WebInspector.TimelineModel.Record>} */ 271 /** type {Array.<!WebInspector.TimelineModel.Record>} */
272 var records = []; 272 var records = [];
273 if (!this._mergeRecords) 273 if (!this._mergeRecords)
274 records = [record]; 274 records = [record];
275 else 275 else
276 records = this._mergingBuffer.process(record.thread(), /** type {Arr ay.<!WebInspector.TimelineModel.Record>} */(programRecord ? record.children() || [] : [record])); 276 records = this._mergingBuffer.process(record.thread(), /** type {Arr ay.<!WebInspector.TimelineModel.Record>} */(programRecord ? record.children() || [] : [record]));
277 for (var i = 0; i < records.length; ++i) { 277 for (var i = 0; i < records.length; ++i) {
278 if (records[i].thread()) 278 if (records[i].thread() === WebInspector.TimelineModel.MainThreadNam e)
279 this._addMainThreadRecord(programRecord, records[i]);
280 else
279 this._addBackgroundRecord(records[i]); 281 this._addBackgroundRecord(records[i]);
280 else
281 this._addMainThreadRecord(programRecord, records[i]);
282 } 282 }
283 }, 283 },
284 284
285 /** 285 /**
286 * @param {!WebInspector.TimelineModel.Record} record 286 * @param {!WebInspector.TimelineModel.Record} record
287 */ 287 */
288 _addBackgroundRecord: function(record) 288 _addBackgroundRecord: function(record)
289 { 289 {
290 var recordTypes = WebInspector.TimelineModel.RecordType; 290 var recordTypes = WebInspector.TimelineModel.RecordType;
291 if (record.type() === recordTypes.BeginFrame) 291 if (record.type() === recordTypes.BeginFrame)
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 /** 570 /**
571 * @param {string} category 571 * @param {string} category
572 * @param {number} time 572 * @param {number} time
573 */ 573 */
574 _addTimeForCategory: function(category, time) 574 _addTimeForCategory: function(category, time)
575 { 575 {
576 this.timeByCategory[category] = (this.timeByCategory[category] || 0) + t ime; 576 this.timeByCategory[category] = (this.timeByCategory[category] || 0) + t ime;
577 this.cpuTime += time; 577 this.cpuTime += time;
578 }, 578 },
579 } 579 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineFlameChart.js ('k') | Source/devtools/front_end/timeline/TimelineModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698