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

Side by Side Diff: Source/devtools/front_end/CPUProfileView.js

Issue 205563007: CPUProfiler: convert Flame Chart into Icicle Chart (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: linkifier Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/devtools/front_end/FlameChart.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 columns.push({id: "function", title: WebInspector.UIString("Function"), disc losure: true, sortable: true}); 45 columns.push({id: "function", title: WebInspector.UIString("Function"), disc losure: true, sortable: true});
46 46
47 this.dataGrid = new WebInspector.DataGrid(columns); 47 this.dataGrid = new WebInspector.DataGrid(columns);
48 this.dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._sortProfile, this); 48 this.dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._sortProfile, this);
49 this.dataGrid.element.addEventListener("mousedown", this._mouseDownInDataGri d.bind(this), true); 49 this.dataGrid.element.addEventListener("mousedown", this._mouseDownInDataGri d.bind(this), true);
50 this.dataGrid.show(this.element); 50 this.dataGrid.show(this.element);
51 51
52 this.viewSelectComboBox = new WebInspector.StatusBarComboBox(this._changeVie w.bind(this)); 52 this.viewSelectComboBox = new WebInspector.StatusBarComboBox(this._changeVie w.bind(this));
53 53
54 var options = {}; 54 var options = {};
55 options[WebInspector.CPUProfileView._TypeFlame] = this.viewSelectComboBox.cr eateOption(WebInspector.UIString("Flame Chart"), "", WebInspector.CPUProfileView ._TypeFlame); 55 options[WebInspector.CPUProfileView._TypeFlame] = this.viewSelectComboBox.cr eateOption(WebInspector.UIString("Icicle Chart"), "", WebInspector.CPUProfileVie w._TypeFlame);
56 options[WebInspector.CPUProfileView._TypeHeavy] = this.viewSelectComboBox.cr eateOption(WebInspector.UIString("Heavy (Bottom Up)"), "", WebInspector.CPUProfi leView._TypeHeavy); 56 options[WebInspector.CPUProfileView._TypeHeavy] = this.viewSelectComboBox.cr eateOption(WebInspector.UIString("Heavy (Bottom Up)"), "", WebInspector.CPUProfi leView._TypeHeavy);
57 options[WebInspector.CPUProfileView._TypeTree] = this.viewSelectComboBox.cre ateOption(WebInspector.UIString("Tree (Top Down)"), "", WebInspector.CPUProfileV iew._TypeTree); 57 options[WebInspector.CPUProfileView._TypeTree] = this.viewSelectComboBox.cre ateOption(WebInspector.UIString("Tree (Top Down)"), "", WebInspector.CPUProfileV iew._TypeTree);
58 58
59 var optionName = this._viewType.get() || WebInspector.CPUProfileView._TypeFl ame; 59 var optionName = this._viewType.get() || WebInspector.CPUProfileView._TypeFl ame;
60 var option = options[optionName] || options[WebInspector.CPUProfileView._Typ eFlame]; 60 var option = options[optionName] || options[WebInspector.CPUProfileView._Typ eFlame];
61 this.viewSelectComboBox.select(option); 61 this.viewSelectComboBox.select(option);
62 62
63 this._statusBarButtonsElement = document.createElement("span"); 63 this._statusBarButtonsElement = document.createElement("span");
64 64
65 this.percentButton = new WebInspector.StatusBarButton("", "percent-time-stat us-bar-item"); 65 this.percentButton = new WebInspector.StatusBarButton("", "percent-time-stat us-bar-item");
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 /** 1049 /**
1050 * @constructor 1050 * @constructor
1051 * @implements {WebInspector.FlameChartDataProvider} 1051 * @implements {WebInspector.FlameChartDataProvider}
1052 * @param {!WebInspector.CPUProfileView} cpuProfileView 1052 * @param {!WebInspector.CPUProfileView} cpuProfileView
1053 */ 1053 */
1054 WebInspector.CPUFlameChartDataProvider = function(cpuProfileView) 1054 WebInspector.CPUFlameChartDataProvider = function(cpuProfileView)
1055 { 1055 {
1056 WebInspector.FlameChartDataProvider.call(this); 1056 WebInspector.FlameChartDataProvider.call(this);
1057 this._cpuProfileView = cpuProfileView; 1057 this._cpuProfileView = cpuProfileView;
1058 this._colorGenerator = WebInspector.CPUProfileView.colorGenerator(); 1058 this._colorGenerator = WebInspector.CPUProfileView.colorGenerator();
1059 this._linkifier = new WebInspector.Linkifier();
1059 } 1060 }
1060 1061
1061 WebInspector.CPUFlameChartDataProvider.prototype = { 1062 WebInspector.CPUFlameChartDataProvider.prototype = {
1062 /** 1063 /**
1063 * @return {number} 1064 * @return {number}
1064 */ 1065 */
1065 barHeight: function() 1066 barHeight: function()
1066 { 1067 {
1067 return 15; 1068 return 15;
1068 }, 1069 },
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 row.title = title; 1278 row.title = title;
1278 row.text = text; 1279 row.text = text;
1279 entryInfo.push(row); 1280 entryInfo.push(row);
1280 } 1281 }
1281 1282
1282 pushEntryInfoRow(WebInspector.UIString("Name"), node.functionName); 1283 pushEntryInfoRow(WebInspector.UIString("Name"), node.functionName);
1283 var selfTime = this._millisecondsToString(this._entrySelfTimes[entryInde x]); 1284 var selfTime = this._millisecondsToString(this._entrySelfTimes[entryInde x]);
1284 var totalTime = this._millisecondsToString(timelineData.entryTotalTimes[ entryIndex]); 1285 var totalTime = this._millisecondsToString(timelineData.entryTotalTimes[ entryIndex]);
1285 pushEntryInfoRow(WebInspector.UIString("Self time"), selfTime); 1286 pushEntryInfoRow(WebInspector.UIString("Self time"), selfTime);
1286 pushEntryInfoRow(WebInspector.UIString("Total time"), totalTime); 1287 pushEntryInfoRow(WebInspector.UIString("Total time"), totalTime);
1287 if (node.url) 1288 var linkElement = this._linkifier.linkifyRawLocation(new WebInspector.De buggerModel.Location(node.scriptId, node.lineNumber, node.columnNumber));
pfeldman 2014/03/26 09:33:46 just create local linkifier.
1288 pushEntryInfoRow(WebInspector.UIString("URL"), node.url + ":" + node .lineNumber); 1289 pushEntryInfoRow(WebInspector.UIString("URL"), linkElement ? linkElement .innerText : "");
pfeldman 2014/03/26 09:33:46 You should never use innerText. Use textContent in
1290 // We need only text of the link so we can reset linkifier immedeately.
1291 // Othervise linkifier will keep the references to the elements and upda te them each time when user clicks pretty print.
1292 this._linkifier.reset();
1289 pushEntryInfoRow(WebInspector.UIString("Aggregated self time"), Number.s econdsToString(node.selfTime / 1000, true)); 1293 pushEntryInfoRow(WebInspector.UIString("Aggregated self time"), Number.s econdsToString(node.selfTime / 1000, true));
1290 pushEntryInfoRow(WebInspector.UIString("Aggregated total time"), Number. secondsToString(node.totalTime / 1000, true)); 1294 pushEntryInfoRow(WebInspector.UIString("Aggregated total time"), Number. secondsToString(node.totalTime / 1000, true));
1291 if (node.deoptReason && node.deoptReason !== "no reason") 1295 if (node.deoptReason && node.deoptReason !== "no reason")
1292 pushEntryInfoRow(WebInspector.UIString("Not optimized"), node.deoptR eason); 1296 pushEntryInfoRow(WebInspector.UIString("Not optimized"), node.deoptR eason);
1293 1297
1294 return entryInfo; 1298 return entryInfo;
1295 }, 1299 },
1296 1300
1297 /** 1301 /**
1298 * @param {number} entryIndex 1302 * @param {number} entryIndex
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 1390
1387 /** 1391 /**
1388 * @param {number} entryIndex 1392 * @param {number} entryIndex
1389 * @return {!string} 1393 * @return {!string}
1390 */ 1394 */
1391 textColor: function(entryIndex) 1395 textColor: function(entryIndex)
1392 { 1396 {
1393 return "#333"; 1397 return "#333";
1394 } 1398 }
1395 } 1399 }
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/FlameChart.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698