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

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

Issue 1636853002: Timeline: simplify handling of event category colors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 if (type === WebInspector.TimelineFlameChartEntryType.Event) { 600 if (type === WebInspector.TimelineFlameChartEntryType.Event) {
601 var event = /** @type {!WebInspector.TracingModel.Event} */ (this._e ntryData[entryIndex]); 601 var event = /** @type {!WebInspector.TracingModel.Event} */ (this._e ntryData[entryIndex]);
602 if (!WebInspector.TracingModel.isAsyncPhase(event.phase)) 602 if (!WebInspector.TracingModel.isAsyncPhase(event.phase))
603 return WebInspector.TimelineUIUtils.eventColor(event); 603 return WebInspector.TimelineUIUtils.eventColor(event);
604 if (event.hasCategory(WebInspector.TimelineModel.Category.Console) | | event.hasCategory(WebInspector.TimelineModel.Category.UserTiming)) 604 if (event.hasCategory(WebInspector.TimelineModel.Category.Console) | | event.hasCategory(WebInspector.TimelineModel.Category.UserTiming))
605 return this._consoleColorGenerator.colorForID(event.name); 605 return this._consoleColorGenerator.colorForID(event.name);
606 var category = WebInspector.TimelineUIUtils.eventStyle(event).catego ry; 606 var category = WebInspector.TimelineUIUtils.eventStyle(event).catego ry;
607 var color = this._asyncColorByCategory[category.name]; 607 var color = this._asyncColorByCategory[category.name];
608 if (color) 608 if (color)
609 return color; 609 return color;
610 var parsedColor = WebInspector.Color.parse(category.fillColorStop1); 610 var parsedColor = WebInspector.Color.parse(category.color);
611 color = parsedColor.setAlpha(0.7).asString(WebInspector.Color.Format .RGBA) || ""; 611 color = parsedColor.setAlpha(0.7).asString(WebInspector.Color.Format .RGBA) || "";
612 this._asyncColorByCategory[category.name] = color; 612 this._asyncColorByCategory[category.name] = color;
613 return color; 613 return color;
614 } 614 }
615 if (type === WebInspector.TimelineFlameChartEntryType.Frame) 615 if (type === WebInspector.TimelineFlameChartEntryType.Frame)
616 return "white"; 616 return "white";
617 if (type === WebInspector.TimelineFlameChartEntryType.Header) 617 if (type === WebInspector.TimelineFlameChartEntryType.Header)
618 return "#aaa"; 618 return "#aaa";
619 return ""; 619 return "";
620 }, 620 },
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 854
855 /** 855 /**
856 * @constructor 856 * @constructor
857 * @extends {WebInspector.TimelineFlameChartDataProviderBase} 857 * @extends {WebInspector.TimelineFlameChartDataProviderBase}
858 * @param {!WebInspector.TimelineModel} model 858 * @param {!WebInspector.TimelineModel} model
859 */ 859 */
860 WebInspector.TimelineFlameChartNetworkDataProvider = function(model) 860 WebInspector.TimelineFlameChartNetworkDataProvider = function(model)
861 { 861 {
862 WebInspector.TimelineFlameChartDataProviderBase.call(this, model); 862 WebInspector.TimelineFlameChartDataProviderBase.call(this, model);
863 var loadingCategory = WebInspector.TimelineUIUtils.categories()["loading"]; 863 var loadingCategory = WebInspector.TimelineUIUtils.categories()["loading"];
864 this._waitingColor = loadingCategory.backgroundColor; 864 this._waitingColor = loadingCategory.childColor;
865 this._processingColor = loadingCategory.fillColorStop1; 865 this._processingColor = loadingCategory.color;
866 } 866 }
867 867
868 WebInspector.TimelineFlameChartNetworkDataProvider.prototype = { 868 WebInspector.TimelineFlameChartNetworkDataProvider.prototype = {
869 /** 869 /**
870 * @override 870 * @override
871 * @return {!WebInspector.FlameChart.TimelineData} 871 * @return {!WebInspector.FlameChart.TimelineData}
872 */ 872 */
873 timelineData: function() 873 timelineData: function()
874 { 874 {
875 if (this._timelineData) 875 if (this._timelineData)
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 /** 1402 /**
1403 * @constructor 1403 * @constructor
1404 * @param {!WebInspector.TimelineSelection} selection 1404 * @param {!WebInspector.TimelineSelection} selection
1405 * @param {number} entryIndex 1405 * @param {number} entryIndex
1406 */ 1406 */
1407 WebInspector.TimelineFlameChartView.Selection = function(selection, entryIndex) 1407 WebInspector.TimelineFlameChartView.Selection = function(selection, entryIndex)
1408 { 1408 {
1409 this.timelineSelection = selection; 1409 this.timelineSelection = selection;
1410 this.entryIndex = entryIndex; 1410 this.entryIndex = entryIndex;
1411 } 1411 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698