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

Unified Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineNetworkFlameChart.js

Issue 2662453004: DevTools: Update network overview with two level bars. (Closed)
Patch Set: fix compile error Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelineNetworkFlameChart.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineNetworkFlameChart.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineNetworkFlameChart.js
index edc70622a092f52e78644bf9b65446ce2c9007a2..08c90933a253f1c2f857a5aba5fb6d50dd6e83aa 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineNetworkFlameChart.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineNetworkFlameChart.js
@@ -298,19 +298,17 @@ Timeline.TimelineFlameChartNetworkDataProvider = class {
* @return {?string}
*/
_colorForPriority(priority) {
- switch (/** @type {!Protocol.Network.ResourcePriority} */ (priority)) {
- case Protocol.Network.ResourcePriority.VeryLow:
- return '#080';
- case Protocol.Network.ResourcePriority.Low:
- return '#6c0';
- case Protocol.Network.ResourcePriority.Medium:
- return '#fa0';
- case Protocol.Network.ResourcePriority.High:
- return '#f60';
- case Protocol.Network.ResourcePriority.VeryHigh:
- return '#f00';
+ if (!this._priorityToValue) {
+ var priorities = Protocol.Network.ResourcePriority;
+ this._priorityToValue = new Map([
+ [priorities.VeryLow, 1],
+ [priorities.Low, 2],
+ [priorities.Medium, 3],
+ [priorities.High, 4],
+ [priorities.VeryHigh, 5]]);
}
- return null;
+ var value = this._priorityToValue.get(priority);
+ return value ? `hsla(214, 80%, 50%, ${value / 5})` : null;
}
/**

Powered by Google App Engine
This is Rietveld 408576698