Open Bug 1691095 Opened 4 years ago Updated 4 years ago

Make category colors an enum

Categories

(Core :: Gecko Profiler, defect, P2)

defect

Tracking

()

People

(Reporter: mstange, Unassigned)

Details

The macros in ProfilingCategoryList.h currently use strings for the category color. However, only a fixed list of color names is available - that's because we want the front-end to pick the actual color value based on the devtools color palette.
It's easy to miss the fact that only certain values are allowed, and the color names look like CSS color names. It would be better to use an enum so that these mistakes can be avoided.

Or... Should we allow any CSS color value?

Severity: -- → S3
Priority: -- → P2

(In reply to Markus Stange [:mstange] from comment #0)

we want the front-end to pick the actual color value based on the devtools color palette

I also think we've very much reached the limit of different colors that we want to show to the user.

(In reply to Markus Stange [:mstange] from comment #2)

(In reply to Markus Stange [:mstange] from comment #0)

we want the front-end to pick the actual color value based on the devtools color palette

I also think we've very much reached the limit of different colors that we want to show to the user.

I think adding red (we already show that color for jank markers; we could also use it to indicate something in the category view) would be OK, and I would like to use it to highlight profiler overhead (see bug 1691092).

I could also see black being useful in the future (I was wondering if we might want to use it for time blocked on sync IPC).

And the idle category is "transparent", but actually shown as dark grey in the sidebar; I think we could also make that dark grey color available if needed in the future (the use case I had in mind is test harness code, to separate it from code that's actually part of the browser).

But otherwise, I agree that we've probably reached the maximum number of category colors for showing code that's running as part of the browser.

You need to log in before you can comment on or make changes to this bug.