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

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

Issue 2863293002: DevTools: Support color by Product on timeline flamechart. (Closed)
Patch Set: addressing comments Created 3 years, 7 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/TimelineFlameChartDataProvider.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartDataProvider.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartDataProvider.js
index 693acbeec93433e2371fbfba9618d19b22365120..585c9d0b0a957618b08fbe7ecd49486e03af8988 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartDataProvider.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartDataProvider.js
@@ -535,7 +535,7 @@ Timeline.TimelineFlameChartDataProvider = class extends Common.Object {
if (type === Timeline.TimelineFlameChartEntryType.Event) {
var event = /** @type {!SDK.TracingModel.Event} */ (this._entryData[entryIndex]);
if (!SDK.TracingModel.isAsyncPhase(event.phase))
- return Timeline.TimelineUIUtils.eventColor(event);
+ return this._colorForEvent(event);
if (event.hasCategory(TimelineModel.TimelineModel.Category.Console) ||
event.hasCategory(TimelineModel.TimelineModel.Category.UserTiming))
return this._consoleColorGenerator.colorForID(event.name);
@@ -965,6 +965,13 @@ Timeline.TimelineFlameChartDataProvider = class extends Common.Object {
/** @type {!SDK.TracingModel.Event} */ (this._entryData[entryIndex]) :
null;
}
+
+ /**
+ * @param {function(!SDK.TracingModel.Event):string} colorForEvent
+ */
+ setEventColorMapping(colorForEvent) {
+ this._colorForEvent = colorForEvent;
+ }
};
Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.001;

Powered by Google App Engine
This is Rietveld 408576698