Repository: servo/servo
File: components/shared/profile/time.rs (Rust)

Code before:
    ScriptTimerEvent = 0x72,
    ScriptStylesheetLoad = 0x73,
    ScriptUpdateReplacedElement = 0x74,
    ScriptWebSocketEvent = 0x75,
    ScriptWorkerEvent = 0x76,
    ScriptServiceWorkerEvent = 0x77,

    /// The script thread is parsing XML, rather than doing other work like evaluating scripts or doing layout.
    ScriptParseXML = 0x78,

    ScriptEnterFullscreen = 0x79,
    ScriptExitFullscreen = 0x7a,
    ScriptWorkletEvent = 0x7b,
    ScriptGeolocationEvent = 0x7c,
    ScriptPerformanceEvent = 0x7d,
    ScriptHistoryEvent = 0x7e,
    ScriptPortMessage = 0x7f,
    ScriptWebGPUMsg = 0x80,

    ScriptDatabaseAccessEvent = 0x81,

    /// Web performance metrics.
    TimeToFirstPaint = 0x90,
    TimeToFirstContentfulPaint = 0x91,
    TimeToInteractive = 0x92,
    TimeToLargestContentfulPaint = 0x95,

    IpcReceiver = 0x93,
    IpcBytesReceiver = 0x94,
}

impl ProfilerCategory {
    pub const fn variant_name(&self) -> &'static str {
        match self {
            ProfilerCategory::Compositing => "Compositing",
            ProfilerCategory::Layout => "Layout",
            ProfilerCategory::ImageSaving => "ImageSaving",
            ProfilerCategory::ScriptAttachLayout => "ScriptAttachLayout",
            ProfilerCategory::ScriptConstellationMsg => "ScriptConstellationMsg",
            ProfilerCategory::ScriptDatabaseAccessEvent => "ScriptDatabaseAccessEvent",
            ProfilerCategory::ScriptDevtoolsMsg => "ScriptDevtoolsMsg",
            ProfilerCategory::ScriptDocumentEvent => "ScriptDocumentEvent",
            ProfilerCategory::ScriptEvaluate => "ScriptEvaluate",
            ProfilerCategory::ScriptEvent => "ScriptEvent",
            ProfilerCategory::ScriptFileRead => "ScriptFileRead",
            ProfilerCategory::ScriptFontLoading => "ScriptFontLoading",
            ProfilerCategory::ScriptGeolocationEvent => "ScriptGeolocationEvent",
            ProfilerCategory::ScriptImageCacheMsg => "ScriptImageCacheMsg",
            ProfilerCategory::ScriptInputEvent => "ScriptInputEvent",
            ProfilerCategory::ScriptNetworkEvent => "ScriptNetworkEvent",
            ProfilerCategory::ScriptParseHTML => "ScriptParseHTML",

Review comment (bug):
After taking more look into the change log of this file, it appears that changing existing enum values is pretty common... So my previous review comment is wrong, and let's keep the values consecutive:

Make `TimeToLargestContentfulPaint` 0x93, and change the remaining two values to 0x94 and x095.


Code after:
    ScriptTimerEvent = 0x72,
    ScriptStylesheetLoad = 0x73,
    ScriptUpdateReplacedElement = 0x74,
    ScriptWebSocketEvent = 0x75,
    ScriptWorkerEvent = 0x76,
    ScriptServiceWorkerEvent = 0x77,

    /// The script thread is parsing XML, rather than doing other work like evaluating scripts or doing layout.
    ScriptParseXML = 0x78,

    ScriptEnterFullscreen = 0x79,
    ScriptExitFullscreen = 0x7a,
    ScriptWorkletEvent = 0x7b,
    ScriptGeolocationEvent = 0x7c,
    ScriptPerformanceEvent = 0x7d,
    ScriptHistoryEvent = 0x7e,
    ScriptPortMessage = 0x7f,
    ScriptWebGPUMsg = 0x80,

    ScriptDatabaseAccessEvent = 0x81,

    /// Web performance metrics.
    TimeToFirstPaint = 0x90,
    TimeToFirstContentfulPaint = 0x91,
    TimeToInteractive = 0x92,
    TimeToLargestContentfulPaint = 0x93,

    IpcReceiver = 0x94,
    IpcBytesReceiver = 0x95,
}

impl ProfilerCategory {
    pub const fn variant_name(&self) -> &'static str {
        match self {
            ProfilerCategory::Compositing => "Compositing",
            ProfilerCategory::Layout => "Layout",
            ProfilerCategory::ImageSaving => "ImageSaving",
            ProfilerCategory::ScriptAttachLayout => "ScriptAttachLayout",
            ProfilerCategory::ScriptConstellationMsg => "ScriptConstellationMsg",
            ProfilerCategory::ScriptDatabaseAccessEvent => "ScriptDatabaseAccessEvent",
            ProfilerCategory::ScriptDevtoolsMsg => "ScriptDevtoolsMsg",
            ProfilerCategory::ScriptDocumentEvent => "ScriptDocumentEvent",
            ProfilerCategory::ScriptEvaluate => "ScriptEvaluate",
            ProfilerCategory::ScriptEvent => "ScriptEvent",
            ProfilerCategory::ScriptFileRead => "ScriptFileRead",
            ProfilerCategory::ScriptFontLoading => "ScriptFontLoading",
            ProfilerCategory::ScriptGeolocationEvent => "ScriptGeolocationEvent",
            ProfilerCategory::ScriptImageCacheMsg => "ScriptImageCacheMsg",
            ProfilerCategory::ScriptInputEvent => "ScriptInputEvent",
            ProfilerCategory::ScriptNetworkEvent => "ScriptNetworkEvent",
            ProfilerCategory::ScriptParseHTML => "ScriptParseHTML",