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

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

Issue 2581423002: DevTools: Decorate requests from SW on Timeline (Closed)
Patch Set: Created 4 years 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 a87831d864b33204a87fe984412677eec54bf3bb..974a0f7fffd0266cfca9d2321d207e6fe9485fd9 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineNetworkFlameChart.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineNetworkFlameChart.js
@@ -198,13 +198,18 @@ Timeline.TimelineFlameChartNetworkDataProvider = class extends Timeline.Timeline
const textWidth = finish - textStart;
const minTextWidthPx = 20;
const textPadding = 6;
+ var gearPadding = 0;
if (textWidth >= minTextWidthPx) {
const text = this.entryTitle(index);
if (text && text.length) {
context.fillStyle = '#333';
- const trimmedText = UI.trimTextMiddle(context, text, textWidth - 2 * textPadding);
const textBaseHeight = barHeight - this.textBaseline();
- context.fillText(trimmedText, textStart + textPadding, barY + textBaseHeight);
+ if (request.fromServiceWorker) {
+ context.fillText('⚙', textStart + textPadding, barY + textBaseHeight);
+ gearPadding = UI.measureTextWidth(context, '⚙ ');
+ }
+ const trimmedText = UI.trimTextMiddle(context, text, textWidth - 2 * textPadding - gearPadding);
+ context.fillText(trimmedText, textStart + textPadding + gearPadding, barY + textBaseHeight);
}
}

Powered by Google App Engine
This is Rietveld 408576698