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

Side by Side Diff: Source/devtools/front_end/timeline/TimelineView.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 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 this._record = presentationRecord; 1060 this._record = presentationRecord;
1061 var record = presentationRecord.record(); 1061 var record = presentationRecord.record();
1062 this._offset = offset; 1062 this._offset = offset;
1063 1063
1064 this.element.className = "timeline-tree-item timeline-category-" + uiUti ls.categoryForRecord(record).name; 1064 this.element.className = "timeline-tree-item timeline-category-" + uiUti ls.categoryForRecord(record).name;
1065 var paddingLeft = 5; 1065 var paddingLeft = 5;
1066 var step = -3; 1066 var step = -3;
1067 for (var currentRecord = presentationRecord.presentationParent() ? prese ntationRecord.presentationParent().presentationParent() : null; currentRecord; c urrentRecord = currentRecord.presentationParent()) 1067 for (var currentRecord = presentationRecord.presentationParent() ? prese ntationRecord.presentationParent().presentationParent() : null; currentRecord; c urrentRecord = currentRecord.presentationParent())
1068 paddingLeft += 12 / (Math.max(1, step++)); 1068 paddingLeft += 12 / (Math.max(1, step++));
1069 this.element.style.paddingLeft = paddingLeft + "px"; 1069 this.element.style.paddingLeft = paddingLeft + "px";
1070 if (record.thread() && record.thread() !== "CPU") 1070 if (record.thread() !== WebInspector.TimelineModel.MainThreadName)
1071 this.element.classList.add("background"); 1071 this.element.classList.add("background");
1072 1072
1073 this._typeElement.textContent = uiUtils.titleForRecord(record); 1073 this._typeElement.textContent = uiUtils.titleForRecord(record);
1074 1074
1075 if (this._dataElement.firstChild) 1075 if (this._dataElement.firstChild)
1076 this._dataElement.removeChildren(); 1076 this._dataElement.removeChildren();
1077 1077
1078 this._warningElement.classList.toggle("hidden", !presentationRecord.hasW arnings() && !presentationRecord.childHasWarnings()); 1078 this._warningElement.classList.toggle("hidden", !presentationRecord.hasW arnings() && !presentationRecord.childHasWarnings());
1079 this._warningElement.classList.toggle("timeline-tree-item-child-warning" , presentationRecord.childHasWarnings() && !presentationRecord.hasWarnings()); 1079 this._warningElement.classList.toggle("timeline-tree-item-child-warning" , presentationRecord.childHasWarnings() && !presentationRecord.hasWarnings());
1080 1080
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 * @param {!WebInspector.TimelineCalculator} calculator 1187 * @param {!WebInspector.TimelineCalculator} calculator
1188 * @param {number} expandOffset 1188 * @param {number} expandOffset
1189 * @param {number} index 1189 * @param {number} index
1190 * @param {!WebInspector.TimelineUIUtils} uiUtils 1190 * @param {!WebInspector.TimelineUIUtils} uiUtils
1191 */ 1191 */
1192 update: function(presentationRecord, calculator, expandOffset, index, uiUtil s) 1192 update: function(presentationRecord, calculator, expandOffset, index, uiUtil s)
1193 { 1193 {
1194 this._record = presentationRecord; 1194 this._record = presentationRecord;
1195 var record = presentationRecord.record(); 1195 var record = presentationRecord.record();
1196 this.element.className = "timeline-graph-side timeline-category-" + uiUt ils.categoryForRecord(record).name; 1196 this.element.className = "timeline-graph-side timeline-category-" + uiUt ils.categoryForRecord(record).name;
1197 if (record.thread() && record.thread() !== "CPU") 1197 if (record.thread() !== WebInspector.TimelineModel.MainThreadName)
1198 this.element.classList.add("background"); 1198 this.element.classList.add("background");
1199 1199
1200 var barPosition = calculator.computeBarGraphWindowPosition(presentationR ecord); 1200 var barPosition = calculator.computeBarGraphWindowPosition(presentationR ecord);
1201 this._barElement.style.left = barPosition.left + "px"; 1201 this._barElement.style.left = barPosition.left + "px";
1202 this._barElement.style.width = barPosition.width + "px"; 1202 this._barElement.style.width = barPosition.width + "px";
1203 this._barCpuElement.style.left = barPosition.left + "px"; 1203 this._barCpuElement.style.left = barPosition.left + "px";
1204 this._barCpuElement.style.width = barPosition.cpuWidth + "px"; 1204 this._barCpuElement.style.width = barPosition.cpuWidth + "px";
1205 this._expandElement._update(presentationRecord, index, barPosition.left - expandOffset, barPosition.width); 1205 this._expandElement._update(presentationRecord, index, barPosition.left - expandOffset, barPosition.width);
1206 this._record.setGraphRow(this); 1206 this._record.setGraphRow(this);
1207 }, 1207 },
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 } else { 1295 } else {
1296 this._element.classList.add("hidden"); 1296 this._element.classList.add("hidden");
1297 } 1297 }
1298 }, 1298 },
1299 1299
1300 _dispose: function() 1300 _dispose: function()
1301 { 1301 {
1302 this._element.remove(); 1302 this._element.remove();
1303 } 1303 }
1304 } 1304 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineModelImpl.js ('k') | Source/devtools/front_end/timeline/TracingTimelineModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698