@paulirish/trace_engine 0.0.56 → 0.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +1 -1
- package/README.md +2 -2
- package/core/platform/Brand.d.ts +8 -1
- package/core/platform/Brand.js.map +1 -1
- package/core/platform/DevToolsPath.d.ts +1 -1
- package/core/platform/DevToolsPath.js +1 -1
- package/core/platform/DevToolsPath.js.map +1 -1
- package/core/platform/StringUtilities.d.ts +12 -2
- package/core/platform/StringUtilities.js +31 -7
- package/core/platform/StringUtilities.js.map +1 -1
- package/generated/protocol.d.ts +8290 -7994
- package/locales/af.json +82 -67
- package/locales/am.json +82 -67
- package/locales/ar.json +93 -78
- package/locales/as.json +82 -67
- package/locales/az.json +82 -67
- package/locales/be.json +81 -66
- package/locales/bg.json +82 -67
- package/locales/bn.json +82 -67
- package/locales/bs.json +82 -67
- package/locales/ca.json +82 -67
- package/locales/cs.json +82 -67
- package/locales/cy.json +82 -67
- package/locales/da.json +82 -67
- package/locales/de.json +82 -67
- package/locales/el.json +82 -67
- package/locales/en-GB.json +82 -67
- package/locales/en-US.json +13 -10
- package/locales/en-XL.json +13 -10
- package/locales/es-419.json +82 -67
- package/locales/es.json +82 -67
- package/locales/et.json +82 -67
- package/locales/eu.json +82 -67
- package/locales/fa.json +86 -71
- package/locales/fi.json +82 -67
- package/locales/fil.json +82 -67
- package/locales/fr-CA.json +82 -67
- package/locales/fr.json +82 -67
- package/locales/gl.json +82 -67
- package/locales/gu.json +82 -67
- package/locales/he.json +104 -89
- package/locales/hi.json +82 -67
- package/locales/hr.json +82 -67
- package/locales/hu.json +82 -67
- package/locales/hy.json +82 -67
- package/locales/id.json +82 -67
- package/locales/is.json +82 -67
- package/locales/it.json +82 -67
- package/locales/ja.json +82 -67
- package/locales/ka.json +82 -67
- package/locales/kk.json +82 -67
- package/locales/km.json +82 -67
- package/locales/kn.json +81 -66
- package/locales/ko.json +82 -67
- package/locales/ky.json +81 -66
- package/locales/lo.json +82 -67
- package/locales/lt.json +82 -67
- package/locales/lv.json +82 -67
- package/locales/mk.json +82 -67
- package/locales/ml.json +82 -67
- package/locales/mn.json +82 -67
- package/locales/mr.json +81 -66
- package/locales/ms.json +81 -66
- package/locales/my.json +83 -68
- package/locales/ne.json +83 -68
- package/locales/nl.json +82 -67
- package/locales/no.json +82 -67
- package/locales/or.json +82 -67
- package/locales/pa.json +81 -66
- package/locales/pl.json +82 -67
- package/locales/pt-PT.json +82 -67
- package/locales/pt.json +82 -67
- package/locales/ro.json +82 -67
- package/locales/ru.json +82 -67
- package/locales/si.json +82 -67
- package/locales/sk.json +82 -67
- package/locales/sl.json +82 -67
- package/locales/sq.json +82 -67
- package/locales/sr-Latn.json +82 -67
- package/locales/sr.json +82 -67
- package/locales/sv.json +82 -67
- package/locales/sw.json +81 -66
- package/locales/ta.json +82 -67
- package/locales/te.json +82 -67
- package/locales/th.json +84 -69
- package/locales/tr.json +81 -66
- package/locales/uk.json +81 -66
- package/locales/ur.json +82 -67
- package/locales/uz.json +81 -66
- package/locales/vi.json +82 -67
- package/locales/zh-HK.json +82 -67
- package/locales/zh-TW.json +82 -67
- package/locales/zh.json +82 -67
- package/locales/zu.json +82 -67
- package/models/trace/ModelImpl.d.ts +1 -1
- package/models/trace/ModelImpl.js +17 -7
- package/models/trace/ModelImpl.js.map +1 -1
- package/models/trace/Processor.js +26 -16
- package/models/trace/Processor.js.map +1 -1
- package/models/trace/extras/ThirdParties.js +1 -2
- package/models/trace/extras/ThirdParties.js.map +1 -1
- package/models/trace/extras/TraceTree.d.ts +4 -2
- package/models/trace/extras/TraceTree.js +7 -5
- package/models/trace/extras/TraceTree.js.map +1 -1
- package/models/trace/handlers/AnimationFramesHandler.d.ts +1 -0
- package/models/trace/handlers/AnimationFramesHandler.js +8 -0
- package/models/trace/handlers/AnimationFramesHandler.js.map +1 -1
- package/models/trace/handlers/ExtensionTraceDataHandler.d.ts +1 -1
- package/models/trace/handlers/ExtensionTraceDataHandler.js +29 -15
- package/models/trace/handlers/ExtensionTraceDataHandler.js.map +1 -1
- package/models/trace/handlers/FramesHandler.js +38 -28
- package/models/trace/handlers/FramesHandler.js.map +1 -1
- package/models/trace/handlers/ImagePaintingHandler.d.ts +2 -1
- package/models/trace/handlers/ImagePaintingHandler.js.map +1 -1
- package/models/trace/handlers/InitiatorsHandler.js +27 -0
- package/models/trace/handlers/InitiatorsHandler.js.map +1 -1
- package/models/trace/handlers/NetworkRequestsHandler.js +12 -2
- package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -1
- package/models/trace/handlers/RendererHandler.d.ts +0 -5
- package/models/trace/handlers/RendererHandler.js +9 -12
- package/models/trace/handlers/RendererHandler.js.map +1 -1
- package/models/trace/handlers/SamplesHandler.js +6 -12
- package/models/trace/handlers/SamplesHandler.js.map +1 -1
- package/models/trace/handlers/ScriptsHandler.d.ts +4 -3
- package/models/trace/handlers/ScriptsHandler.js +3 -0
- package/models/trace/handlers/ScriptsHandler.js.map +1 -1
- package/models/trace/handlers/SelectorStatsHandler.d.ts +17 -0
- package/models/trace/handlers/SelectorStatsHandler.js +42 -0
- package/models/trace/handlers/SelectorStatsHandler.js.map +1 -1
- package/models/trace/handlers/UserInteractionsHandler.d.ts +4 -2
- package/models/trace/handlers/UserInteractionsHandler.js.map +1 -1
- package/models/trace/handlers/helpers.d.ts +3 -6
- package/models/trace/handlers/helpers.js +17 -9
- package/models/trace/handlers/helpers.js.map +1 -1
- package/models/trace/handlers/types.d.ts +4 -1
- package/models/trace/handlers/types.js.map +1 -1
- package/models/trace/helpers/SamplesIntegrator.d.ts +1 -0
- package/models/trace/helpers/SamplesIntegrator.js +21 -21
- package/models/trace/helpers/SamplesIntegrator.js.map +1 -1
- package/models/trace/helpers/SyntheticEvents.d.ts +0 -6
- package/models/trace/helpers/SyntheticEvents.js +2 -2
- package/models/trace/helpers/SyntheticEvents.js.map +1 -1
- package/models/trace/helpers/Timing.d.ts +5 -0
- package/models/trace/helpers/Timing.js +55 -3
- package/models/trace/helpers/Timing.js.map +1 -1
- package/models/trace/helpers/Trace.d.ts +1 -1
- package/models/trace/helpers/Trace.js +1 -1
- package/models/trace/helpers/Trace.js.map +1 -1
- package/models/trace/helpers/TreeHelpers.d.ts +1 -1
- package/models/trace/helpers/TreeHelpers.js.map +1 -1
- package/models/trace/insights/CLSCulprits.d.ts +3 -2
- package/models/trace/insights/CLSCulprits.js +24 -2
- package/models/trace/insights/CLSCulprits.js.map +1 -1
- package/models/trace/insights/Cache.d.ts +2 -0
- package/models/trace/insights/Cache.js +10 -0
- package/models/trace/insights/Cache.js.map +1 -1
- package/models/trace/insights/Common.d.ts +6 -5
- package/models/trace/insights/Common.js +29 -17
- package/models/trace/insights/Common.js.map +1 -1
- package/models/trace/insights/DOMSize.d.ts +2 -1
- package/models/trace/insights/DOMSize.js +9 -1
- package/models/trace/insights/DOMSize.js.map +1 -1
- package/models/trace/insights/DocumentLatency.d.ts +3 -2
- package/models/trace/insights/DocumentLatency.js +44 -2
- package/models/trace/insights/DocumentLatency.js.map +1 -1
- package/models/trace/insights/DuplicatedJavaScript.d.ts +3 -0
- package/models/trace/insights/DuplicatedJavaScript.js +12 -3
- package/models/trace/insights/DuplicatedJavaScript.js.map +1 -1
- package/models/trace/insights/FontDisplay.d.ts +1 -0
- package/models/trace/insights/FontDisplay.js +7 -0
- package/models/trace/insights/FontDisplay.js.map +1 -1
- package/models/trace/insights/ForcedReflow.d.ts +5 -3
- package/models/trace/insights/ForcedReflow.js +20 -3
- package/models/trace/insights/ForcedReflow.js.map +1 -1
- package/models/trace/insights/INPBreakdown.d.ts +11 -5
- package/models/trace/insights/INPBreakdown.js +36 -5
- package/models/trace/insights/INPBreakdown.js.map +1 -1
- package/models/trace/insights/ImageDelivery.d.ts +4 -0
- package/models/trace/insights/ImageDelivery.js +13 -0
- package/models/trace/insights/ImageDelivery.js.map +1 -1
- package/models/trace/insights/LCPBreakdown.d.ts +7 -6
- package/models/trace/insights/LCPBreakdown.js +33 -12
- package/models/trace/insights/LCPBreakdown.js.map +1 -1
- package/models/trace/insights/LCPDiscovery.d.ts +14 -2
- package/models/trace/insights/LCPDiscovery.js +60 -2
- package/models/trace/insights/LCPDiscovery.js.map +1 -1
- package/models/trace/insights/LegacyJavaScript.d.ts +3 -0
- package/models/trace/insights/LegacyJavaScript.js +12 -3
- package/models/trace/insights/LegacyJavaScript.js.map +1 -1
- package/models/trace/insights/ModernHTTP.d.ts +8 -5
- package/models/trace/insights/ModernHTTP.js +27 -14
- package/models/trace/insights/ModernHTTP.js.map +1 -1
- package/models/trace/insights/NetworkDependencyTree.d.ts +1 -0
- package/models/trace/insights/NetworkDependencyTree.js +25 -1
- package/models/trace/insights/NetworkDependencyTree.js.map +1 -1
- package/models/trace/insights/RenderBlocking.d.ts +3 -1
- package/models/trace/insights/RenderBlocking.js +11 -1
- package/models/trace/insights/RenderBlocking.js.map +1 -1
- package/models/trace/insights/SlowCSSSelector.d.ts +17 -8
- package/models/trace/insights/SlowCSSSelector.js +39 -20
- package/models/trace/insights/SlowCSSSelector.js.map +1 -1
- package/models/trace/insights/ThirdParties.d.ts +3 -0
- package/models/trace/insights/ThirdParties.js +31 -0
- package/models/trace/insights/ThirdParties.js.map +1 -1
- package/models/trace/insights/Viewport.d.ts +2 -1
- package/models/trace/insights/Viewport.js +16 -0
- package/models/trace/insights/Viewport.js.map +1 -1
- package/models/trace/insights/types.d.ts +4 -1
- package/models/trace/insights/types.js +1 -0
- package/models/trace/insights/types.js.map +1 -1
- package/models/trace/lantern/graph/BaseNode.d.ts +1 -1
- package/models/trace/lantern/graph/BaseNode.js +1 -1
- package/models/trace/lantern/graph/BaseNode.js.map +1 -1
- package/models/trace/lantern/simulation/SimulationTimingMap.js +1 -1
- package/models/trace/lantern/simulation/SimulationTimingMap.js.map +1 -1
- package/models/trace/types/Configuration.d.ts +7 -0
- package/models/trace/types/Configuration.js +1 -0
- package/models/trace/types/Configuration.js.map +1 -1
- package/models/trace/types/Extensions.d.ts +14 -2
- package/models/trace/types/Extensions.js +5 -1
- package/models/trace/types/Extensions.js.map +1 -1
- package/models/trace/types/File.d.ts +3 -0
- package/models/trace/types/File.js.map +1 -1
- package/models/trace/types/Overlays.d.ts +115 -0
- package/models/trace/types/Overlays.js +5 -0
- package/models/trace/types/Overlays.js.map +1 -0
- package/models/trace/types/TraceEvents.d.ts +79 -36
- package/models/trace/types/TraceEvents.js +8 -13
- package/models/trace/types/TraceEvents.js.map +1 -1
- package/models/trace/types/types-tsconfig.json +1 -0
- package/models/trace/types/types.d.ts +1 -0
- package/models/trace/types/types.js +1 -0
- package/models/trace/types/types.js.map +1 -1
- package/package.json +1 -1
- package/test/test-trace-engine.mjs +1 -2
- package/core/platform/devtools_entrypoint-bundle-tsconfig-tsconfig.json +0 -43
- package/core/platform/platform.prebundle.d.ts +0 -18
- package/core/platform/platform.prebundle.js +0 -53
- package/core/platform/platform.prebundle.js.map +0 -1
- package/core/platform/platform.prebundle.ts +0 -71
- package/models/cpu_profile/cpu_profile.prebundle.d.ts +0 -3
- package/models/cpu_profile/cpu_profile.prebundle.js +0 -7
- package/models/cpu_profile/cpu_profile.prebundle.js.map +0 -1
- package/models/cpu_profile/cpu_profile.prebundle.ts +0 -11
- package/models/cpu_profile/devtools_entrypoint-bundle-tsconfig-tsconfig.json +0 -43
- package/models/trace/devtools_entrypoint-bundle-tsconfig-tsconfig.json +0 -61
- package/models/trace/extras/devtools_entrypoint-bundle-tsconfig-tsconfig.json +0 -43
- package/models/trace/extras/extras.prebundle.d.ts +0 -7
- package/models/trace/extras/extras.prebundle.js +0 -11
- package/models/trace/extras/extras.prebundle.js.map +0 -1
- package/models/trace/extras/extras.prebundle.ts +0 -11
- package/models/trace/handlers/devtools_entrypoint-bundle-tsconfig-tsconfig.json +0 -43
- package/models/trace/handlers/handlers.prebundle.d.ts +0 -4
- package/models/trace/handlers/handlers.prebundle.js +0 -8
- package/models/trace/handlers/handlers.prebundle.js.map +0 -1
- package/models/trace/handlers/handlers.prebundle.ts +0 -8
- package/models/trace/helpers/devtools_entrypoint-bundle-tsconfig-tsconfig.json +0 -43
- package/models/trace/helpers/helpers.prebundle.d.ts +0 -7
- package/models/trace/helpers/helpers.prebundle.js +0 -11
- package/models/trace/helpers/helpers.prebundle.js.map +0 -1
- package/models/trace/helpers/helpers.prebundle.ts +0 -11
- package/models/trace/insights/devtools_entrypoint-bundle-tsconfig-tsconfig.json +0 -43
- package/models/trace/insights/insights.prebundle.d.ts +0 -4
- package/models/trace/insights/insights.prebundle.js +0 -8
- package/models/trace/insights/insights.prebundle.js.map +0 -1
- package/models/trace/insights/insights.prebundle.ts +0 -8
- package/models/trace/lantern/core/core.prebundle.d.ts +0 -2
- package/models/trace/lantern/core/core.prebundle.js +0 -6
- package/models/trace/lantern/core/core.prebundle.js.map +0 -1
- package/models/trace/lantern/core/core.prebundle.ts +0 -6
- package/models/trace/lantern/core/devtools_entrypoint-bundle-tsconfig-tsconfig.json +0 -43
- package/models/trace/lantern/devtools_entrypoint-bundle-tsconfig-tsconfig.json +0 -43
- package/models/trace/lantern/graph/devtools_entrypoint-bundle-tsconfig-tsconfig.json +0 -43
- package/models/trace/lantern/graph/graph.prebundle.d.ts +0 -4
- package/models/trace/lantern/graph/graph.prebundle.js +0 -8
- package/models/trace/lantern/graph/graph.prebundle.js.map +0 -1
- package/models/trace/lantern/graph/graph.prebundle.ts +0 -8
- package/models/trace/lantern/lantern.prebundle.d.ts +0 -6
- package/models/trace/lantern/lantern.prebundle.js +0 -10
- package/models/trace/lantern/lantern.prebundle.js.map +0 -1
- package/models/trace/lantern/lantern.prebundle.ts +0 -17
- package/models/trace/lantern/metrics/devtools_entrypoint-bundle-tsconfig-tsconfig.json +0 -43
- package/models/trace/lantern/metrics/metrics.prebundle.d.ts +0 -8
- package/models/trace/lantern/metrics/metrics.prebundle.js +0 -12
- package/models/trace/lantern/metrics/metrics.prebundle.js.map +0 -1
- package/models/trace/lantern/metrics/metrics.prebundle.ts +0 -12
- package/models/trace/lantern/simulation/devtools_entrypoint-bundle-tsconfig-tsconfig.json +0 -43
- package/models/trace/lantern/simulation/simulation.prebundle.d.ts +0 -6
- package/models/trace/lantern/simulation/simulation.prebundle.js +0 -10
- package/models/trace/lantern/simulation/simulation.prebundle.js.map +0 -1
- package/models/trace/lantern/simulation/simulation.prebundle.ts +0 -10
- package/models/trace/lantern/types/devtools_entrypoint-bundle-tsconfig-tsconfig.json +0 -43
- package/models/trace/lantern/types/types.prebundle.d.ts +0 -1
- package/models/trace/lantern/types/types.prebundle.js +0 -5
- package/models/trace/lantern/types/types.prebundle.js.map +0 -1
- package/models/trace/lantern/types/types.prebundle.ts +0 -5
- package/models/trace/trace.prebundle.d.ts +0 -10
- package/models/trace/trace.prebundle.js +0 -14
- package/models/trace/trace.prebundle.js.map +0 -1
- package/models/trace/trace.prebundle.ts +0 -25
- package/models/trace/types/devtools_entrypoint-bundle-tsconfig-tsconfig.json +0 -43
- package/models/trace/types/types.prebundle.d.ts +0 -5
- package/models/trace/types/types.prebundle.js +0 -9
- package/models/trace/types/types.prebundle.js.map +0 -1
- package/models/trace/types/types.prebundle.ts +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Configuration.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;
|
|
1
|
+
{"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Configuration.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AA+C7B,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAkB,EAAE,CAAC,CAAC;IAC5C,uBAAuB,EAAE,KAAK;IAC9B,aAAa,EAAE,KAAK;IACpB,SAAS,EAAE,KAAK;IAChB,6BAA6B,EAAE,EAAE;IACjC,4BAA4B,EAAE,KAAK;CACpC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAqB;IACpD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Platform from '../../../core/platform/platform.js';\nimport type * as SDK from '../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport type * as Lantern from '../lantern/lantern.js';\n\nimport type * as File from './File.js';\n\nexport interface Configuration {\n /**\n * Include V8 RCS functions in the JS stacks\n */\n includeRuntimeCallStats: boolean;\n /**\n * Show all events: disable the default filtering which hides and excludes some events.\n */\n showAllEvents: boolean;\n /**\n * Extra detail for RPP developers (eg Trace Event json in Summary, and individual JS Sample events)\n */\n debugMode: boolean;\n /**\n * How many invalidation events will be stored for a layout (or similar) event.\n * On large sites with a lot of DOM there can be thousands of invalidations\n * associated with any given event. It is not useful to show the user 1000s of\n * invalidations in the UI, but it is also expensive for us to hold onto them\n * all, and it helps prevents OOM issues when running in NodeJS\n * [https://github.com/GoogleChrome/lighthouse/issues/16111].\n * Therefore, instead, we store only the latest 20 per event. We do also store\n * the total count, so we can show that, but we'll only ever hold on to the\n * last 20 invalidations (in DESC trace order - so the latest 20 in the trace file)\n *\n * If you set this to 0, we will skip the Invalidations processing entirely.\n * 0 effectively disables the InvalidationsHandler and it will not even\n * attempt to gather or track invalidations.\n */\n maxInvalidationEventsPerEvent: number;\n /**\n * Determines if the AnimationFramesHandler should be enabled. Currently in\n * DevTools we do not use it, so we disable it by default to avoid work that\n * we do not use. If you disable it, you will still see `data.AnimationFrames`\n * from the model, but the contents will be empty.\n */\n enableAnimationsFrameHandler: boolean;\n}\n\nexport const defaults = (): Configuration => ({\n includeRuntimeCallStats: false,\n showAllEvents: false,\n debugMode: false,\n maxInvalidationEventsPerEvent: 20,\n enableAnimationsFrameHandler: false,\n});\n\n/**\n * Generates a key that can be used to represent this config in a cache. This is\n * used mainly in tests, where we want to avoid re-parsing a file if we have\n * already processed it with the same configuration.\n */\nexport function configToCacheKey(config: Configuration): string {\n return JSON.stringify(config);\n}\n\nexport interface ParseOptions {\n /**\n * If the trace was just recorded on the current page, rather than an imported file.\n * TODO(paulirish): Maybe remove. This is currently unused by the Processor and Handlers\n * @default false\n */\n isFreshRecording?: boolean;\n /**\n * If the trace is a CPU Profile rather than a Chrome tracing trace.\n * @default false\n */\n isCPUProfile?: boolean;\n metadata?: File.MetaData;\n resolveSourceMap?: (params: ResolveSourceMapParams) => Promise<SDK.SourceMap.SourceMap|null>;\n logger?: {\n start: (id: string) => void,\n end: (id: string) => void,\n };\n lanternSettings?: Omit<Lantern.Types.Simulation.Settings, 'networkAnalysis'>;\n}\n\nexport interface ResolveSourceMapParams {\n scriptId: string;\n scriptUrl: Platform.DevToolsPath.UrlString;\n /** The url as resolved by any sourceUrl comment. */\n sourceUrl: Platform.DevToolsPath.UrlString;\n sourceMapUrl: Platform.DevToolsPath.UrlString;\n frame: Protocol.Page.FrameId;\n /** Set only if the raw source map was found on the provided metadata. Never set for source maps from data urls. */\n cachedRawSourceMap?: SDK.SourceMap.SourceMapV3;\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as Platform from '../../../core/platform/platform.js';
|
|
1
2
|
import type { Args, ConsoleTimeStamp, Event, PerformanceMark, PerformanceMeasureBegin, Phase, SyntheticBased } from './TraceEvents.js';
|
|
2
3
|
export type ExtensionEntryType = 'track-entry' | 'marker';
|
|
3
4
|
export declare const extensionPalette: readonly ["primary", "primary-light", "primary-dark", "secondary", "secondary-light", "secondary-dark", "tertiary", "tertiary-light", "tertiary-dark", "error", "warning"];
|
|
@@ -13,10 +14,15 @@ export interface ExtensionDataPayloadBase {
|
|
|
13
14
|
tooltipText?: string;
|
|
14
15
|
}
|
|
15
16
|
export type ExtensionDataPayload = ExtensionTrackEntryPayload | ExtensionMarkerPayload;
|
|
17
|
+
export interface ExtensionTrackEntryPayloadDeeplink {
|
|
18
|
+
url: Platform.DevToolsPath.UrlString;
|
|
19
|
+
description: string;
|
|
20
|
+
}
|
|
16
21
|
export interface ExtensionTrackEntryPayload extends ExtensionDataPayloadBase {
|
|
17
22
|
dataType?: 'track-entry';
|
|
18
23
|
track: string;
|
|
19
24
|
trackGroup?: string;
|
|
25
|
+
additionalContext?: ExtensionTrackEntryPayloadDeeplink;
|
|
20
26
|
}
|
|
21
27
|
export interface ExtensionMarkerPayload extends ExtensionDataPayloadBase {
|
|
22
28
|
dataType: 'marker';
|
|
@@ -30,7 +36,7 @@ export interface SyntheticExtensionTrackEntry extends SyntheticBased<Phase.COMPL
|
|
|
30
36
|
/**
|
|
31
37
|
* Synthetic events created for extension marks.
|
|
32
38
|
*/
|
|
33
|
-
export interface SyntheticExtensionMarker extends SyntheticBased<Phase.
|
|
39
|
+
export interface SyntheticExtensionMarker extends SyntheticBased<Phase.INSTANT, PerformanceMark> {
|
|
34
40
|
args: Args & ExtensionMarkerPayload;
|
|
35
41
|
}
|
|
36
42
|
export type SyntheticExtensionEntry = SyntheticExtensionTrackEntry | SyntheticExtensionMarker;
|
|
@@ -41,10 +47,16 @@ export declare function isExtensionPayloadTrackEntry(payload: {
|
|
|
41
47
|
track?: string;
|
|
42
48
|
dataType?: string;
|
|
43
49
|
}): payload is ExtensionTrackEntryPayload;
|
|
50
|
+
export declare function isConsoleTimestampPayloadTrackEntry(payload: {
|
|
51
|
+
description?: string;
|
|
52
|
+
url?: string;
|
|
53
|
+
}): payload is ExtensionTrackEntryPayloadDeeplink;
|
|
44
54
|
export declare function isValidExtensionPayload(payload: {
|
|
45
55
|
track?: string;
|
|
46
56
|
dataType?: string;
|
|
47
|
-
|
|
57
|
+
description?: string;
|
|
58
|
+
url?: string;
|
|
59
|
+
}): payload is ExtensionDataPayload | ExtensionTrackEntryPayloadDeeplink;
|
|
48
60
|
export declare function isSyntheticExtensionEntry(entry: Event): entry is SyntheticExtensionEntry;
|
|
49
61
|
export interface ExtensionTrackData {
|
|
50
62
|
name: string;
|
|
@@ -22,8 +22,12 @@ export function isExtensionPayloadTrackEntry(payload) {
|
|
|
22
22
|
const validEntryType = payload.dataType === 'track-entry' || payload.dataType === undefined;
|
|
23
23
|
return validEntryType && hasTrack;
|
|
24
24
|
}
|
|
25
|
+
export function isConsoleTimestampPayloadTrackEntry(payload) {
|
|
26
|
+
return payload.url !== undefined && payload.description !== undefined;
|
|
27
|
+
}
|
|
25
28
|
export function isValidExtensionPayload(payload) {
|
|
26
|
-
return isExtensionPayloadMarker(payload) || isExtensionPayloadTrackEntry(payload)
|
|
29
|
+
return isExtensionPayloadMarker(payload) || isExtensionPayloadTrackEntry(payload) ||
|
|
30
|
+
isConsoleTimestampPayloadTrackEntry(payload);
|
|
27
31
|
}
|
|
28
32
|
export function isSyntheticExtensionEntry(entry) {
|
|
29
33
|
return entry.cat === 'devtools.extension';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Extensions.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Extensions.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;
|
|
1
|
+
{"version":3,"file":"Extensions.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Extensions.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAU7B,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,SAAS;IACT,eAAe;IACf,cAAc;IACd,WAAW;IACX,iBAAiB;IACjB,gBAAgB;IAChB,UAAU;IACV,gBAAgB;IAChB,eAAe;IACf,OAAO;IACP,SAAS;CACD,CAAC;AAiEX,MAAM,UAAU,wBAAwB,CAAC,OAA4B;IACnE,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,OAA4C;IAEvF,MAAM,QAAQ,GAAG,OAAO,IAAI,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,cAAc,GAAG,OAAO,CAAC,QAAQ,KAAK,aAAa,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,CAAC;IAC5F,OAAO,cAAc,IAAI,QAAQ,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,mCAAmC,CAAC,OAA6C;IAE/F,OAAO,OAAO,CAAC,GAAG,KAAK,SAAS,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,CAAC;AACxE,CAAC;AAED,MAAM,UAAU,uBAAuB,CACnC,OAAgF;IAElF,OAAO,wBAAwB,CAAC,OAAO,CAAC,IAAI,4BAA4B,CAAC,OAAO,CAAC;QAC7E,mCAAmC,CAAC,OAAO,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,KAAY;IACpD,OAAO,KAAK,CAAC,GAAG,KAAK,oBAAoB,CAAC;AAC5C,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Platform from '../../../core/platform/platform.js';\n\nimport type {\n Args, ConsoleTimeStamp, Event, PerformanceMark, PerformanceMeasureBegin, Phase, SyntheticBased} from\n './TraceEvents.js';\n\nexport type ExtensionEntryType = 'track-entry'|'marker';\n\nexport const extensionPalette = [\n 'primary',\n 'primary-light',\n 'primary-dark',\n 'secondary',\n 'secondary-light',\n 'secondary-dark',\n 'tertiary',\n 'tertiary-light',\n 'tertiary-dark',\n 'error',\n 'warning',\n] as const;\n\nexport type ExtensionColorFromPalette = typeof extensionPalette[number];\n\nexport interface ExtensionDataPayloadBase {\n color?: ExtensionColorFromPalette;\n /**\n * We document to users that we support only string values here, but because\n * this is coming from user code the values could be anything, so we ensure we\n * deal with bad data by typing this as unknown.\n */\n properties?: Array<[string, unknown]>;\n tooltipText?: string;\n}\n\nexport type ExtensionDataPayload = ExtensionTrackEntryPayload|ExtensionMarkerPayload;\n\nexport interface ExtensionTrackEntryPayloadDeeplink {\n // The URL (deep-link) to show in the summary for the track.\n url: Platform.DevToolsPath.UrlString;\n // The label to show in front of the URL when the deep-link is shown in the\n // graph.\n description: string;\n}\n\nexport interface ExtensionTrackEntryPayload extends ExtensionDataPayloadBase {\n // Typed as possibly undefined since when no data type is provided\n // the entry is defaulted to a track entry\n dataType?: 'track-entry';\n // The name of the track the entry will be displayed in.\n // Entries intended to be displayed in the same track must contain the\n // same value in this property.\n // If undefined, measurement is added to the Timings track\n track: string;\n // The track group an entry’s track belongs to.\n // Entries intended to be displayed in the same track must contain the\n // same value in this property as well as the same value in the track\n // property.\n trackGroup?: string;\n // Additional context (deep-link URL) that can be shown in the summary for the\n // track.\n additionalContext?: ExtensionTrackEntryPayloadDeeplink;\n}\n\nexport interface ExtensionMarkerPayload extends ExtensionDataPayloadBase {\n dataType: 'marker';\n}\n\n/**\n * Synthetic events created for extension tracks.\n */\nexport interface SyntheticExtensionTrackEntry extends\n SyntheticBased<Phase.COMPLETE, PerformanceMeasureBegin|PerformanceMark|ConsoleTimeStamp> {\n args: Args&ExtensionTrackEntryPayload;\n}\n\n/**\n * Synthetic events created for extension marks.\n */\nexport interface SyntheticExtensionMarker extends SyntheticBased<Phase.INSTANT, PerformanceMark> {\n args: Args&ExtensionMarkerPayload;\n}\n\nexport type SyntheticExtensionEntry = SyntheticExtensionTrackEntry|SyntheticExtensionMarker;\n\nexport function isExtensionPayloadMarker(payload: {dataType?: string}): payload is ExtensionMarkerPayload {\n return payload.dataType === 'marker';\n}\n\nexport function isExtensionPayloadTrackEntry(payload: {track?: string, dataType?: string}):\n payload is ExtensionTrackEntryPayload {\n const hasTrack = 'track' in payload && Boolean(payload.track);\n const validEntryType = payload.dataType === 'track-entry' || payload.dataType === undefined;\n return validEntryType && hasTrack;\n}\n\nexport function isConsoleTimestampPayloadTrackEntry(payload: {description?: string, url?: string}):\n payload is ExtensionTrackEntryPayloadDeeplink {\n return payload.url !== undefined && payload.description !== undefined;\n}\n\nexport function isValidExtensionPayload(\n payload: {track?: string, dataType?: string, description?: string, url?: string}): payload is ExtensionDataPayload|\n ExtensionTrackEntryPayloadDeeplink {\n return isExtensionPayloadMarker(payload) || isExtensionPayloadTrackEntry(payload) ||\n isConsoleTimestampPayloadTrackEntry(payload);\n}\n\nexport function isSyntheticExtensionEntry(entry: Event): entry is SyntheticExtensionEntry {\n return entry.cat === 'devtools.extension';\n}\n\nexport interface ExtensionTrackData {\n // Name of the top level track. If it's a track group then this value\n // has the name of the group, otherwise it has the name of the track.\n name: string;\n isTrackGroup: boolean;\n // If this contains the data of a track group, this property contains\n // the entries of each of the tracks in the the group. If this is a\n // standalone track, then this contains that track's entries only.\n entriesByTrack: Record<string, SyntheticExtensionTrackEntry[]>;\n}\n"]}
|
|
@@ -134,10 +134,13 @@ export interface TrackVisualConfig {
|
|
|
134
134
|
expanded: boolean;
|
|
135
135
|
originalIndex: number;
|
|
136
136
|
visualIndex: number;
|
|
137
|
+
trackName: string;
|
|
137
138
|
}
|
|
138
139
|
/**
|
|
139
140
|
* Stores the visual config if the user has modified it. Split into "main" and
|
|
140
141
|
* "network" so we can pass the relevant config into the right data provider.
|
|
142
|
+
* NOTE: as of August 2025 (M141) we currently do not export this in new
|
|
143
|
+
* traces, or use it if an existing trace is imported with it.
|
|
141
144
|
*/
|
|
142
145
|
export interface PersistedTraceVisualConfig {
|
|
143
146
|
main: TrackVisualConfig[] | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"File.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/File.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAmB7B,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,wCAA0B,CAAA;IAC1B,0CAA4B,CAAA;AAC9B,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED;;;;;GAKG;AACH,MA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,CAAC;QAC/B,KAAK,YAAY,CAAC,qBAAqB,CAAC,CAAC,CAAC;YACxC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC;gBAC/D,MAAM,IAAI,KAAK,CAAC,oCAAoC,GAAG,EAAE,CAAC,CAAC;YAC7D,CAAC;YACD,OAAO;gBACL,IAAI;gBACJ,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;aACjC,CAAC;QACJ,CAAC;QAED;YACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,GAAG,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as SDK from '../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport type * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\n\nimport type {TraceWindowMicro} from './Timing.js';\nimport type {Event, LegacyTimelineFrame, ProcessID, SampleIndex, ThreadID} from './TraceEvents.js';\n\nexport interface TraceFile {\n traceEvents: readonly Event[];\n metadata: MetaData;\n}\n\nexport interface Breadcrumb {\n window: TraceWindowMicro;\n child: Breadcrumb|null;\n}\n\nexport enum DataOrigin {\n CPU_PROFILE = 'CPUProfile',\n TRACE_EVENTS = 'TraceEvents',\n}\n\n/**\n * The Entries link can have 3 stated:\n * 1. The Link creation is not started yet, meaning only the button that needs to be clicked to start creating the link is visible.\n * 2. Pending to event - the creation is started, but the entry that the link points to has not been chosen yet\n * 3. Link connected - final state, both entries present\n */\nexport enum EntriesLinkState {\n CREATION_NOT_STARTED = 'creation_not_started',\n PENDING_TO_EVENT = 'pending_to_event',\n CONNECTED = 'connected',\n}\n\nexport enum EventKeyType {\n RAW_EVENT = 'r',\n SYNTHETIC_EVENT = 's',\n PROFILE_CALL = 'p',\n LEGACY_TIMELINE_FRAME = 'l',\n}\n\n/**\n * Represents an object that is saved in the file when user created annotations in the timeline.\n *\n * Expected to add more annotations.\n */\nexport interface SerializedAnnotations {\n entryLabels: EntryLabelAnnotationSerialized[];\n labelledTimeRanges: TimeRangeAnnotationSerialized[];\n linksBetweenEntries: EntriesLinkAnnotationSerialized[];\n}\n\n/**\n * Represents an object that is used to store the Entry Label annotation that is created when a user creates a label for an entry in the timeline.\n */\nexport interface EntryLabelAnnotation {\n type: 'ENTRY_LABEL';\n entry: Event|LegacyTimelineFrame;\n label: string;\n}\n\n/**\n * Represents an object that is used to store the Labelled Time Range Annotation that is created when a user creates a Time Range Selection in the timeline.\n */\nexport interface TimeRangeAnnotation {\n type: 'TIME_RANGE';\n label: string;\n bounds: TraceWindowMicro;\n}\n\nexport interface EntriesLinkAnnotation {\n type: 'ENTRIES_LINK';\n state: EntriesLinkState;\n entryFrom: Event;\n entryTo?: Event;\n}\n\n/**\n * Represents an object that is saved in the file when a user creates a label for an entry in the timeline.\n */\nexport interface EntryLabelAnnotationSerialized {\n entry: SerializableKey;\n label: string;\n}\n\n/**\n * Represents an object that is saved in the file when a user creates a time range with a label in the timeline.\n */\nexport interface TimeRangeAnnotationSerialized {\n bounds: TraceWindowMicro;\n label: string;\n}\n\n/**\n * Represents an object that is saved in the file when a user creates a link between entries in the timeline.\n */\nexport interface EntriesLinkAnnotationSerialized {\n entryFrom: SerializableKey;\n entryTo: SerializableKey;\n}\n\n/**\n * `Annotation` are the user-created annotations that are saved into the metadata.\n * Those annotations are rendered on the timeline by `Overlays.ts`\n *\n * TODO: Implement other OverlayAnnotations (annotated time ranges, links between entries).\n * TODO: Save/load overlay annotations to/from the trace file.\n */\nexport type Annotation = EntryLabelAnnotation|TimeRangeAnnotation|EntriesLinkAnnotation;\n\nexport function isTimeRangeAnnotation(annotation: Annotation): annotation is TimeRangeAnnotation {\n return annotation.type === 'TIME_RANGE';\n}\n\nexport function isEntryLabelAnnotation(annotation: Annotation): annotation is EntryLabelAnnotation {\n return annotation.type === 'ENTRY_LABEL';\n}\n\nexport function isEntriesLinkAnnotation(annotation: Annotation): annotation is EntriesLinkAnnotation {\n return annotation.type === 'ENTRIES_LINK';\n}\n\n// Serializable keys are created for trace events to be able to save\n// references to timeline events in a trace file. These keys enable\n// user modifications that can be saved. See go/cpq:event-data-json for\n// more details on the key format.\nexport type RawEventKey = `${EventKeyType.RAW_EVENT}-${number}`;\nexport type SyntheticEventKey = `${EventKeyType.SYNTHETIC_EVENT}-${number}`;\nexport type ProfileCallKey = `${EventKeyType.PROFILE_CALL}-${ProcessID}-${ThreadID}-${SampleIndex}-${Protocol.integer}`;\nexport type LegacyTimelineFrameKey = `${EventKeyType.LEGACY_TIMELINE_FRAME}-${number}`;\nexport type SerializableKey = RawEventKey|ProfileCallKey|SyntheticEventKey|LegacyTimelineFrameKey;\n\n// Serializable keys values objects contain data that maps the keys to original Trace Events\nexport interface RawEventKeyValues {\n type: EventKeyType.RAW_EVENT;\n rawIndex: number;\n}\n\nexport interface SyntheticEventKeyValues {\n type: EventKeyType.SYNTHETIC_EVENT;\n rawIndex: number;\n}\n\nexport interface ProfileCallKeyValues {\n type: EventKeyType.PROFILE_CALL;\n processID: ProcessID;\n threadID: ThreadID;\n sampleIndex: SampleIndex;\n protocol: Protocol.integer;\n}\n\nexport interface LegacyTimelineFrameKeyValues {\n type: EventKeyType.LEGACY_TIMELINE_FRAME;\n rawIndex: number;\n}\n\nexport type SerializableKeyValues =\n RawEventKeyValues|ProfileCallKeyValues|SyntheticEventKeyValues|LegacyTimelineFrameKeyValues;\n\nexport interface Modifications {\n entriesModifications: {\n // Entries hidden by the user\n hiddenEntries: SerializableKey[],\n // Entries that parent a hiddenEntry\n expandableEntries: SerializableKey[],\n };\n initialBreadcrumb: Breadcrumb;\n annotations: SerializedAnnotations;\n}\n\n// IMPORTANT: this is the same as PerfUI.FlameChart.PersistedGroupConfig\n// However, the PerfUI code should not depend on the model/trace, and similarly\n// this model cannot depend on that code, so we duplicate it.\nexport interface TrackVisualConfig {\n hidden: boolean;\n expanded: boolean;\n originalIndex: number;\n visualIndex: number;\n}\n\n/**\n * Stores the visual config if the user has modified it. Split into \"main\" and\n * \"network\" so we can pass the relevant config into the right data provider.\n */\nexport interface PersistedTraceVisualConfig {\n main: TrackVisualConfig[]|null;\n network: TrackVisualConfig[]|null;\n}\n\n/**\n * Trace metadata that we persist to the file. This will allow us to\n * store specifics for the trace, e.g., which tracks should be visible\n * on load.\n */\nexport interface MetaData {\n source?: 'DevTools';\n startTime?: string;\n emulatedDeviceTitle?: string;\n // Only set if network throttling is active.\n networkThrottling?: string;\n // Only set if network throttling is active.\n networkThrottlingConditions?: Omit<SDK.NetworkManager.Conditions, 'title'>;\n // Only set if CPU throttling is active.\n cpuThrottling?: number;\n dataOrigin?: DataOrigin;\n enhancedTraceVersion?: number;\n modifications?: Modifications;\n cruxFieldData?: CrUXManager.PageResult[];\n /** Currently only stores JS maps, not CSS. This never stores data url source maps. */\n sourceMaps?: MetadataSourceMap[];\n visualTrackConfig?: PersistedTraceVisualConfig;\n hostDPR?: number;\n}\n\ninterface MetadataSourceMap {\n url: string;\n /** If not defined, then this was a data url. */\n sourceMapUrl?: string;\n sourceMap: SDK.SourceMap.SourceMapV3;\n}\n\nexport type Contents = TraceFile|Event[];\n\nexport function traceEventKeyToValues(key: SerializableKey): SerializableKeyValues {\n const parts = key.split('-');\n const type = parts[0];\n\n switch (type) {\n case EventKeyType.PROFILE_CALL:\n if (parts.length !== 5 ||\n !(parts.every((part, i) => i === 0 || typeof part === 'number' || !isNaN(parseInt(part, 10))))) {\n throw new Error(`Invalid ProfileCallKey: ${key}`);\n }\n return {\n type: parts[0],\n processID: parseInt(parts[1], 10),\n threadID: parseInt(parts[2], 10),\n sampleIndex: parseInt(parts[3], 10),\n protocol: parseInt(parts[4], 10),\n } as ProfileCallKeyValues;\n case EventKeyType.RAW_EVENT:\n if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {\n throw new Error(`Invalid RawEvent Key: ${key}`);\n }\n return {\n type: parts[0],\n rawIndex: parseInt(parts[1], 10),\n } as RawEventKeyValues;\n case EventKeyType.SYNTHETIC_EVENT:\n if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {\n throw new Error(`Invalid SyntheticEvent Key: ${key}`);\n }\n return {\n type: parts[0],\n rawIndex: parseInt(parts[1], 10),\n } as SyntheticEventKeyValues;\n case EventKeyType.LEGACY_TIMELINE_FRAME: {\n if (parts.length !== 2 || Number.isNaN(parseInt(parts[1], 10))) {\n throw new Error(`Invalid LegacyTimelineFrame Key: ${key}`);\n }\n return {\n type,\n rawIndex: parseInt(parts[1], 10),\n };\n }\n\n default:\n throw new Error(`Unknown trace event key: ${key}`);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"File.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/File.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAmB7B,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,wCAA0B,CAAA;IAC1B,0CAA4B,CAAA;AAC9B,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,iEAA6C,CAAA;IAC7C,yDAAqC,CAAA;IACrC,2CAAuB,CAAA;AACzB,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAED,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,qCAAqB,CAAA;IACrB,kCAAkB,CAAA;IAClB,2CAA2B,CAAA;AAC7B,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAuED,MAAM,UAAU,qBAAqB,CAAC,UAAsB;IAC1D,OAAO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AC;aACjC,CAAC;QACJ,CAAC;QAED;YACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,GAAG,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as SDK from '../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport type * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\n\nimport type {TraceWindowMicro} from './Timing.js';\nimport type {Event, LegacyTimelineFrame, ProcessID, SampleIndex, ThreadID} from './TraceEvents.js';\n\nexport interface TraceFile {\n traceEvents: readonly Event[];\n metadata: MetaData;\n}\n\nexport interface Breadcrumb {\n window: TraceWindowMicro;\n child: Breadcrumb|null;\n}\n\nexport enum DataOrigin {\n CPU_PROFILE = 'CPUProfile',\n TRACE_EVENTS = 'TraceEvents',\n}\n\n/**\n * The Entries link can have 3 stated:\n * 1. The Link creation is not started yet, meaning only the button that needs to be clicked to start creating the link is visible.\n * 2. Pending to event - the creation is started, but the entry that the link points to has not been chosen yet\n * 3. Link connected - final state, both entries present\n */\nexport enum EntriesLinkState {\n CREATION_NOT_STARTED = 'creation_not_started',\n PENDING_TO_EVENT = 'pending_to_event',\n CONNECTED = 'connected',\n}\n\nexport enum EventKeyType {\n RAW_EVENT = 'r',\n SYNTHETIC_EVENT = 's',\n PROFILE_CALL = 'p',\n LEGACY_TIMELINE_FRAME = 'l',\n}\n\n/**\n * Represents an object that is saved in the file when user created annotations in the timeline.\n *\n * Expected to add more annotations.\n */\nexport interface SerializedAnnotations {\n entryLabels: EntryLabelAnnotationSerialized[];\n labelledTimeRanges: TimeRangeAnnotationSerialized[];\n linksBetweenEntries: EntriesLinkAnnotationSerialized[];\n}\n\n/**\n * Represents an object that is used to store the Entry Label annotation that is created when a user creates a label for an entry in the timeline.\n */\nexport interface EntryLabelAnnotation {\n type: 'ENTRY_LABEL';\n entry: Event|LegacyTimelineFrame;\n label: string;\n}\n\n/**\n * Represents an object that is used to store the Labelled Time Range Annotation that is created when a user creates a Time Range Selection in the timeline.\n */\nexport interface TimeRangeAnnotation {\n type: 'TIME_RANGE';\n label: string;\n bounds: TraceWindowMicro;\n}\n\nexport interface EntriesLinkAnnotation {\n type: 'ENTRIES_LINK';\n state: EntriesLinkState;\n entryFrom: Event;\n entryTo?: Event;\n}\n\n/**\n * Represents an object that is saved in the file when a user creates a label for an entry in the timeline.\n */\nexport interface EntryLabelAnnotationSerialized {\n entry: SerializableKey;\n label: string;\n}\n\n/**\n * Represents an object that is saved in the file when a user creates a time range with a label in the timeline.\n */\nexport interface TimeRangeAnnotationSerialized {\n bounds: TraceWindowMicro;\n label: string;\n}\n\n/**\n * Represents an object that is saved in the file when a user creates a link between entries in the timeline.\n */\nexport interface EntriesLinkAnnotationSerialized {\n entryFrom: SerializableKey;\n entryTo: SerializableKey;\n}\n\n/**\n * `Annotation` are the user-created annotations that are saved into the metadata.\n * Those annotations are rendered on the timeline by `Overlays.ts`\n *\n * TODO: Implement other OverlayAnnotations (annotated time ranges, links between entries).\n * TODO: Save/load overlay annotations to/from the trace file.\n */\nexport type Annotation = EntryLabelAnnotation|TimeRangeAnnotation|EntriesLinkAnnotation;\n\nexport function isTimeRangeAnnotation(annotation: Annotation): annotation is TimeRangeAnnotation {\n return annotation.type === 'TIME_RANGE';\n}\n\nexport function isEntryLabelAnnotation(annotation: Annotation): annotation is EntryLabelAnnotation {\n return annotation.type === 'ENTRY_LABEL';\n}\n\nexport function isEntriesLinkAnnotation(annotation: Annotation): annotation is EntriesLinkAnnotation {\n return annotation.type === 'ENTRIES_LINK';\n}\n\n// Serializable keys are created for trace events to be able to save\n// references to timeline events in a trace file. These keys enable\n// user modifications that can be saved. See go/cpq:event-data-json for\n// more details on the key format.\nexport type RawEventKey = `${EventKeyType.RAW_EVENT}-${number}`;\nexport type SyntheticEventKey = `${EventKeyType.SYNTHETIC_EVENT}-${number}`;\nexport type ProfileCallKey = `${EventKeyType.PROFILE_CALL}-${ProcessID}-${ThreadID}-${SampleIndex}-${Protocol.integer}`;\nexport type LegacyTimelineFrameKey = `${EventKeyType.LEGACY_TIMELINE_FRAME}-${number}`;\nexport type SerializableKey = RawEventKey|ProfileCallKey|SyntheticEventKey|LegacyTimelineFrameKey;\n\n// Serializable keys values objects contain data that maps the keys to original Trace Events\nexport interface RawEventKeyValues {\n type: EventKeyType.RAW_EVENT;\n rawIndex: number;\n}\n\nexport interface SyntheticEventKeyValues {\n type: EventKeyType.SYNTHETIC_EVENT;\n rawIndex: number;\n}\n\nexport interface ProfileCallKeyValues {\n type: EventKeyType.PROFILE_CALL;\n processID: ProcessID;\n threadID: ThreadID;\n sampleIndex: SampleIndex;\n protocol: Protocol.integer;\n}\n\nexport interface LegacyTimelineFrameKeyValues {\n type: EventKeyType.LEGACY_TIMELINE_FRAME;\n rawIndex: number;\n}\n\nexport type SerializableKeyValues =\n RawEventKeyValues|ProfileCallKeyValues|SyntheticEventKeyValues|LegacyTimelineFrameKeyValues;\n\nexport interface Modifications {\n entriesModifications: {\n // Entries hidden by the user\n hiddenEntries: SerializableKey[],\n // Entries that parent a hiddenEntry\n expandableEntries: SerializableKey[],\n };\n initialBreadcrumb: Breadcrumb;\n annotations: SerializedAnnotations;\n}\n\n// IMPORTANT: this is the same as PerfUI.FlameChart.PersistedGroupConfig\n// However, the PerfUI code should not depend on the model/trace, and similarly\n// this model cannot depend on that code, so we duplicate it.\nexport interface TrackVisualConfig {\n hidden: boolean;\n expanded: boolean;\n originalIndex: number;\n visualIndex: number;\n trackName: string;\n}\n\n/**\n * Stores the visual config if the user has modified it. Split into \"main\" and\n * \"network\" so we can pass the relevant config into the right data provider.\n * NOTE: as of August 2025 (M141) we currently do not export this in new\n * traces, or use it if an existing trace is imported with it.\n */\nexport interface PersistedTraceVisualConfig {\n main: TrackVisualConfig[]|null;\n network: TrackVisualConfig[]|null;\n}\n\n/**\n * Trace metadata that we persist to the file. This will allow us to\n * store specifics for the trace, e.g., which tracks should be visible\n * on load.\n */\nexport interface MetaData {\n source?: 'DevTools';\n startTime?: string;\n emulatedDeviceTitle?: string;\n // Only set if network throttling is active.\n networkThrottling?: string;\n // Only set if network throttling is active.\n networkThrottlingConditions?: Omit<SDK.NetworkManager.Conditions, 'title'>;\n // Only set if CPU throttling is active.\n cpuThrottling?: number;\n dataOrigin?: DataOrigin;\n enhancedTraceVersion?: number;\n modifications?: Modifications;\n cruxFieldData?: CrUXManager.PageResult[];\n /** Currently only stores JS maps, not CSS. This never stores data url source maps. */\n sourceMaps?: MetadataSourceMap[];\n visualTrackConfig?: PersistedTraceVisualConfig;\n hostDPR?: number;\n}\n\ninterface MetadataSourceMap {\n url: string;\n /** If not defined, then this was a data url. */\n sourceMapUrl?: string;\n sourceMap: SDK.SourceMap.SourceMapV3;\n}\n\nexport type Contents = TraceFile|Event[];\n\nexport function traceEventKeyToValues(key: SerializableKey): SerializableKeyValues {\n const parts = key.split('-');\n const type = parts[0];\n\n switch (type) {\n case EventKeyType.PROFILE_CALL:\n if (parts.length !== 5 ||\n !(parts.every((part, i) => i === 0 || typeof part === 'number' || !isNaN(parseInt(part, 10))))) {\n throw new Error(`Invalid ProfileCallKey: ${key}`);\n }\n return {\n type: parts[0],\n processID: parseInt(parts[1], 10),\n threadID: parseInt(parts[2], 10),\n sampleIndex: parseInt(parts[3], 10),\n protocol: parseInt(parts[4], 10),\n } as ProfileCallKeyValues;\n case EventKeyType.RAW_EVENT:\n if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {\n throw new Error(`Invalid RawEvent Key: ${key}`);\n }\n return {\n type: parts[0],\n rawIndex: parseInt(parts[1], 10),\n } as RawEventKeyValues;\n case EventKeyType.SYNTHETIC_EVENT:\n if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {\n throw new Error(`Invalid SyntheticEvent Key: ${key}`);\n }\n return {\n type: parts[0],\n rawIndex: parseInt(parts[1], 10),\n } as SyntheticEventKeyValues;\n case EventKeyType.LEGACY_TIMELINE_FRAME: {\n if (parts.length !== 2 || Number.isNaN(parseInt(parts[1], 10))) {\n throw new Error(`Invalid LegacyTimelineFrame Key: ${key}`);\n }\n return {\n type,\n rawIndex: parseInt(parts[1], 10),\n };\n }\n\n default:\n throw new Error(`Unknown trace event key: ${key}`);\n }\n}\n"]}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// import type * as UI from '../../../ui/legacy/legacy.js';
|
|
2
|
+
// import type * as Lit from '../../../ui/lit/lit.js';
|
|
3
|
+
import type { EntriesLinkState } from './File.js';
|
|
4
|
+
import type { Micro, TraceWindowMicro } from './Timing.js';
|
|
5
|
+
import type { Event, LegacyTimelineFrame, PageLoadEvent } from './TraceEvents.js';
|
|
6
|
+
/**
|
|
7
|
+
* Represents which flamechart an entry is rendered in.
|
|
8
|
+
* We need to know this because when we place an overlay for an entry we need
|
|
9
|
+
* to adjust its Y value if it's in the main chart which is drawn below the
|
|
10
|
+
* network chart
|
|
11
|
+
*/
|
|
12
|
+
export type EntryChartLocation = 'main' | 'network';
|
|
13
|
+
/**
|
|
14
|
+
* You can add overlays to trace events, but also right now frames are drawn on
|
|
15
|
+
* the timeline but they are not trace events, so we need to allow for that.
|
|
16
|
+
* In the future when the frames track has been migrated to be powered by
|
|
17
|
+
* animation frames (crbug.com/345144583), we can remove the requirement to
|
|
18
|
+
* support TimelineFrame instances (which themselves will be removed from the
|
|
19
|
+
* codebase.)
|
|
20
|
+
*/
|
|
21
|
+
export type OverlayEntry = Event | LegacyTimelineFrame;
|
|
22
|
+
/**
|
|
23
|
+
* Represents when a user has selected an entry in the timeline
|
|
24
|
+
*/
|
|
25
|
+
export interface EntrySelected {
|
|
26
|
+
type: 'ENTRY_SELECTED';
|
|
27
|
+
entry: OverlayEntry;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Drawn around an entry when we want to highlight it to the user.
|
|
31
|
+
*/
|
|
32
|
+
export interface EntryOutline {
|
|
33
|
+
type: 'ENTRY_OUTLINE';
|
|
34
|
+
entry: OverlayEntry;
|
|
35
|
+
outlineReason: 'ERROR' | 'INFO';
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Represents an object created when a user creates a label for an entry in the timeline.
|
|
39
|
+
*/
|
|
40
|
+
export interface EntryLabel {
|
|
41
|
+
type: 'ENTRY_LABEL';
|
|
42
|
+
entry: OverlayEntry;
|
|
43
|
+
label: string;
|
|
44
|
+
}
|
|
45
|
+
export interface EntriesLink {
|
|
46
|
+
type: 'ENTRIES_LINK';
|
|
47
|
+
state: EntriesLinkState;
|
|
48
|
+
entryFrom: OverlayEntry;
|
|
49
|
+
entryTo?: OverlayEntry;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Represents a time range on the trace. Also used when the user shift+clicks
|
|
53
|
+
* and drags to create a time range.
|
|
54
|
+
*/
|
|
55
|
+
export interface TimeRangeLabel {
|
|
56
|
+
type: 'TIME_RANGE';
|
|
57
|
+
bounds: TraceWindowMicro;
|
|
58
|
+
label: string;
|
|
59
|
+
showDuration: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Used to highlight with a red-candy stripe a time range. It takes an entry
|
|
63
|
+
* because this entry is the row that will be used to place the candy stripe,
|
|
64
|
+
* and its height will be set to the height of that row.
|
|
65
|
+
*/
|
|
66
|
+
export interface CandyStripedTimeRange {
|
|
67
|
+
type: 'CANDY_STRIPED_TIME_RANGE';
|
|
68
|
+
bounds: TraceWindowMicro;
|
|
69
|
+
entry: Event;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* An EntryBreakdown, or section, that makes up a TimespanBreakdown.
|
|
73
|
+
*/
|
|
74
|
+
export interface TimespanBreakdownEntryBreakdown {
|
|
75
|
+
bounds: TraceWindowMicro;
|
|
76
|
+
label: string | any;
|
|
77
|
+
showDuration: boolean;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Represents a timespan on a trace broken down into parts. Each part has a label to it.
|
|
81
|
+
* If an entry is defined, the breakdown will be vertically positioned based on it.
|
|
82
|
+
*/
|
|
83
|
+
export interface TimespanBreakdown {
|
|
84
|
+
type: 'TIMESPAN_BREAKDOWN';
|
|
85
|
+
sections: TimespanBreakdownEntryBreakdown[];
|
|
86
|
+
entry?: Event;
|
|
87
|
+
renderLocation?: 'BOTTOM_OF_TIMELINE' | 'BELOW_EVENT' | 'ABOVE_EVENT';
|
|
88
|
+
}
|
|
89
|
+
export interface TimestampMarker {
|
|
90
|
+
type: 'TIMESTAMP_MARKER';
|
|
91
|
+
timestamp: Micro;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Represents a timings marker. This has a line that runs up the whole canvas.
|
|
95
|
+
* We can hold an array of entries, in the case we want to hold more than one with the same timestamp.
|
|
96
|
+
* The adjusted timestamp being the timestamp for the event adjusted by closest navigation.
|
|
97
|
+
*/
|
|
98
|
+
export interface TimingsMarker {
|
|
99
|
+
type: 'TIMINGS_MARKER';
|
|
100
|
+
entries: PageLoadEvent[];
|
|
101
|
+
entryToFieldResult: Map<PageLoadEvent, TimingsMarkerFieldResult>;
|
|
102
|
+
adjustedTimestamp: Micro;
|
|
103
|
+
}
|
|
104
|
+
export interface TimingsMarkerFieldResult {
|
|
105
|
+
value: Micro;
|
|
106
|
+
pageScope: 'url' | 'origin';
|
|
107
|
+
}
|
|
108
|
+
export interface BottomInfoBar {
|
|
109
|
+
type: 'BOTTOM_INFO_BAR';
|
|
110
|
+
infobar: any;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* All supported overlay types.
|
|
114
|
+
*/
|
|
115
|
+
export type Overlay = EntrySelected | EntryOutline | TimeRangeLabel | EntryLabel | EntriesLink | TimespanBreakdown | TimestampMarker | CandyStripedTimeRange | TimingsMarker | BottomInfoBar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Overlays.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Overlays.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B","sourcesContent":["// Copyright 2025 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as UI from '../../../ui/legacy/legacy.js';\nimport type * as Lit from '../../../ui/lit/lit.js';\n\nimport type {EntriesLinkState} from './File.js';\nimport type {Micro, TraceWindowMicro} from './Timing.js';\nimport type {Event, LegacyTimelineFrame, PageLoadEvent} from './TraceEvents.js';\n\n/**\n * Represents which flamechart an entry is rendered in.\n * We need to know this because when we place an overlay for an entry we need\n * to adjust its Y value if it's in the main chart which is drawn below the\n * network chart\n */\nexport type EntryChartLocation = 'main'|'network';\n\n/**\n * You can add overlays to trace events, but also right now frames are drawn on\n * the timeline but they are not trace events, so we need to allow for that.\n * In the future when the frames track has been migrated to be powered by\n * animation frames (crbug.com/345144583), we can remove the requirement to\n * support TimelineFrame instances (which themselves will be removed from the\n * codebase.)\n */\nexport type OverlayEntry = Event|LegacyTimelineFrame;\n\n/**\n * Represents when a user has selected an entry in the timeline\n */\nexport interface EntrySelected {\n type: 'ENTRY_SELECTED';\n entry: OverlayEntry;\n}\n\n/**\n * Drawn around an entry when we want to highlight it to the user.\n */\nexport interface EntryOutline {\n type: 'ENTRY_OUTLINE';\n entry: OverlayEntry;\n outlineReason: 'ERROR'|'INFO';\n}\n\n/**\n * Represents an object created when a user creates a label for an entry in the timeline.\n */\nexport interface EntryLabel {\n type: 'ENTRY_LABEL';\n entry: OverlayEntry;\n label: string;\n}\n\nexport interface EntriesLink {\n type: 'ENTRIES_LINK';\n state: EntriesLinkState;\n entryFrom: OverlayEntry;\n entryTo?: OverlayEntry;\n}\n\n/**\n * Represents a time range on the trace. Also used when the user shift+clicks\n * and drags to create a time range.\n */\nexport interface TimeRangeLabel {\n type: 'TIME_RANGE';\n bounds: TraceWindowMicro;\n label: string;\n showDuration: boolean;\n}\n\n/**\n * Used to highlight with a red-candy stripe a time range. It takes an entry\n * because this entry is the row that will be used to place the candy stripe,\n * and its height will be set to the height of that row.\n */\nexport interface CandyStripedTimeRange {\n type: 'CANDY_STRIPED_TIME_RANGE';\n bounds: TraceWindowMicro;\n entry: Event;\n}\n\n/**\n * An EntryBreakdown, or section, that makes up a TimespanBreakdown.\n */\nexport interface TimespanBreakdownEntryBreakdown {\n bounds: TraceWindowMicro;\n label: string|Lit.LitTemplate;\n showDuration: boolean;\n}\n\n/**\n * Represents a timespan on a trace broken down into parts. Each part has a label to it.\n * If an entry is defined, the breakdown will be vertically positioned based on it.\n */\nexport interface TimespanBreakdown {\n type: 'TIMESPAN_BREAKDOWN';\n sections: TimespanBreakdownEntryBreakdown[];\n entry?: Event;\n renderLocation?: 'BOTTOM_OF_TIMELINE'|'BELOW_EVENT'|'ABOVE_EVENT';\n}\n\nexport interface TimestampMarker {\n type: 'TIMESTAMP_MARKER';\n timestamp: Micro;\n}\n\n/**\n * Represents a timings marker. This has a line that runs up the whole canvas.\n * We can hold an array of entries, in the case we want to hold more than one with the same timestamp.\n * The adjusted timestamp being the timestamp for the event adjusted by closest navigation.\n */\nexport interface TimingsMarker {\n type: 'TIMINGS_MARKER';\n entries: PageLoadEvent[];\n entryToFieldResult: Map<PageLoadEvent, TimingsMarkerFieldResult>;\n adjustedTimestamp: Micro;\n}\n\nexport interface TimingsMarkerFieldResult {\n value: Micro;\n pageScope: 'url'|'origin';\n}\n\nexport interface BottomInfoBar {\n type: 'BOTTOM_INFO_BAR';\n infobar: UI.Infobar.Infobar;\n}\n\n/**\n * All supported overlay types.\n */\nexport type Overlay = EntrySelected|EntryOutline|TimeRangeLabel|EntryLabel|EntriesLink|TimespanBreakdown|\n TimestampMarker|CandyStripedTimeRange|TimingsMarker|BottomInfoBar;\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type * as Platform from '../../../core/platform/platform.js';
|
|
2
2
|
import type * as Protocol from '../../../generated/protocol.js';
|
|
3
|
+
import type { ExtensionTrackEntryPayloadDeeplink } from './Extensions.js';
|
|
3
4
|
import type { Micro, Milli, Seconds, TraceWindowMicro } from './Timing.js';
|
|
4
5
|
export declare enum Phase {
|
|
5
6
|
BEGIN = "B",
|
|
@@ -83,9 +84,13 @@ export interface Sample extends Event {
|
|
|
83
84
|
/**
|
|
84
85
|
* A fake trace event created to support CDP.Profiler.Profiles in the
|
|
85
86
|
* trace engine.
|
|
87
|
+
*
|
|
88
|
+
* Do not extend the SyntheticBased interface because this one doesn't have a raw trace event but a raw cpu profile.
|
|
89
|
+
* Also we won't manage this event through SyntheticEventsManager.
|
|
86
90
|
*/
|
|
87
|
-
export interface SyntheticCpuProfile extends
|
|
91
|
+
export interface SyntheticCpuProfile extends Complete {
|
|
88
92
|
name: Name.CPU_PROFILE;
|
|
93
|
+
id: ProfileID;
|
|
89
94
|
args: Args & {
|
|
90
95
|
data: ArgsData & {
|
|
91
96
|
cpuProfile: Protocol.Profiler.Profile;
|
|
@@ -554,6 +559,7 @@ export interface LargestContentfulPaintCandidate extends Mark {
|
|
|
554
559
|
nodeId: Protocol.DOM.BackendNodeId;
|
|
555
560
|
loadingAttr: string;
|
|
556
561
|
type?: string;
|
|
562
|
+
nodeName?: string;
|
|
557
563
|
};
|
|
558
564
|
};
|
|
559
565
|
}
|
|
@@ -575,6 +581,7 @@ export interface LargestTextPaintCandidate extends Mark {
|
|
|
575
581
|
data?: ArgsData & {
|
|
576
582
|
candidateIndex: number;
|
|
577
583
|
DOMNodeId: Protocol.DOM.BackendNodeId;
|
|
584
|
+
nodeName?: string;
|
|
578
585
|
};
|
|
579
586
|
};
|
|
580
587
|
}
|
|
@@ -951,7 +958,8 @@ export interface ScheduleStyleInvalidationTracking extends Instant {
|
|
|
951
958
|
}
|
|
952
959
|
export declare function isScheduleStyleInvalidationTracking(event: Event): event is ScheduleStyleInvalidationTracking;
|
|
953
960
|
export declare enum StyleRecalcInvalidationReason {
|
|
954
|
-
ANIMATION = "Animation"
|
|
961
|
+
ANIMATION = "Animation",
|
|
962
|
+
RELATED_STYLE_RULE = "Related style rule"
|
|
955
963
|
}
|
|
956
964
|
export interface StyleRecalcInvalidationTracking extends Instant {
|
|
957
965
|
name: Name.STYLE_RECALC_INVALIDATION_TRACKING;
|
|
@@ -981,6 +989,10 @@ export interface StyleInvalidatorInvalidationTracking extends Instant {
|
|
|
981
989
|
subtree: boolean;
|
|
982
990
|
nodeName?: string;
|
|
983
991
|
extraData?: string;
|
|
992
|
+
selectors?: Array<{
|
|
993
|
+
selector: string;
|
|
994
|
+
style_sheet_id: string;
|
|
995
|
+
}>;
|
|
984
996
|
};
|
|
985
997
|
};
|
|
986
998
|
}
|
|
@@ -1020,6 +1032,9 @@ export interface ScheduleStyleRecalculation extends Instant {
|
|
|
1020
1032
|
args: Args & {
|
|
1021
1033
|
data: {
|
|
1022
1034
|
frame: string;
|
|
1035
|
+
reason?: StyleRecalcInvalidationReason;
|
|
1036
|
+
subtree?: boolean;
|
|
1037
|
+
nodeId?: Protocol.DOM.BackendNodeId;
|
|
1023
1038
|
};
|
|
1024
1039
|
};
|
|
1025
1040
|
}
|
|
@@ -1159,6 +1174,9 @@ export interface ConsoleTimeStamp extends Event {
|
|
|
1159
1174
|
track?: string | number;
|
|
1160
1175
|
trackGroup?: string | number;
|
|
1161
1176
|
color?: string | number;
|
|
1177
|
+
devtools?: {
|
|
1178
|
+
link: ExtensionTrackEntryPayloadDeeplink;
|
|
1179
|
+
};
|
|
1162
1180
|
sampleTraceId?: number;
|
|
1163
1181
|
};
|
|
1164
1182
|
};
|
|
@@ -1176,8 +1194,9 @@ export interface UserTimingMeasure extends Event {
|
|
|
1176
1194
|
traceId: number;
|
|
1177
1195
|
};
|
|
1178
1196
|
}
|
|
1179
|
-
/**
|
|
1180
|
-
|
|
1197
|
+
/**
|
|
1198
|
+
* ChromeFrameReporter args for PipelineReporter event.
|
|
1199
|
+
* Matching proto: https://source.chromium.org/chromium/chromium/src/+/main:third_party/perfetto/protos/perfetto/trace/track_event/chrome_frame_reporter.proto
|
|
1181
1200
|
*/
|
|
1182
1201
|
interface ChromeFrameReporter {
|
|
1183
1202
|
state: State;
|
|
@@ -1185,11 +1204,15 @@ interface ChromeFrameReporter {
|
|
|
1185
1204
|
/** The reason is set only if |state| is not |STATE_UPDATED_ALL|. */
|
|
1186
1205
|
reason: FrameDropReason;
|
|
1187
1206
|
frame_source: number;
|
|
1188
|
-
/**
|
|
1189
|
-
|
|
1207
|
+
/**
|
|
1208
|
+
* Identifies a BeginFrameArgs (along with the source_id).
|
|
1209
|
+
* See comments in components/viz/common/frame_sinks/begin_frame_args.h.
|
|
1210
|
+
*/
|
|
1190
1211
|
frame_sequence: number;
|
|
1191
|
-
/**
|
|
1192
|
-
|
|
1212
|
+
/**
|
|
1213
|
+
* If this is a dropped frame (i.e. if |state| is set to |STATE_DROPPED| or
|
|
1214
|
+
* |STATE_PRESENTED_PARTIAL|), then indicates whether this frame impacts smoothness.
|
|
1215
|
+
*/
|
|
1193
1216
|
affects_smoothness: boolean;
|
|
1194
1217
|
/** The type of active scroll. */
|
|
1195
1218
|
scroll_state: ScrollState;
|
|
@@ -1199,48 +1222,66 @@ interface ChromeFrameReporter {
|
|
|
1199
1222
|
has_compositor_animation: boolean;
|
|
1200
1223
|
/** If any touch-driven UX (not scroll) is active during this frame. */
|
|
1201
1224
|
has_smooth_input_main: boolean;
|
|
1202
|
-
/**
|
|
1203
|
-
|
|
1225
|
+
/**
|
|
1226
|
+
* Whether the frame contained any missing content (i.e. whether there was
|
|
1227
|
+
* checkerboarding in the frame).
|
|
1228
|
+
*/
|
|
1204
1229
|
has_missing_content: boolean;
|
|
1205
1230
|
/** The id of layer_tree_host that the frame has been produced for. */
|
|
1206
1231
|
layer_tree_host_id: number;
|
|
1207
1232
|
/** If total latency of PipelineReporter exceeds a certain limit. */
|
|
1208
1233
|
has_high_latency: boolean;
|
|
1209
|
-
/**
|
|
1210
|
-
|
|
1211
|
-
|
|
1234
|
+
/**
|
|
1235
|
+
* Indicate if the frame is "FORKED" (i.e. a PipelineReporter event starts at
|
|
1236
|
+
* the same frame sequence as another PipelineReporter) or "BACKFILL"
|
|
1237
|
+
* (i.e. dropped frames when there are no partial compositor updates).
|
|
1238
|
+
*/
|
|
1212
1239
|
frame_type: FrameType;
|
|
1213
|
-
/**
|
|
1214
|
-
|
|
1240
|
+
/**
|
|
1241
|
+
* The breakdown stage of PipelineReporter that is most likely accountable for
|
|
1242
|
+
* high latency.
|
|
1243
|
+
*/
|
|
1215
1244
|
high_latency_contribution_stage: string[];
|
|
1216
1245
|
}
|
|
1217
1246
|
declare const enum State {
|
|
1218
1247
|
/** The frame did not have any updates to present. **/
|
|
1219
1248
|
STATE_NO_UPDATE_DESIRED = "STATE_NO_UPDATE_DESIRED",
|
|
1220
|
-
/**
|
|
1221
|
-
|
|
1249
|
+
/**
|
|
1250
|
+
* The frame presented all the desired updates (i.e. any updates requested
|
|
1251
|
+
* from both the compositor thread and main-threads were handled). *
|
|
1252
|
+
*/
|
|
1222
1253
|
STATE_PRESENTED_ALL = "STATE_PRESENTED_ALL",
|
|
1223
|
-
/**
|
|
1224
|
-
|
|
1225
|
-
|
|
1254
|
+
/**
|
|
1255
|
+
* The frame was presented with some updates, but also missed some updates
|
|
1256
|
+
* (e.g. missed updates from the main-thread, but included updates from the
|
|
1257
|
+
* compositor thread). *
|
|
1258
|
+
*/
|
|
1226
1259
|
STATE_PRESENTED_PARTIAL = "STATE_PRESENTED_PARTIAL",
|
|
1227
|
-
/**
|
|
1228
|
-
|
|
1260
|
+
/**
|
|
1261
|
+
* The frame was dropped, i.e. some updates were desired for the frame, but
|
|
1262
|
+
* was not presented. *
|
|
1263
|
+
*/
|
|
1229
1264
|
STATE_DROPPED = "STATE_DROPPED"
|
|
1230
1265
|
}
|
|
1231
1266
|
declare const enum FrameDropReason {
|
|
1232
1267
|
REASON_UNSPECIFIED = "REASON_UNSPECIFIED",
|
|
1233
|
-
/**
|
|
1234
|
-
|
|
1235
|
-
|
|
1268
|
+
/**
|
|
1269
|
+
* Frame was dropped by the display-compositor.
|
|
1270
|
+
* The display-compositor may drop a frame some times (e.g. the frame missed
|
|
1271
|
+
* the deadline, or was blocked on surface-sync, etc.) *
|
|
1272
|
+
*/
|
|
1236
1273
|
REASON_DISPLAY_COMPOSITOR = "REASON_DISPLAY_COMPOSITOR",
|
|
1237
|
-
/**
|
|
1238
|
-
|
|
1239
|
-
|
|
1274
|
+
/**
|
|
1275
|
+
* Frame was dropped because of the main-thread.
|
|
1276
|
+
* The main-thread may cause a frame to be dropped, e.g. if the main-thread
|
|
1277
|
+
* is running expensive javascript, or doing a lot of layout updates, etc. *
|
|
1278
|
+
*/
|
|
1240
1279
|
REASON_MAIN_THREAD = "REASON_MAIN_THREAD",
|
|
1241
|
-
/**
|
|
1242
|
-
|
|
1243
|
-
|
|
1280
|
+
/**
|
|
1281
|
+
* Frame was dropped by the client compositor.
|
|
1282
|
+
* The client compositor can drop some frames too (e.g. attempting to
|
|
1283
|
+
* recover latency, missing the deadline, etc.). *
|
|
1284
|
+
*/
|
|
1244
1285
|
REASON_CLIENT_COMPOSITOR = "REASON_CLIENT_COMPOSITOR"
|
|
1245
1286
|
}
|
|
1246
1287
|
declare const enum ScrollState {
|
|
@@ -1452,6 +1493,10 @@ export interface DecodeImage extends Complete {
|
|
|
1452
1493
|
};
|
|
1453
1494
|
}
|
|
1454
1495
|
export declare function isDecodeImage(event: Event): event is DecodeImage;
|
|
1496
|
+
export declare enum InvalidationEventType {
|
|
1497
|
+
StyleInvalidatorInvalidationTracking = "StyleInvalidatorInvalidationTracking",
|
|
1498
|
+
StyleRecalcInvalidationTracking = "StyleRecalcInvalidationTracking"
|
|
1499
|
+
}
|
|
1455
1500
|
export interface SelectorTiming {
|
|
1456
1501
|
'elapsed (us)': number;
|
|
1457
1502
|
fast_reject_count: number;
|
|
@@ -1459,6 +1504,7 @@ export interface SelectorTiming {
|
|
|
1459
1504
|
selector: string;
|
|
1460
1505
|
style_sheet_id: string;
|
|
1461
1506
|
match_count: number;
|
|
1507
|
+
invalidation_count: number;
|
|
1462
1508
|
}
|
|
1463
1509
|
export declare enum SelectorTimingsKey {
|
|
1464
1510
|
Elapsed = "elapsed (us)",
|
|
@@ -1467,7 +1513,8 @@ export declare enum SelectorTimingsKey {
|
|
|
1467
1513
|
MatchAttempts = "match_attempts",
|
|
1468
1514
|
MatchCount = "match_count",
|
|
1469
1515
|
Selector = "selector",
|
|
1470
|
-
StyleSheetId = "style_sheet_id"
|
|
1516
|
+
StyleSheetId = "style_sheet_id",
|
|
1517
|
+
InvalidationCount = "invalidation_count"
|
|
1471
1518
|
}
|
|
1472
1519
|
export interface SelectorStats {
|
|
1473
1520
|
selector_timings: SelectorTiming[];
|
|
@@ -1775,7 +1822,6 @@ export interface RequestAnimationFrame extends Instant {
|
|
|
1775
1822
|
};
|
|
1776
1823
|
};
|
|
1777
1824
|
}
|
|
1778
|
-
export declare function isRequestAnimationFrame(event: Event): event is RequestAnimationFrame;
|
|
1779
1825
|
export interface TimerInstall extends Instant {
|
|
1780
1826
|
name: Name.TIMER_INSTALL;
|
|
1781
1827
|
args: Args & {
|
|
@@ -1862,7 +1908,6 @@ export interface WebSocketSend extends Instant {
|
|
|
1862
1908
|
};
|
|
1863
1909
|
};
|
|
1864
1910
|
}
|
|
1865
|
-
export declare function isWebSocketSend(event: Event): event is WebSocketSend;
|
|
1866
1911
|
export interface WebSocketReceive extends Instant {
|
|
1867
1912
|
name: Name.WEB_SOCKET_RECEIVE;
|
|
1868
1913
|
args: Args & {
|
|
@@ -1875,7 +1920,6 @@ export interface WebSocketReceive extends Instant {
|
|
|
1875
1920
|
};
|
|
1876
1921
|
};
|
|
1877
1922
|
}
|
|
1878
|
-
export declare function isWebSocketReceive(event: Event): event is WebSocketReceive;
|
|
1879
1923
|
export interface WebSocketSendHandshakeRequest extends Instant {
|
|
1880
1924
|
name: Name.WEB_SOCKET_SEND_HANDSHAKE_REQUEST;
|
|
1881
1925
|
args: Args & {
|
|
@@ -2302,6 +2346,5 @@ export interface V8SourceRundownSourcesStubScriptCatchupEvent extends Event {
|
|
|
2302
2346
|
};
|
|
2303
2347
|
};
|
|
2304
2348
|
}
|
|
2305
|
-
export declare function isV8SourceRundownSourcesStubScriptCatchupEvent(event: Event): event is V8SourceRundownSourcesStubScriptCatchupEvent;
|
|
2306
2349
|
export declare function isAnyScriptCatchupEvent(event: Event): event is V8SourceRundownSourcesScriptCatchupEvent | V8SourceRundownSourcesLargeScriptCatchupEvent | V8SourceRundownSourcesStubScriptCatchupEvent;
|
|
2307
2350
|
export {};
|