@paulirish/trace_engine 0.0.67-beta.2 → 0.0.68
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/analyze-inspector-issues.d.mts +13 -0
- package/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts.map +1 -0
- package/.tmp/tsbuildinfo/analyze-trace.d.mts +17 -0
- package/.tmp/tsbuildinfo/analyze-trace.d.mts.map +1 -0
- package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts +2 -0
- package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts.map +1 -0
- package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts +3 -0
- package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts.map +1 -0
- package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +1 -0
- package/README.md +22 -62
- package/analyze-inspector-issues.mjs +60 -0
- package/analyze-trace.mjs +144 -6
- package/core/common/ParsedURL.d.ts +0 -2
- package/core/common/ParsedURL.js +512 -0
- package/core/common/ParsedURL.js.map +1 -0
- package/core/common/common.d.ts +8 -33
- package/core/common/common.js +2 -0
- package/core/host/host.d.ts +1 -13
- package/core/host/host.js +1 -0
- package/core/i18n/i18n.d.ts +20 -8
- package/core/i18n/i18n.js +15 -0
- package/core/platform/ArrayUtilities.js +224 -0
- package/core/platform/ArrayUtilities.js.map +1 -0
- package/core/platform/Brand.js +5 -0
- package/core/platform/Brand.js.map +1 -0
- package/core/platform/Constructor.js +5 -0
- package/core/platform/Constructor.js.map +1 -0
- package/core/platform/DateUtilities.js +14 -0
- package/core/platform/DateUtilities.js.map +1 -0
- package/core/platform/DevToolsPath.js +28 -0
- package/core/platform/DevToolsPath.js.map +1 -0
- package/core/platform/HostRuntime.js +8 -0
- package/core/platform/HostRuntime.js.map +1 -0
- package/core/platform/KeyboardUtilities.js +34 -0
- package/core/platform/KeyboardUtilities.js.map +1 -0
- package/core/platform/MapUtilities.js +80 -0
- package/core/platform/MapUtilities.js.map +1 -0
- package/core/platform/MimeType.js +157 -0
- package/core/platform/MimeType.js.map +1 -0
- package/core/platform/NumberUtilities.js +73 -0
- package/core/platform/NumberUtilities.js.map +1 -0
- package/core/platform/Size.js +36 -0
- package/core/platform/Size.js.map +1 -0
- package/core/platform/StringUtilities.d.ts +15 -4
- package/core/platform/StringUtilities.js +767 -0
- package/core/platform/StringUtilities.js.map +1 -0
- package/core/platform/Timing.js +10 -0
- package/core/platform/Timing.js.map +1 -0
- package/core/platform/TypedArrayUtilities.js +158 -0
- package/core/platform/TypedArrayUtilities.js.map +1 -0
- package/core/platform/TypescriptUtilities.js +17 -0
- package/core/platform/TypescriptUtilities.js.map +1 -0
- package/core/platform/UIString.d.ts +5 -2
- package/core/platform/UIString.js +5 -0
- package/core/platform/UIString.js.map +1 -0
- package/core/platform/UserVisibleError.d.ts +1 -12
- package/core/platform/UserVisibleError.js +23 -0
- package/core/platform/UserVisibleError.js.map +1 -0
- package/core/platform/api/HostRuntime.d.ts +1 -0
- package/core/platform/api/HostRuntime.js +5 -0
- package/core/platform/api/HostRuntime.js.map +1 -0
- package/core/platform/api/api-tsconfig.json +58 -0
- package/core/platform/api/api-tsconfig.ref.json +26 -0
- package/core/platform/api/api.js +6 -0
- package/core/platform/api/api.js.map +1 -0
- package/core/platform/bundle-tsconfig.json +59 -0
- package/core/platform/bundle-tsconfig.ref.json +27 -0
- package/core/platform/foundation_unittests-tsconfig.json +73 -0
- package/core/platform/foundation_unittests-tsconfig.ref.json +40 -0
- package/core/platform/foundation_unittests_node_typecheck-tsconfig.json +69 -0
- package/core/platform/platform-tsconfig.json +81 -0
- package/core/platform/platform-tsconfig.ref.json +49 -0
- package/core/platform/platform.js +28 -0
- package/core/platform/platform.js.map +1 -0
- package/core/platform/platform_node_typecheck-tsconfig.json +78 -0
- package/core/platform/platform_node_typecheck.stamp +0 -0
- package/core/root/root.d.ts +1 -4
- package/core/root/root.js +1 -0
- package/core/sdk/sdk.d.ts +27 -97
- package/core/sdk/sdk.js +1 -0
- package/generated/protocol.d.ts +34 -6
- package/generated/protocol.js +3312 -0
- package/locales/af.json +94 -97
- package/locales/am.json +353 -356
- package/locales/ar.json +354 -357
- package/locales/as.json +352 -355
- package/locales/az.json +343 -346
- package/locales/be.json +353 -356
- package/locales/bg.json +353 -356
- package/locales/bn.json +353 -356
- package/locales/bs.json +247 -250
- package/locales/ca.json +285 -288
- package/locales/cs.json +338 -341
- package/locales/cy.json +124 -127
- package/locales/da.json +202 -205
- package/locales/de.json +222 -225
- package/locales/el.json +338 -341
- package/locales/en-GB.json +78 -81
- package/locales/en-US.json +250 -256
- package/locales/en-XL.json +1052 -0
- package/locales/es-419.json +278 -281
- package/locales/es.json +279 -282
- package/locales/et.json +237 -240
- package/locales/eu.json +124 -127
- package/locales/fa.json +353 -356
- package/locales/fi.json +283 -286
- package/locales/fil.json +32 -35
- package/locales/fr-CA.json +310 -313
- package/locales/fr.json +307 -310
- package/locales/gl.json +263 -266
- package/locales/gu.json +354 -357
- package/locales/he.json +354 -357
- package/locales/hi.json +338 -341
- package/locales/hr.json +238 -241
- package/locales/hu.json +344 -347
- package/locales/hy.json +353 -356
- package/locales/id.json +67 -70
- package/locales/is.json +305 -308
- package/locales/it.json +175 -178
- package/locales/ja.json +353 -356
- package/locales/ka.json +354 -357
- package/locales/kk.json +354 -357
- package/locales/km.json +353 -356
- package/locales/kn.json +354 -357
- package/locales/ko.json +353 -356
- package/locales/ky.json +352 -355
- package/locales/lo.json +354 -357
- package/locales/lt.json +322 -325
- package/locales/lv.json +319 -322
- package/locales/mk.json +354 -357
- package/locales/ml.json +353 -356
- package/locales/mn.json +353 -356
- package/locales/mr.json +353 -356
- package/locales/ms.json +14 -17
- package/locales/my.json +352 -355
- package/locales/ne.json +338 -341
- package/locales/nl.json +91 -94
- package/locales/no.json +179 -182
- package/locales/or.json +353 -356
- package/locales/pa.json +353 -356
- package/locales/pl.json +309 -312
- package/locales/pt-PT.json +275 -278
- package/locales/pt.json +268 -271
- package/locales/ro.json +309 -312
- package/locales/ru.json +353 -356
- package/locales/si.json +354 -357
- package/locales/sk.json +335 -338
- package/locales/sl.json +220 -223
- package/locales/sq.json +318 -321
- package/locales/sr-Latn.json +255 -258
- package/locales/sr.json +354 -357
- package/locales/sv.json +281 -284
- package/locales/sw.json +68 -71
- package/locales/ta.json +354 -357
- package/locales/te.json +352 -355
- package/locales/th.json +354 -357
- package/locales/tr.json +328 -331
- package/locales/uk.json +353 -356
- package/locales/ur.json +354 -357
- package/locales/uz.json +168 -171
- package/locales/vi.json +354 -357
- package/locales/zh-HK.json +354 -357
- package/locales/zh-TW.json +353 -356
- package/locales/zh.json +353 -356
- package/locales/zu.json +52 -55
- package/models/cpu_profile/CPUProfileDataModel.d.ts +0 -33
- package/models/cpu_profile/CPUProfileDataModel.js +517 -0
- package/models/cpu_profile/CPUProfileDataModel.js.map +1 -0
- package/models/cpu_profile/ProfileTreeModel.d.ts +1 -2
- package/models/cpu_profile/ProfileTreeModel.js +90 -0
- package/models/cpu_profile/ProfileTreeModel.js.map +1 -0
- package/models/cpu_profile/bundle-tsconfig.json +59 -0
- package/models/cpu_profile/bundle-tsconfig.ref.json +27 -0
- package/models/cpu_profile/cpu_profile-tsconfig.json +63 -0
- package/models/cpu_profile/cpu_profile-tsconfig.ref.json +31 -0
- package/models/cpu_profile/cpu_profile.js +7 -0
- package/models/cpu_profile/cpu_profile.js.map +1 -0
- package/models/cpu_profile/cpu_profile_node_typecheck-tsconfig.json +60 -0
- package/models/cpu_profile/cpu_profile_node_typecheck.stamp +0 -0
- package/models/cpu_profile/foundation_unittests-tsconfig.json +63 -0
- package/models/cpu_profile/foundation_unittests-tsconfig.ref.json +30 -0
- package/models/cpu_profile/foundation_unittests_node_typecheck-tsconfig.json +59 -0
- package/models/crux-manager/crux-manager.d.ts +3 -1
- package/models/crux-manager/crux-manager.js +1 -0
- package/models/trace/EntityMapper.js +133 -0
- package/models/trace/EntityMapper.js.map +1 -0
- package/models/trace/EventsSerializer.d.ts +1 -0
- package/models/trace/EventsSerializer.js +113 -0
- package/models/trace/EventsSerializer.js.map +1 -0
- package/models/trace/LanternComputationData.js +394 -0
- package/models/trace/LanternComputationData.js.map +1 -0
- package/models/trace/ModelImpl.js +179 -0
- package/models/trace/ModelImpl.js.map +1 -0
- package/models/trace/Name.js +115 -0
- package/models/trace/Name.js.map +1 -0
- package/models/trace/Processor.js +616 -0
- package/models/trace/Processor.js.map +1 -0
- package/models/trace/Styles.d.ts +2 -2
- package/models/trace/Styles.js +836 -0
- package/models/trace/Styles.js.map +1 -0
- package/models/trace/bundle-tsconfig.json +77 -0
- package/models/trace/bundle-tsconfig.ref.json +45 -0
- package/models/trace/extras/FilmStrip.js +45 -0
- package/models/trace/extras/FilmStrip.js.map +1 -0
- package/models/trace/extras/Initiators.js +47 -0
- package/models/trace/extras/Initiators.js.map +1 -0
- package/models/trace/extras/MainThreadActivity.js +77 -0
- package/models/trace/extras/MainThreadActivity.js.map +1 -0
- package/models/trace/extras/ScriptDuplication.js +163 -0
- package/models/trace/extras/ScriptDuplication.js.map +1 -0
- package/models/trace/extras/StackTraceForEvent.js +192 -0
- package/models/trace/extras/StackTraceForEvent.js.map +1 -0
- package/models/trace/extras/ThirdParties.js +119 -0
- package/models/trace/extras/ThirdParties.js.map +1 -0
- package/models/trace/extras/TraceFilter.js +51 -0
- package/models/trace/extras/TraceFilter.js.map +1 -0
- package/models/trace/extras/TraceTree.js +678 -0
- package/models/trace/extras/TraceTree.js.map +1 -0
- package/models/trace/extras/bundle-tsconfig.json +59 -0
- package/models/trace/extras/bundle-tsconfig.ref.json +27 -0
- package/models/trace/extras/extras-tsconfig.json +81 -0
- package/models/trace/extras/extras-tsconfig.ref.json +49 -0
- package/models/trace/extras/extras.js +12 -0
- package/models/trace/extras/extras.js.map +1 -0
- package/models/trace/extras/extras_node_typecheck-tsconfig.json +78 -0
- package/models/trace/extras/extras_node_typecheck.stamp +0 -0
- package/models/trace/extras/foundation_unittests-tsconfig.json +91 -0
- package/models/trace/extras/foundation_unittests-tsconfig.ref.json +58 -0
- package/models/trace/extras/foundation_unittests_node_typecheck-tsconfig.json +87 -0
- package/models/trace/foundation_unittests-tsconfig.json +70 -0
- package/models/trace/foundation_unittests-tsconfig.ref.json +37 -0
- package/models/trace/foundation_unittests_node_typecheck-tsconfig.json +66 -0
- package/models/trace/handlers/AnimationFramesHandler.js +110 -0
- package/models/trace/handlers/AnimationFramesHandler.js.map +1 -0
- package/models/trace/handlers/AnimationHandler.js +27 -0
- package/models/trace/handlers/AnimationHandler.js.map +1 -0
- package/models/trace/handlers/AsyncJSCallsHandler.js +188 -0
- package/models/trace/handlers/AsyncJSCallsHandler.js.map +1 -0
- package/models/trace/handlers/DOMStatsHandler.js +22 -0
- package/models/trace/handlers/DOMStatsHandler.js.map +1 -0
- package/models/trace/handlers/ExtensionTraceDataHandler.js +264 -0
- package/models/trace/handlers/ExtensionTraceDataHandler.js.map +1 -0
- package/models/trace/handlers/FlowsHandler.js +155 -0
- package/models/trace/handlers/FlowsHandler.js.map +1 -0
- package/models/trace/handlers/FramesHandler.js +491 -0
- package/models/trace/handlers/FramesHandler.js.map +1 -0
- package/models/trace/handlers/GPUHandler.js +36 -0
- package/models/trace/handlers/GPUHandler.js.map +1 -0
- package/models/trace/handlers/ImagePaintingHandler.js +148 -0
- package/models/trace/handlers/ImagePaintingHandler.js.map +1 -0
- package/models/trace/handlers/InitiatorsHandler.js +169 -0
- package/models/trace/handlers/InitiatorsHandler.js.map +1 -0
- package/models/trace/handlers/InvalidationsHandler.js +125 -0
- package/models/trace/handlers/InvalidationsHandler.js.map +1 -0
- package/models/trace/handlers/LargestImagePaintHandler.js +86 -0
- package/models/trace/handlers/LargestImagePaintHandler.js.map +1 -0
- package/models/trace/handlers/LargestTextPaintHandler.js +28 -0
- package/models/trace/handlers/LargestTextPaintHandler.js.map +1 -0
- package/models/trace/handlers/LayerTreeHandler.js +104 -0
- package/models/trace/handlers/LayerTreeHandler.js.map +1 -0
- package/models/trace/handlers/LayoutShiftsHandler.js +449 -0
- package/models/trace/handlers/LayoutShiftsHandler.js.map +1 -0
- package/models/trace/handlers/MemoryHandler.js +22 -0
- package/models/trace/handlers/MemoryHandler.js.map +1 -0
- package/models/trace/handlers/MetaHandler.js +442 -0
- package/models/trace/handlers/MetaHandler.js.map +1 -0
- package/models/trace/handlers/ModelHandlers.js +33 -0
- package/models/trace/handlers/ModelHandlers.js.map +1 -0
- package/models/trace/handlers/NetworkRequestsHandler.js +584 -0
- package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -0
- package/models/trace/handlers/PageFramesHandler.js +43 -0
- package/models/trace/handlers/PageFramesHandler.js.map +1 -0
- package/models/trace/handlers/PageLoadMetricsHandler.js +463 -0
- package/models/trace/handlers/PageLoadMetricsHandler.js.map +1 -0
- package/models/trace/handlers/RendererHandler.js +346 -0
- package/models/trace/handlers/RendererHandler.js.map +1 -0
- package/models/trace/handlers/SamplesHandler.js +264 -0
- package/models/trace/handlers/SamplesHandler.js.map +1 -0
- package/models/trace/handlers/ScreenshotsHandler.js +56 -0
- package/models/trace/handlers/ScreenshotsHandler.js.map +1 -0
- package/models/trace/handlers/ScriptsHandler.js +277 -0
- package/models/trace/handlers/ScriptsHandler.js.map +1 -0
- package/models/trace/handlers/SelectorStatsHandler.js +72 -0
- package/models/trace/handlers/SelectorStatsHandler.js.map +1 -0
- package/models/trace/handlers/Threads.js +108 -0
- package/models/trace/handlers/Threads.js.map +1 -0
- package/models/trace/handlers/UserInteractionsHandler.js +319 -0
- package/models/trace/handlers/UserInteractionsHandler.js.map +1 -0
- package/models/trace/handlers/UserTimingsHandler.js +194 -0
- package/models/trace/handlers/UserTimingsHandler.js.map +1 -0
- package/models/trace/handlers/WarningsHandler.js +135 -0
- package/models/trace/handlers/WarningsHandler.js.map +1 -0
- package/models/trace/handlers/WorkersHandler.js +34 -0
- package/models/trace/handlers/WorkersHandler.js.map +1 -0
- package/models/trace/handlers/bundle-tsconfig.json +59 -0
- package/models/trace/handlers/bundle-tsconfig.ref.json +27 -0
- package/models/trace/handlers/foundation_unittests-tsconfig.json +102 -0
- package/models/trace/handlers/foundation_unittests-tsconfig.ref.json +69 -0
- package/models/trace/handlers/foundation_unittests_node_typecheck-tsconfig.json +98 -0
- package/models/trace/handlers/handlers-tsconfig.json +112 -0
- package/models/trace/handlers/handlers-tsconfig.ref.json +80 -0
- package/models/trace/handlers/handlers.js +8 -0
- package/models/trace/handlers/handlers.js.map +1 -0
- package/models/trace/handlers/handlers_node_typecheck-tsconfig.json +109 -0
- package/models/trace/handlers/handlers_node_typecheck.stamp +0 -0
- package/models/trace/handlers/helpers.js +167 -0
- package/models/trace/handlers/helpers.js.map +1 -0
- package/models/trace/handlers/types.js +2 -0
- package/models/trace/handlers/types.js.map +1 -0
- package/models/trace/helpers/Extensions.js +42 -0
- package/models/trace/helpers/Extensions.js.map +1 -0
- package/models/trace/helpers/Network.js +103 -0
- package/models/trace/helpers/Network.js.map +1 -0
- package/models/trace/helpers/SamplesIntegrator.js +527 -0
- package/models/trace/helpers/SamplesIntegrator.js.map +1 -0
- package/models/trace/helpers/SyntheticEvents.d.ts +0 -8
- package/models/trace/helpers/SyntheticEvents.js +73 -0
- package/models/trace/helpers/SyntheticEvents.js.map +1 -0
- package/models/trace/helpers/Timing.js +200 -0
- package/models/trace/helpers/Timing.js.map +1 -0
- package/models/trace/helpers/Trace.js +844 -0
- package/models/trace/helpers/Trace.js.map +1 -0
- package/models/trace/helpers/TreeHelpers.js +255 -0
- package/models/trace/helpers/TreeHelpers.js.map +1 -0
- package/models/trace/helpers/bundle-tsconfig.json +59 -0
- package/models/trace/helpers/bundle-tsconfig.ref.json +27 -0
- package/models/trace/helpers/foundation_unittests-tsconfig.json +73 -0
- package/models/trace/helpers/foundation_unittests-tsconfig.ref.json +40 -0
- package/models/trace/helpers/foundation_unittests_node_typecheck-tsconfig.json +69 -0
- package/models/trace/helpers/helpers-tsconfig.json +77 -0
- package/models/trace/helpers/helpers-tsconfig.ref.json +45 -0
- package/models/trace/helpers/helpers.js +11 -0
- package/models/trace/helpers/helpers.js.map +1 -0
- package/models/trace/helpers/helpers_node_typecheck-tsconfig.json +74 -0
- package/models/trace/helpers/helpers_node_typecheck.stamp +0 -0
- package/models/trace/insights/CLSCulprits.d.ts +14 -14
- package/models/trace/insights/CLSCulprits.js +519 -0
- package/models/trace/insights/CLSCulprits.js.map +1 -0
- package/models/trace/insights/Cache.d.ts +6 -6
- package/models/trace/insights/Cache.js +210 -0
- package/models/trace/insights/Cache.js.map +1 -0
- package/models/trace/insights/CharacterSet.d.ts +8 -8
- package/models/trace/insights/CharacterSet.js +132 -0
- package/models/trace/insights/CharacterSet.js.map +1 -0
- package/models/trace/insights/Common.js +367 -0
- package/models/trace/insights/Common.js.map +1 -0
- package/models/trace/insights/DOMSize.d.ts +13 -13
- package/models/trace/insights/DOMSize.js +182 -0
- package/models/trace/insights/DOMSize.js.map +1 -0
- package/models/trace/insights/DocumentLatency.d.ts +11 -11
- package/models/trace/insights/DocumentLatency.js +259 -0
- package/models/trace/insights/DocumentLatency.js.map +1 -0
- package/models/trace/insights/DuplicatedJavaScript.d.ts +5 -5
- package/models/trace/insights/DuplicatedJavaScript.js +110 -0
- package/models/trace/insights/DuplicatedJavaScript.js.map +1 -0
- package/models/trace/insights/FontDisplay.d.ts +5 -5
- package/models/trace/insights/FontDisplay.js +93 -0
- package/models/trace/insights/FontDisplay.js.map +1 -0
- package/models/trace/insights/ForcedReflow.d.ts +7 -7
- package/models/trace/insights/ForcedReflow.js +162 -0
- package/models/trace/insights/ForcedReflow.js.map +1 -0
- package/models/trace/insights/INPBreakdown.d.ts +8 -8
- package/models/trace/insights/INPBreakdown.js +130 -0
- package/models/trace/insights/INPBreakdown.js.map +1 -0
- package/models/trace/insights/ImageDelivery.d.ts +12 -12
- package/models/trace/insights/ImageDelivery.js +264 -0
- package/models/trace/insights/ImageDelivery.js.map +1 -0
- package/models/trace/insights/LCPBreakdown.d.ts +11 -11
- package/models/trace/insights/LCPBreakdown.js +200 -0
- package/models/trace/insights/LCPBreakdown.js.map +1 -0
- package/models/trace/insights/LCPDiscovery.d.ts +10 -10
- package/models/trace/insights/LCPDiscovery.js +190 -0
- package/models/trace/insights/LCPDiscovery.js.map +1 -0
- package/models/trace/insights/LegacyJavaScript.d.ts +5 -5
- package/models/trace/insights/LegacyJavaScript.js +99 -0
- package/models/trace/insights/LegacyJavaScript.js.map +1 -0
- package/models/trace/insights/Models.js +23 -0
- package/models/trace/insights/Models.js.map +1 -0
- package/models/trace/insights/ModernHTTP.d.ts +5 -5
- package/models/trace/insights/ModernHTTP.js +205 -0
- package/models/trace/insights/ModernHTTP.js.map +1 -0
- package/models/trace/insights/NetworkDependencyTree.d.ts +19 -19
- package/models/trace/insights/NetworkDependencyTree.js +551 -0
- package/models/trace/insights/NetworkDependencyTree.js.map +1 -0
- package/models/trace/insights/RenderBlocking.d.ts +5 -5
- package/models/trace/insights/RenderBlocking.js +213 -0
- package/models/trace/insights/RenderBlocking.js.map +1 -0
- package/models/trace/insights/SlowCSSSelector.d.ts +10 -10
- package/models/trace/insights/SlowCSSSelector.js +140 -0
- package/models/trace/insights/SlowCSSSelector.js.map +1 -0
- package/models/trace/insights/Statistics.js +93 -0
- package/models/trace/insights/Statistics.js.map +1 -0
- package/models/trace/insights/ThirdParties.d.ts +6 -6
- package/models/trace/insights/ThirdParties.js +110 -0
- package/models/trace/insights/ThirdParties.js.map +1 -0
- package/models/trace/insights/Viewport.d.ts +3 -3
- package/models/trace/insights/Viewport.js +105 -0
- package/models/trace/insights/Viewport.js.map +1 -0
- package/models/trace/insights/bundle-tsconfig.json +59 -0
- package/models/trace/insights/bundle-tsconfig.ref.json +27 -0
- package/models/trace/insights/foundation_unittests-tsconfig.json +98 -0
- package/models/trace/insights/foundation_unittests-tsconfig.ref.json +65 -0
- package/models/trace/insights/foundation_unittests_node_typecheck-tsconfig.json +94 -0
- package/models/trace/insights/insights-tsconfig.json +114 -0
- package/models/trace/insights/insights-tsconfig.ref.json +82 -0
- package/models/trace/insights/insights.js +10 -0
- package/models/trace/insights/insights.js.map +1 -0
- package/models/trace/insights/insights_node_typecheck-tsconfig.json +111 -0
- package/models/trace/insights/insights_node_typecheck.stamp +0 -0
- package/models/trace/insights/types.d.ts +3 -3
- package/models/trace/insights/types.js +41 -0
- package/models/trace/insights/types.js.map +1 -0
- package/models/trace/lantern/bundle-tsconfig.json +71 -0
- package/models/trace/lantern/bundle-tsconfig.ref.json +39 -0
- package/models/trace/lantern/core/LanternError.js +7 -0
- package/models/trace/lantern/core/LanternError.js.map +1 -0
- package/models/trace/lantern/core/NetworkAnalyzer.js +496 -0
- package/models/trace/lantern/core/NetworkAnalyzer.js.map +1 -0
- package/models/trace/lantern/core/bundle-tsconfig.json +59 -0
- package/models/trace/lantern/core/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/core/core-tsconfig.json +60 -0
- package/models/trace/lantern/core/core-tsconfig.ref.json +28 -0
- package/models/trace/lantern/core/core.js +6 -0
- package/models/trace/lantern/core/core.js.map +1 -0
- package/models/trace/lantern/core/core_node_typecheck-tsconfig.json +57 -0
- package/models/trace/lantern/core/core_node_typecheck.stamp +0 -0
- package/models/trace/lantern/core/foundation_unittests-tsconfig.json +69 -0
- package/models/trace/lantern/core/foundation_unittests-tsconfig.ref.json +36 -0
- package/models/trace/lantern/core/foundation_unittests_node_typecheck-tsconfig.json +65 -0
- package/models/trace/lantern/graph/BaseNode.d.ts +2 -2
- package/models/trace/lantern/graph/BaseNode.js +277 -0
- package/models/trace/lantern/graph/BaseNode.js.map +1 -0
- package/models/trace/lantern/graph/CPUNode.js +80 -0
- package/models/trace/lantern/graph/CPUNode.js.map +1 -0
- package/models/trace/lantern/graph/NetworkNode.js +95 -0
- package/models/trace/lantern/graph/NetworkNode.js.map +1 -0
- package/models/trace/lantern/graph/PageDependencyGraph.js +574 -0
- package/models/trace/lantern/graph/PageDependencyGraph.js.map +1 -0
- package/models/trace/lantern/graph/bundle-tsconfig.json +59 -0
- package/models/trace/lantern/graph/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/graph/foundation_unittests-tsconfig.json +61 -0
- package/models/trace/lantern/graph/foundation_unittests-tsconfig.ref.json +28 -0
- package/models/trace/lantern/graph/foundation_unittests_node_typecheck-tsconfig.json +57 -0
- package/models/trace/lantern/graph/graph-tsconfig.json +65 -0
- package/models/trace/lantern/graph/graph-tsconfig.ref.json +33 -0
- package/models/trace/lantern/graph/graph.js +8 -0
- package/models/trace/lantern/graph/graph.js.map +1 -0
- package/models/trace/lantern/graph/graph_node_typecheck-tsconfig.json +62 -0
- package/models/trace/lantern/graph/graph_node_typecheck.stamp +0 -0
- package/models/trace/lantern/lantern.js +10 -0
- package/models/trace/lantern/lantern.js.map +1 -0
- package/models/trace/lantern/metrics/FirstContentfulPaint.js +137 -0
- package/models/trace/lantern/metrics/FirstContentfulPaint.js.map +1 -0
- package/models/trace/lantern/metrics/Interactive.js +68 -0
- package/models/trace/lantern/metrics/Interactive.js.map +1 -0
- package/models/trace/lantern/metrics/LargestContentfulPaint.d.ts +5 -1
- package/models/trace/lantern/metrics/LargestContentfulPaint.js +187 -0
- package/models/trace/lantern/metrics/LargestContentfulPaint.js.map +1 -0
- package/models/trace/lantern/metrics/MaxPotentialFID.js +49 -0
- package/models/trace/lantern/metrics/MaxPotentialFID.js.map +1 -0
- package/models/trace/lantern/metrics/Metric.js +69 -0
- package/models/trace/lantern/metrics/Metric.js.map +1 -0
- package/models/trace/lantern/metrics/SpeedIndex.js +102 -0
- package/models/trace/lantern/metrics/SpeedIndex.js.map +1 -0
- package/models/trace/lantern/metrics/TBTUtils.js +65 -0
- package/models/trace/lantern/metrics/TBTUtils.js.map +1 -0
- package/models/trace/lantern/metrics/TotalBlockingTime.js +79 -0
- package/models/trace/lantern/metrics/TotalBlockingTime.js.map +1 -0
- package/models/trace/lantern/metrics/bundle-tsconfig.json +59 -0
- package/models/trace/lantern/metrics/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/metrics/foundation_unittests-tsconfig.json +76 -0
- package/models/trace/lantern/metrics/foundation_unittests-tsconfig.ref.json +43 -0
- package/models/trace/lantern/metrics/foundation_unittests_node_typecheck-tsconfig.json +72 -0
- package/models/trace/lantern/metrics/metrics-tsconfig.json +75 -0
- package/models/trace/lantern/metrics/metrics-tsconfig.ref.json +43 -0
- package/models/trace/lantern/metrics/metrics.js +12 -0
- package/models/trace/lantern/metrics/metrics.js.map +1 -0
- package/models/trace/lantern/metrics/metrics_node_typecheck-tsconfig.json +72 -0
- package/models/trace/lantern/metrics/metrics_node_typecheck.stamp +0 -0
- package/models/trace/lantern/simulation/ConnectionPool.js +116 -0
- package/models/trace/lantern/simulation/ConnectionPool.js.map +1 -0
- package/models/trace/lantern/simulation/Constants.js +45 -0
- package/models/trace/lantern/simulation/Constants.js.map +1 -0
- package/models/trace/lantern/simulation/DNSCache.js +48 -0
- package/models/trace/lantern/simulation/DNSCache.js.map +1 -0
- package/models/trace/lantern/simulation/SimulationTimingMap.js +135 -0
- package/models/trace/lantern/simulation/SimulationTimingMap.js.map +1 -0
- package/models/trace/lantern/simulation/Simulator.js +461 -0
- package/models/trace/lantern/simulation/Simulator.js.map +1 -0
- package/models/trace/lantern/simulation/TCPConnection.js +155 -0
- package/models/trace/lantern/simulation/TCPConnection.js.map +1 -0
- package/models/trace/lantern/simulation/bundle-tsconfig.json +59 -0
- package/models/trace/lantern/simulation/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/simulation/foundation_unittests-tsconfig.json +75 -0
- package/models/trace/lantern/simulation/foundation_unittests-tsconfig.ref.json +42 -0
- package/models/trace/lantern/simulation/foundation_unittests_node_typecheck-tsconfig.json +71 -0
- package/models/trace/lantern/simulation/simulation-tsconfig.json +70 -0
- package/models/trace/lantern/simulation/simulation-tsconfig.ref.json +38 -0
- package/models/trace/lantern/simulation/simulation.js +10 -0
- package/models/trace/lantern/simulation/simulation.js.map +1 -0
- package/models/trace/lantern/simulation/simulation_node_typecheck-tsconfig.json +67 -0
- package/models/trace/lantern/simulation/simulation_node_typecheck.stamp +0 -0
- package/models/trace/lantern/testing/bundle-tsconfig.json +60 -0
- package/models/trace/lantern/testing/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/testing/testing-tsconfig.json +63 -0
- package/models/trace/lantern/testing/testing-tsconfig.ref.json +30 -0
- package/models/trace/lantern/types/Lantern.d.ts +23 -19
- package/models/trace/lantern/types/Lantern.js +25 -0
- package/models/trace/lantern/types/Lantern.js.map +1 -0
- package/models/trace/lantern/types/bundle-tsconfig.json +59 -0
- package/models/trace/lantern/types/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/types/types-tsconfig.json +59 -0
- package/models/trace/lantern/types/types-tsconfig.ref.json +27 -0
- package/models/trace/lantern/types/types.js +5 -0
- package/models/trace/lantern/types/types.js.map +1 -0
- package/models/trace/lantern/types/types_node_typecheck-tsconfig.json +56 -0
- package/models/trace/lantern/types/types_node_typecheck.stamp +0 -0
- package/models/trace/trace-tsconfig.json +89 -0
- package/models/trace/trace-tsconfig.ref.json +57 -0
- package/models/trace/trace.js +16 -544
- package/models/trace/trace.js.map +1 -0
- package/models/trace/trace_node_typecheck-tsconfig.json +86 -0
- package/models/trace/trace_node_typecheck.stamp +0 -0
- package/models/trace/types/Configuration.d.ts +2 -2
- package/models/trace/types/Configuration.js +19 -0
- package/models/trace/types/Configuration.js.map +1 -0
- package/models/trace/types/Extensions.d.ts +1 -1
- package/models/trace/types/Extensions.js +38 -0
- package/models/trace/types/Extensions.js.map +1 -0
- package/models/trace/types/File.d.ts +9 -3
- package/models/trace/types/File.js +92 -0
- package/models/trace/types/File.js.map +1 -0
- package/models/trace/types/Overlays.js +5 -0
- package/models/trace/types/Overlays.js.map +1 -0
- package/models/trace/types/Timing.js +16 -0
- package/models/trace/types/Timing.js.map +1 -0
- package/models/trace/types/TraceEvents.d.ts +21 -16
- package/models/trace/types/TraceEvents.js +983 -0
- package/models/trace/types/TraceEvents.js.map +1 -0
- package/models/trace/types/bundle-tsconfig.json +59 -0
- package/models/trace/types/bundle-tsconfig.ref.json +27 -0
- package/models/trace/types/foundation_unittests-tsconfig.json +67 -0
- package/models/trace/types/foundation_unittests-tsconfig.ref.json +34 -0
- package/models/trace/types/foundation_unittests_node_typecheck-tsconfig.json +63 -0
- package/models/trace/types/types-tsconfig.json +76 -0
- package/models/trace/types/types-tsconfig.ref.json +44 -0
- package/models/trace/types/types.js +10 -0
- package/models/trace/types/types.js.map +1 -0
- package/models/trace/types/types_node_typecheck-tsconfig.json +73 -0
- package/models/trace/types/types_node_typecheck.stamp +0 -0
- package/package.json +8 -40
- package/test/invalid-animation-events.json.gz +0 -0
- package/test/test-trace-engine.mjs +191 -0
- package/third_party/legacy-javascript/bundle-tsconfig.json +59 -0
- package/third_party/legacy-javascript/bundle-tsconfig.ref.json +27 -0
- package/third_party/legacy-javascript/legacy-javascript-tsconfig.ref.json +15 -0
- package/third_party/legacy-javascript/legacy-javascript.js +3 -0
- package/third_party/legacy-javascript/legacy-javascript.js.map +1 -0
- package/third_party/legacy-javascript/lib/legacy-javascript.js +1119 -0
- package/third_party/marked/marked.d.ts +1 -2
- package/third_party/marked/marked.js +1 -0
- package/third_party/third-party-web/third-party-web.d.ts +1 -2
- package/third_party/third-party-web/third-party-web.js +1 -0
- package/tsconfig.json +29 -0
- package/core/common/Base64.d.ts +0 -12
- package/core/common/CharacterIdMap.d.ts +0 -5
- package/core/common/Color.d.ts +0 -357
- package/core/common/ColorConverter.d.ts +0 -26
- package/core/common/ColorUtils.d.ts +0 -45
- package/core/common/Console.d.ts +0 -54
- package/core/common/Debouncer.d.ts +0 -8
- package/core/common/EventTarget.d.ts +0 -22
- package/core/common/Gzip.d.ts +0 -23
- package/core/common/JavaScriptMetaData.d.ts +0 -20
- package/core/common/Lazy.d.ts +0 -4
- package/core/common/MapWithDefault.d.ts +0 -9
- package/core/common/Mutex.d.ts +0 -13
- package/core/common/Object.d.ts +0 -20
- package/core/common/Progress.d.ts +0 -47
- package/core/common/ResolverBase.d.ts +0 -29
- package/core/common/ResourceType.d.ts +0 -52
- package/core/common/ReturnToPanel.d.ts +0 -10
- package/core/common/Revealer.d.ts +0 -66
- package/core/common/Runnable.d.ts +0 -14
- package/core/common/SegmentedRange.d.ts +0 -14
- package/core/common/SettingRegistration.d.ts +0 -136
- package/core/common/Settings.d.ts +0 -228
- package/core/common/SimpleHistoryManager.d.ts +0 -20
- package/core/common/Srcset.d.ts +0 -16
- package/core/common/StringOutputStream.d.ts +0 -10
- package/core/common/TextDictionary.d.ts +0 -11
- package/core/common/Throttler.d.ts +0 -12
- package/core/common/Trie.d.ts +0 -24
- package/core/common/VersionController.d.ts +0 -85
- package/core/host/AidaClient.d.ts +0 -73
- package/core/host/AidaClientTypes.d.ts +0 -355
- package/core/host/AidaGcaTranslation.d.ts +0 -10
- package/core/host/DispatchHttpRequestClient.d.ts +0 -14
- package/core/host/GcaClient.d.ts +0 -14
- package/core/host/GcaTypes.d.ts +0 -411
- package/core/host/GdpClient.d.ts +0 -84
- package/core/host/InspectorFrontendHost.d.ts +0 -29
- package/core/host/InspectorFrontendHostAPI.d.ts +0 -425
- package/core/host/InspectorFrontendHostStub.d.ts +0 -151
- package/core/host/Platform.d.ts +0 -16
- package/core/host/ResourceLoader.d.ts +0 -15
- package/core/host/UserMetrics.d.ts +0 -116
- package/core/host/UserMetricsEnums.d.ts +0 -888
- package/core/i18n/ByteUtilities.d.ts +0 -11
- package/core/i18n/DevToolsLocale.d.ts +0 -41
- package/core/i18n/NumberFormatter.d.ts +0 -11
- package/core/i18n/i18nImpl.d.ts +0 -64
- package/core/i18n/i18nTypes.d.ts +0 -5
- package/core/i18n/locales.d.ts +0 -15
- package/core/i18n/time-utilities.d.ts +0 -16
- package/core/platform/browser/HostRuntime.d.ts +0 -2
- package/core/platform/browser/browser.d.ts +0 -2
- package/core/platform/node/HostRuntime.d.ts +0 -2
- package/core/platform/node/node.d.ts +0 -2
- package/core/protocol_client/CDPConnection.d.ts +0 -77
- package/core/protocol_client/ConnectionTransport.d.ts +0 -9
- package/core/protocol_client/DevToolsCDPConnection.d.ts +0 -16
- package/core/protocol_client/InspectorBackend.d.ts +0 -223
- package/core/protocol_client/protocol_client.d.ts +0 -5
- package/core/root/DevToolsContext.d.ts +0 -34
- package/core/root/ExperimentNames.d.ts +0 -9
- package/core/root/Runtime.d.ts +0 -353
- package/core/sdk/AccessibilityModel.d.ts +0 -76
- package/core/sdk/AnimationModel.d.ts +0 -161
- package/core/sdk/AutofillModel.d.ts +0 -23
- package/core/sdk/CPUProfilerModel.d.ts +0 -46
- package/core/sdk/CPUThrottlingManager.d.ts +0 -47
- package/core/sdk/CSSContainerQuery.d.ts +0 -42
- package/core/sdk/CSSFontFace.d.ts +0 -10
- package/core/sdk/CSSLayer.d.ts +0 -9
- package/core/sdk/CSSLocation.d.ts +0 -14
- package/core/sdk/CSSMatchedStyles.d.ts +0 -138
- package/core/sdk/CSSMedia.d.ts +0 -36
- package/core/sdk/CSSMetadata.d.ts +0 -87
- package/core/sdk/CSSModel.d.ts +0 -185
- package/core/sdk/CSSNavigation.d.ts +0 -10
- package/core/sdk/CSSProperty.d.ts +0 -53
- package/core/sdk/CSSPropertyParser.d.ts +0 -126
- package/core/sdk/CSSPropertyParserMatchers.d.ts +0 -442
- package/core/sdk/CSSQuery.d.ts +0 -22
- package/core/sdk/CSSRule.d.ts +0 -132
- package/core/sdk/CSSScope.d.ts +0 -9
- package/core/sdk/CSSStartingStyle.d.ts +0 -9
- package/core/sdk/CSSStyleDeclaration.d.ts +0 -38
- package/core/sdk/CSSStyleSheetHeader.d.ts +0 -53
- package/core/sdk/CSSSupports.d.ts +0 -10
- package/core/sdk/CategorizedBreakpoint.d.ts +0 -42
- package/core/sdk/ChildTargetManager.d.ts +0 -40
- package/core/sdk/CompilerSourceMappingContentProvider.d.ts +0 -12
- package/core/sdk/Connections.d.ts +0 -36
- package/core/sdk/ConsoleModel.d.ts +0 -127
- package/core/sdk/ConsoleModelTypes.d.ts +0 -6
- package/core/sdk/Cookie.d.ts +0 -68
- package/core/sdk/CookieModel.d.ts +0 -31
- package/core/sdk/CookieParser.d.ts +0 -14
- package/core/sdk/CrashReportContextModel.d.ts +0 -8
- package/core/sdk/DOMDebuggerModel.d.ts +0 -127
- package/core/sdk/DOMModel.d.ts +0 -440
- package/core/sdk/DOMStorageModel.d.ts +0 -79
- package/core/sdk/DebuggerModel.d.ts +0 -305
- package/core/sdk/EmulationModel.d.ts +0 -95
- package/core/sdk/EnhancedTracesParser.d.ts +0 -105
- package/core/sdk/EventBreakpointsModel.d.ts +0 -66
- package/core/sdk/FrameAssociated.d.ts +0 -6
- package/core/sdk/FrameManager.d.ts +0 -68
- package/core/sdk/HeapProfilerModel.d.ts +0 -75
- package/core/sdk/HttpReasonPhraseStrings.d.ts +0 -5
- package/core/sdk/IOModel.d.ts +0 -10
- package/core/sdk/IsolateManager.d.ts +0 -53
- package/core/sdk/IssuesModel.d.ts +0 -28
- package/core/sdk/LayerTreeBase.d.ts +0 -70
- package/core/sdk/LogModel.d.ts +0 -20
- package/core/sdk/NetworkManager.d.ts +0 -418
- package/core/sdk/NetworkRequest.d.ts +0 -497
- package/core/sdk/NetworkRequestAccess.d.ts +0 -91
- package/core/sdk/OverlayColorGenerator.d.ts +0 -14
- package/core/sdk/OverlayModel.d.ts +0 -186
- package/core/sdk/OverlayPersistentHighlighter.d.ts +0 -116
- package/core/sdk/PageFunctions.d.ts +0 -22
- package/core/sdk/PageLoad.d.ts +0 -14
- package/core/sdk/PageResourceLoader.d.ts +0 -111
- package/core/sdk/PaintProfiler.d.ts +0 -43
- package/core/sdk/PerformanceMetricsModel.d.ts +0 -12
- package/core/sdk/PreloadingModel.d.ts +0 -146
- package/core/sdk/RehydratingConnection.d.ts +0 -73
- package/core/sdk/RehydratingObject.d.ts +0 -59
- package/core/sdk/RemoteObject.d.ts +0 -210
- package/core/sdk/Resource.d.ts +0 -36
- package/core/sdk/ResourceTreeModel.d.ts +0 -280
- package/core/sdk/RuntimeModel.d.ts +0 -164
- package/core/sdk/SDKModel.d.ts +0 -30
- package/core/sdk/SDKSettings.d.ts +0 -54
- package/core/sdk/ScopeTreeCache.d.ts +0 -21
- package/core/sdk/ScreenCaptureModel.d.ts +0 -69
- package/core/sdk/Script.d.ts +0 -134
- package/core/sdk/SecurityOrigin.d.ts +0 -108
- package/core/sdk/SecurityOriginManager.d.ts +0 -23
- package/core/sdk/ServerSentEvents.d.ts +0 -18
- package/core/sdk/ServerSentEventsProtocol.d.ts +0 -18
- package/core/sdk/ServerTiming.d.ts +0 -24
- package/core/sdk/ServiceWorkerCacheModel.d.ts +0 -71
- package/core/sdk/ServiceWorkerManager.d.ts +0 -125
- package/core/sdk/SourceMap.d.ts +0 -211
- package/core/sdk/SourceMapCache.d.ts +0 -12
- package/core/sdk/SourceMapFunctionRanges.d.ts +0 -23
- package/core/sdk/SourceMapManager.d.ts +0 -46
- package/core/sdk/SourceMapRangeMappings.d.ts +0 -15
- package/core/sdk/SourceMapScopeChainEntry.d.ts +0 -23
- package/core/sdk/SourceMapScopesInfo.d.ts +0 -184
- package/core/sdk/StorageBucketsModel.d.ts +0 -48
- package/core/sdk/StorageKeyManager.d.ts +0 -38
- package/core/sdk/Target.d.ts +0 -79
- package/core/sdk/TargetManager.d.ts +0 -92
- package/core/sdk/TraceObject.d.ts +0 -43
- package/core/sdk/WebAuthnModel.d.ts +0 -29
- package/core/text_utils/CodeMirrorUtils.d.ts +0 -3
- package/core/text_utils/ContentData.d.ts +0 -94
- package/core/text_utils/ContentProvider.d.ts +0 -42
- package/core/text_utils/Markdown.d.ts +0 -13
- package/core/text_utils/StaticContentProvider.d.ts +0 -13
- package/core/text_utils/StreamingContentData.d.ts +0 -49
- package/core/text_utils/Text.d.ts +0 -19
- package/core/text_utils/TextCursor.d.ts +0 -9
- package/core/text_utils/TextRange.d.ts +0 -81
- package/core/text_utils/TextUtils.d.ts +0 -97
- package/core/text_utils/WasmDisassembly.d.ts +0 -29
- package/core/text_utils/text_utils.d.ts +0 -12
- package/entrypoints/formatter_actions/formatter_actions.d.ts +0 -65
- package/generated/InspectorBackendCommands.d.ts +0 -14
- package/generated/SupportedCSSProperties.d.ts +0 -18
- package/generated/protocol-mapping.d.ts +0 -5985
- package/generated/protocol-proxy-api.d.ts +0 -5447
- package/index.d.ts +0 -2
- package/index.js +0 -6
- package/models/crux-manager/CrUXManager.d.ts +0 -107
- package/models/emulation/DeviceModeModel.d.ts +0 -157
- package/models/emulation/EmulatedDevices.d.ts +0 -148
- package/models/emulation/emulation.d.ts +0 -3
- package/models/formatter/FormatterWorkerPool.d.ts +0 -58
- package/models/formatter/ScriptFormatter.d.ts +0 -11
- package/models/formatter/formatter.d.ts +0 -3
- package/third_party/codemirror.next/codemirror.next.d.ts +0 -9196
- package/third_party/i18n/i18n-impl.d.ts +0 -25
- package/third_party/i18n/i18n.d.ts +0 -3
- package/third_party/i18n/localized-string-set.d.ts +0 -49
- package/third_party/intl-messageformat/intl-messageformat.d.ts +0 -1
- package/third_party/marked/package/lib/marked.esm.d.ts +0 -760
- package/third_party/source-map-scopes-codec/package/src/builder/builder.d.ts +0 -70
- package/third_party/source-map-scopes-codec/package/src/builder/safe_builder.d.ts +0 -40
- package/third_party/source-map-scopes-codec/package/src/codec.d.ts +0 -49
- package/third_party/source-map-scopes-codec/package/src/decode/decode.d.ts +0 -33
- package/third_party/source-map-scopes-codec/package/src/encode/encode.d.ts +0 -8
- package/third_party/source-map-scopes-codec/package/src/encode/encoder.d.ts +0 -9
- package/third_party/source-map-scopes-codec/package/src/mod.d.ts +0 -5
- package/third_party/source-map-scopes-codec/package/src/scopes.d.ts +0 -169
- package/third_party/source-map-scopes-codec/package/src/util.d.ts +0 -5
- package/third_party/source-map-scopes-codec/package/src/vlq.d.ts +0 -14
- package/third_party/source-map-scopes-codec/source-map-scopes-codec.d.ts +0 -1
- package/third_party/third-party-web/lib/nostats-subset.d.ts +0 -2
- package/third_party/third-party-web/package/lib/index.d.ts +0 -34
- package/third_party/third-party-web/package/lib/subsets/nostats.d.ts +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScriptsHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/ScriptsHandler.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAG/D,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,IAAI,IAAI,eAAe,EAAuB,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAC,IAAI,IAAI,0BAA0B,EAAC,MAAM,6BAA6B,CAAC;AAkC/E,IAAI,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;AAC3C,IAAI,gBAAgB,GAAG,IAAI,GAAG,EAAyB,CAAC;AAExD,MAAM,UAAU,IAAI;IAClB,OAAO,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,KAAK;IACnB,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;IACvB,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAyB;IACnD,MAAM,eAAe,GAAG,CAAC,OAAsB,EAAE,gBAAwB,EAAU,EAAE;QACnF,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAA8B,CAAC;QACvE,MAAM,GAAG,GAAG,GAAG,OAAO,IAAI,QAAQ,EAAE,CAAC;QACrC,OAAO,QAAQ,CAAC,YAAY,CAAC,cAAc,CACvC,UAAU,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAY,CAAA,CAA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,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,IAAI;IAClB,OAAO;QACL,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC;KAClC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright 2025 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../../core/common/common.js';\nimport * 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 * as Types from '../types/types.js';\n\nimport {data as metaHandlerData, type MetaHandlerData} from './MetaHandler.js';\nimport {data as networkRequestsHandlerData} from './NetworkRequestsHandler.js';\nimport type {FinalizeOptions, HandlerName} from './types.js';\n\nexport interface ScriptsData {\n /** Note: this is only populated when the \"Enhanced Traces\" feature is enabled. */\n scripts: Script[];\n}\n\nexport interface Script {\n isolate: string|number;\n scriptId: Protocol.Runtime.ScriptId;\n frame: string;\n ts: Types.Timing.Micro;\n inline: boolean;\n url?: string;\n sourceUrl?: string;\n content?: string;\n /**\n * Note: this is the literal text given as the sourceMappingURL value. It has not been resolved relative to the script url.\n * Since M138, data urls are never set here.\n */\n sourceMapUrl?: string;\n /** If true, the source map url was a data URL, so it got removed from the trace event. */\n sourceMapUrlElided?: boolean;\n sourceMap?: SDK.SourceMap.SourceMap;\n request?: Types.Events.SyntheticNetworkRequest;\n /** Lazily generated - use getScriptGeneratedSizes to access. */\n sizes?: GeneratedFileSizes;\n}\n\ntype GeneratedFileSizes = {\n errorMessage: string,\n}|{files: Record<string, number>, unmappedBytes: number, totalBytes: number};\n\nlet scriptById = new Map<string, Script>();\nlet frameIdByIsolate = new Map<string|number, string>();\n\nexport function deps(): HandlerName[] {\n return ['Meta', 'NetworkRequests'];\n}\n\nexport function reset(): void {\n scriptById = new Map();\n frameIdByIsolate = new Map();\n}\n\nexport function handleEvent(event: Types.Events.Event): void {\n const getOrMakeScript = (isolate: string|number, scriptIdAsNumber: number): Script => {\n const scriptId = String(scriptIdAsNumber) as Protocol.Runtime.ScriptId;\n const key = `${isolate}.${scriptId}`;\n return Platform.MapUtilities.getWithDefault(\n scriptById, key, () => ({isolate, scriptId, frame: '', ts: event.ts} as Script));\n };\n\n if (Types.Events.isRundownScriptCompiled(event) && event.args.data) {\n const {isolate, scriptId, frame} = event.args.data;\n const script = getOrMakeScript(isolate, scriptId);\n script.frame = frame;\n script.ts = event.ts;\n\n return;\n }\n\n if (Types.Events.isRundownScript(event)) {\n const {isolate, scriptId, url, sourceUrl, sourceMapUrl, sourceMapUrlElided} = event.args.data;\n const script = getOrMakeScript(isolate, scriptId);\n if (!script.frame) {\n script.frame = frameIdByIsolate.get(String(isolate)) ?? '';\n }\n script.url = url;\n script.ts = event.ts;\n if (sourceUrl) {\n script.sourceUrl = sourceUrl;\n }\n\n // Older traces may have data source map urls. Those can be very large, so a change\n // was made to elide them from the trace.\n // If elided, a fresh trace will fetch the source map from the Script model\n // (see TimelinePanel getExistingSourceMap). If not fresh, the source map is resolved\n // instead in this handler via `findCachedRawSourceMap`.\n if (sourceMapUrlElided) {\n script.sourceMapUrlElided = true;\n } else if (sourceMapUrl) {\n script.sourceMapUrl = sourceMapUrl;\n }\n return;\n }\n\n if (Types.Events.isRundownScriptSource(event)) {\n const {isolate, scriptId, sourceText} = event.args.data;\n const script = getOrMakeScript(isolate, scriptId);\n script.content = sourceText;\n return;\n }\n\n if (Types.Events.isRundownScriptSourceLarge(event)) {\n const {isolate, scriptId, sourceText} = event.args.data;\n const script = getOrMakeScript(isolate, scriptId);\n script.content = (script.content ?? '') + sourceText;\n return;\n }\n\n // Setup frameIdByIsolate, which is used only in the case that we are missing\n // rundown events for a script. We won't get a frame association from the rundown\n // events if the recording started only after the script was first compiled. In\n // that scenario, derive the frame via the isolate / FunctionCall events.\n // TODO: ideally, we put the frame on ScriptCatchup event. So much easier. This approach has some\n // issues.\n if (Types.Events.isFunctionCall(event) && event.args.data?.isolate && event.args.data.frame) {\n const {isolate, frame} = event.args.data;\n const existingValue = frameIdByIsolate.get(isolate);\n if (existingValue !== frame) {\n frameIdByIsolate.set(isolate, frame);\n\n // Update the scripts we discovered but without knowing their frame.\n for (const script of scriptById.values()) {\n if (!script.frame && script.isolate === isolate) {\n script.frame = frame;\n }\n }\n }\n }\n}\n\nfunction findFrame(meta: MetaHandlerData, frameId: string): Types.Events.TraceFrame|null {\n for (const frames of meta.frameByProcessId?.values()) {\n const frame = frames.get(frameId);\n if (frame) {\n return frame;\n }\n }\n\n return null;\n}\n\nfunction findNetworkRequest(networkRequests: Types.Events.SyntheticNetworkRequest[], script: Script):\n Types.Events.SyntheticNetworkRequest|null {\n if (!script.url) {\n return null;\n }\n\n return networkRequests.find(request => request.args.data.url === script.url) ?? null;\n}\n\nfunction computeMappingEndColumns(map: SDK.SourceMap.SourceMap): Map<SDK.SourceMap.SourceMapEntry, number> {\n const result = new Map<SDK.SourceMap.SourceMapEntry, number>();\n\n const mappings = map.mappings();\n for (let i = 0; i < mappings.length - 1; i++) {\n const mapping = mappings[i];\n const nextMapping = mappings[i + 1];\n if (mapping.lineNumber === nextMapping.lineNumber) {\n result.set(mapping, nextMapping.columnNumber);\n }\n }\n\n // Now, all but the last mapping on each line will have a value in this map.\n return result;\n}\n\n/**\n * Using a script's contents and source map, attribute every generated byte to an authored source file.\n */\nfunction computeGeneratedFileSizes(script: Script): GeneratedFileSizes {\n if (!script.sourceMap) {\n throw new Error('expected source map');\n }\n\n const map = script.sourceMap;\n const content = script.content ?? '';\n const contentLength = content.length;\n const lines = content.split('\\n');\n const files: Record<string, number> = {};\n const totalBytes = contentLength;\n let unmappedBytes = totalBytes;\n\n const mappingEndCols = computeMappingEndColumns(script.sourceMap);\n\n for (const mapping of map.mappings()) {\n const source = mapping.sourceURL;\n const lineNum = mapping.lineNumber;\n const colNum = mapping.columnNumber;\n const lastColNum = mappingEndCols.get(mapping);\n\n // Webpack sometimes emits null mappings.\n // https://github.com/mozilla/source-map/pull/303\n if (!source) {\n continue;\n }\n\n // Lines and columns are zero-based indices. Visually, lines are shown as a 1-based index.\n\n const line = lines[lineNum];\n if (line === null || line === undefined) {\n const errorMessage = `${map.url()} mapping for line out of bounds: ${lineNum + 1}`;\n return {errorMessage};\n }\n\n if (colNum > line.length) {\n const errorMessage = `${map.url()} mapping for column out of bounds: ${lineNum + 1}:${colNum}`;\n return {errorMessage};\n }\n\n let mappingLength = 0;\n if (lastColNum !== undefined) {\n if (lastColNum > line.length) {\n const errorMessage = `${map.url()} mapping for last column out of bounds: ${lineNum + 1}:${lastColNum}`;\n return {errorMessage};\n }\n mappingLength = lastColNum - colNum;\n } else {\n // Add +1 to account for the newline.\n mappingLength = line.length - colNum + 1;\n }\n files[source] = (files[source] || 0) + mappingLength;\n unmappedBytes -= mappingLength;\n }\n\n return {\n files,\n unmappedBytes,\n totalBytes,\n };\n}\n\nexport function getScriptGeneratedSizes(script: Script): GeneratedFileSizes|null {\n if (script.sourceMap && !script.sizes) {\n script.sizes = computeGeneratedFileSizes(script);\n }\n\n return script.sizes ?? null;\n}\n\nfunction findCachedRawSourceMap(script: Script, options: Types.Configuration.ParseOptions): SDK.SourceMap.SourceMapV3|\n undefined {\n if (options.isFreshRecording || !options.metadata?.sourceMaps) {\n // Exit if this is not a loaded trace w/ source maps in the metadata.\n return;\n }\n\n // For elided data url source maps, search the metadata source maps by script url.\n if (script.sourceMapUrlElided) {\n if (!script.url) {\n return;\n }\n\n const cachedSourceMap = options.metadata.sourceMaps.find(m => m.url === script.url);\n if (cachedSourceMap) {\n return cachedSourceMap.sourceMap;\n }\n\n return;\n }\n\n if (!script.sourceMapUrl) {\n return;\n }\n\n // Otherwise, search by source map url.\n // Note: early enhanced traces may have this field set for data urls. Ignore those,\n // as they were never stored in metadata sourcemap.\n const isDataUrl = script.sourceMapUrl.startsWith('data:');\n if (!isDataUrl) {\n const cachedSourceMap = options.metadata.sourceMaps.find(m => m.sourceMapUrl === script.sourceMapUrl);\n if (cachedSourceMap) {\n return cachedSourceMap.sourceMap;\n }\n }\n\n return;\n}\n\nexport async function finalize(options: FinalizeOptions): Promise<void> {\n const meta = metaHandlerData();\n const networkRequests = [...networkRequestsHandlerData().byId.values()];\n\n const documentUrls = new Set<string>();\n for (const frames of meta.frameByProcessId.values()) {\n for (const frame of frames.values()) {\n documentUrls.add(frame.url);\n }\n }\n\n for (const script of scriptById.values()) {\n script.request = findNetworkRequest(networkRequests, script) ?? undefined;\n script.inline = !!script.url && documentUrls.has(script.url);\n }\n\n if (!options.resolveSourceMap) {\n return;\n }\n\n const promises = [];\n for (const script of scriptById.values()) {\n // No frame or url means the script came from somewhere we don't care about.\n // Note: scripts from inline <SCRIPT> elements use the url of the HTML document,\n // so aren't ignored.\n if (!script.frame || !script.url || (!script.sourceMapUrl && !script.sourceMapUrlElided)) {\n continue;\n }\n\n const frameUrl = findFrame(meta, script.frame)?.url as Platform.DevToolsPath.UrlString | undefined;\n if (!frameUrl) {\n continue;\n }\n\n // If there is a `sourceURL` magic comment, resolve the compiledUrl against the frame url.\n // example: `// #sourceURL=foo.js` for target frame https://www.example.com/home -> https://www.example.com/home/foo.js\n let sourceUrl = script.url;\n if (script.sourceUrl) {\n sourceUrl = Common.ParsedURL.ParsedURL.completeURL(frameUrl, script.sourceUrl) ?? script.sourceUrl;\n }\n\n let sourceMapUrl;\n if (script.sourceMapUrl) {\n // Resolve the source map url. The value given by v8 may be relative, so resolve it here.\n // This process should match the one in `SourceMapManager.attachSourceMap`.\n sourceMapUrl =\n Common.ParsedURL.ParsedURL.completeURL(sourceUrl as Platform.DevToolsPath.UrlString, script.sourceMapUrl);\n if (!sourceMapUrl) {\n continue;\n }\n\n script.sourceMapUrl = sourceMapUrl;\n }\n\n const params: Types.Configuration.ResolveSourceMapParams = {\n scriptId: script.scriptId,\n scriptUrl: script.url as Platform.DevToolsPath.UrlString,\n sourceUrl: sourceUrl as Platform.DevToolsPath.UrlString,\n sourceMapUrl: sourceMapUrl ?? '' as Platform.DevToolsPath.UrlString,\n frame: script.frame as Protocol.Page.FrameId,\n cachedRawSourceMap: findCachedRawSourceMap(script, options),\n };\n const promise = options.resolveSourceMap(params).then(sourceMap => {\n if (sourceMap) {\n script.sourceMap = sourceMap;\n }\n });\n promises.push(promise.catch(e => {\n console.error('Uncaught error when resolving source map', params, e);\n }));\n }\n await Promise.all(promises);\n}\n\nexport function data(): ScriptsData {\n return {\n scripts: [...scriptById.values()],\n };\n}\n"]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// Copyright 2024 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
import * as Types from '../types/types.js';
|
|
5
|
+
let lastRecalcStyleEvent = null;
|
|
6
|
+
let lastInvalidatedNode = null;
|
|
7
|
+
let selectorDataForRecalcStyle = new Map();
|
|
8
|
+
let invalidatedNodeList = new Array();
|
|
9
|
+
export function reset() {
|
|
10
|
+
lastRecalcStyleEvent = null;
|
|
11
|
+
lastInvalidatedNode = null;
|
|
12
|
+
selectorDataForRecalcStyle = new Map();
|
|
13
|
+
invalidatedNodeList = [];
|
|
14
|
+
}
|
|
15
|
+
export function handleEvent(event) {
|
|
16
|
+
if (Types.Events.isStyleRecalcInvalidationTracking(event)) {
|
|
17
|
+
/**
|
|
18
|
+
* CSS Style substree invalidation
|
|
19
|
+
* A subtree invalidation comes with two records, 1) a StyleInvalidatorInvalidationTracking
|
|
20
|
+
* event 2) following with a StyleRecalcInvalidationTracking event. List of selectors and style
|
|
21
|
+
* sheet ID information is stored in the 1st event. Subtree flag is stored in the 2nd
|
|
22
|
+
* event.
|
|
23
|
+
*/
|
|
24
|
+
if (event.args.data.subtree &&
|
|
25
|
+
event.args.data.reason === Types.Events.StyleRecalcInvalidationReason.RELATED_STYLE_RULE &&
|
|
26
|
+
lastInvalidatedNode && event.args.data.nodeId === lastInvalidatedNode.backendNodeId) {
|
|
27
|
+
lastInvalidatedNode.subtree = true;
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (Types.Events.isSelectorStats(event) && lastRecalcStyleEvent && event.args.selector_stats) {
|
|
32
|
+
selectorDataForRecalcStyle.set(lastRecalcStyleEvent, {
|
|
33
|
+
timings: event.args.selector_stats.selector_timings,
|
|
34
|
+
});
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (Types.Events.isStyleInvalidatorInvalidationTracking(event)) {
|
|
38
|
+
const selectorList = new Array();
|
|
39
|
+
event.args.data.selectors?.forEach(selector => {
|
|
40
|
+
selectorList.push({
|
|
41
|
+
selector: selector.selector,
|
|
42
|
+
styleSheetId: selector.style_sheet_id,
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
if (selectorList.length > 0) {
|
|
46
|
+
lastInvalidatedNode = {
|
|
47
|
+
frame: event.args.data.frame,
|
|
48
|
+
backendNodeId: event.args.data.nodeId,
|
|
49
|
+
type: Types.Events.InvalidationEventType.StyleInvalidatorInvalidationTracking,
|
|
50
|
+
selectorList,
|
|
51
|
+
ts: event.ts,
|
|
52
|
+
tts: event.tts,
|
|
53
|
+
subtree: false,
|
|
54
|
+
lastRecalcStyleEventTs: lastRecalcStyleEvent ? lastRecalcStyleEvent.ts : Types.Timing.Micro(0),
|
|
55
|
+
};
|
|
56
|
+
invalidatedNodeList.push(lastInvalidatedNode);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (Types.Events.isRecalcStyle(event)) {
|
|
60
|
+
lastRecalcStyleEvent = event;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export async function finalize() {
|
|
65
|
+
}
|
|
66
|
+
export function data() {
|
|
67
|
+
return {
|
|
68
|
+
dataForRecalcStyleEvent: selectorDataForRecalcStyle,
|
|
69
|
+
invalidatedNodeList,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=SelectorStatsHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectorStatsHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/SelectorStatsHandler.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAmB3C,IAAI,oBAAoB,GAAkC,IAAI,CAAC;AAC/D,IAAI,mBAAmB,GAAyB,IAAI,CAAC;AAErD,IAAI,0BAA0B,GAAG,IAAI,GAAG,EAEpC,CAAC;AAEL,IAAI,mBAAmB,GAAG,IAAI,KAAK,EAAmB,CAAC;AAEvD,MAAM,UAAU,KAAK;IACnB,oBAAoB,GAAG,IAAI,CAAC;IAC5B,mBAAmB,GAAG,IAAI,CAAC;IAC3B,0BAA0B,GAAG,IAAI,GAAG,EAAE,CAAC;IACvC,mBAAmB,GAAG,EAAE,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAyB;IACnD,IAAI,KAAK,CAAC,MAAM,CAAC,iCAAiC,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1D;;;;;;WAMG;QACH,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO;YACvB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,CAAC,6BAA6B,CAAC,kBAAkB;YACxF,mBAAmB,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC,aAAa,EAAE,CAAC;YACxF,mBAAmB,CAAC,OAAO,GAAG,IAAI,CAAC;YACnC,OAAO;QACT,CAAC;IACH,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,oBAAoB,IAAI,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;QAC7F,0BAA0B,CAAC,GAAG,CAAC,oBAAoB,EAAE;YACnD,OAAO,EAAE,KAA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AASD,MAAM,UAAU,IAAI;IAClB,OAAO;QACL,uBAAuB,EAAE,0BAA0B;QACnD,mBAAmB;KACpB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors\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 Protocol from '../../../generated/protocol.js';\nimport * as Types from '../types/types.js';\n\ninterface SelectorWithStyleSheedId {\n selector: string;\n styleSheetId: string;\n}\n\ninterface InvalidatedNode {\n frame: string;\n backendNodeId: Protocol.DOM.BackendNodeId;\n type: Types.Events.InvalidationEventType;\n selectorList: SelectorWithStyleSheedId[];\n ts: Types.Timing.Micro;\n tts?: Types.Timing.Micro;\n subtree:\n boolean; // Indicates if the invalidation applies solely to the node (false) or extends to all its descendants (true)\n lastRecalcStyleEventTs: Types.Timing.Micro;\n}\n\nlet lastRecalcStyleEvent: Types.Events.RecalcStyle|null = null;\nlet lastInvalidatedNode: InvalidatedNode|null = null;\n\nlet selectorDataForRecalcStyle = new Map<Types.Events.RecalcStyle, {\n timings: Types.Events.SelectorTiming[],\n}>();\n\nlet invalidatedNodeList = new Array<InvalidatedNode>();\n\nexport function reset(): void {\n lastRecalcStyleEvent = null;\n lastInvalidatedNode = null;\n selectorDataForRecalcStyle = new Map();\n invalidatedNodeList = [];\n}\n\nexport function handleEvent(event: Types.Events.Event): void {\n if (Types.Events.isStyleRecalcInvalidationTracking(event)) {\n /**\n * CSS Style substree invalidation\n * A subtree invalidation comes with two records, 1) a StyleInvalidatorInvalidationTracking\n * event 2) following with a StyleRecalcInvalidationTracking event. List of selectors and style\n * sheet ID information is stored in the 1st event. Subtree flag is stored in the 2nd\n * event.\n */\n if (event.args.data.subtree &&\n event.args.data.reason === Types.Events.StyleRecalcInvalidationReason.RELATED_STYLE_RULE &&\n lastInvalidatedNode && event.args.data.nodeId === lastInvalidatedNode.backendNodeId) {\n lastInvalidatedNode.subtree = true;\n return;\n }\n }\n\n if (Types.Events.isSelectorStats(event) && lastRecalcStyleEvent && event.args.selector_stats) {\n selectorDataForRecalcStyle.set(lastRecalcStyleEvent, {\n timings: event.args.selector_stats.selector_timings,\n });\n return;\n }\n\n if (Types.Events.isStyleInvalidatorInvalidationTracking(event)) {\n const selectorList = new Array<SelectorWithStyleSheedId>();\n event.args.data.selectors?.forEach(selector => {\n selectorList.push({\n selector: selector.selector,\n styleSheetId: selector.style_sheet_id,\n });\n });\n\n if (selectorList.length > 0) {\n lastInvalidatedNode = {\n frame: event.args.data.frame,\n backendNodeId: event.args.data.nodeId,\n type: Types.Events.InvalidationEventType.StyleInvalidatorInvalidationTracking,\n selectorList,\n ts: event.ts,\n tts: event.tts,\n subtree: false,\n lastRecalcStyleEventTs: lastRecalcStyleEvent ? lastRecalcStyleEvent.ts : Types.Timing.Micro(0),\n };\n invalidatedNodeList.push(lastInvalidatedNode);\n }\n }\n\n if (Types.Events.isRecalcStyle(event)) {\n lastRecalcStyleEvent = event;\n return;\n }\n}\n\nexport async function finalize(): Promise<void> {\n}\n\nexport interface SelectorStatsData {\n dataForRecalcStyleEvent: Map<Types.Events.RecalcStyle, {\n timings: Types.Events.SelectorTiming[],\n }>;\n invalidatedNodeList: InvalidatedNode[];\n}\n\nexport function data(): SelectorStatsData {\n return {\n dataForRecalcStyleEvent: selectorDataForRecalcStyle,\n invalidatedNodeList,\n };\n}\n"]}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export var ThreadType;
|
|
2
|
+
(function (ThreadType) {
|
|
3
|
+
ThreadType["MAIN_THREAD"] = "MAIN_THREAD";
|
|
4
|
+
ThreadType["WORKER"] = "WORKER";
|
|
5
|
+
ThreadType["RASTERIZER"] = "RASTERIZER";
|
|
6
|
+
ThreadType["OTHER"] = "OTHER";
|
|
7
|
+
ThreadType["CPU_PROFILE"] = "CPU_PROFILE";
|
|
8
|
+
ThreadType["THREAD_POOL"] = "THREAD_POOL";
|
|
9
|
+
})(ThreadType || (ThreadType = {}));
|
|
10
|
+
function getThreadTypeForRendererThread(pid, thread) {
|
|
11
|
+
let threadType = ThreadType.OTHER;
|
|
12
|
+
if (thread.name === 'CrRendererMain') {
|
|
13
|
+
threadType = ThreadType.MAIN_THREAD;
|
|
14
|
+
}
|
|
15
|
+
else if (thread.name === 'DedicatedWorker thread') {
|
|
16
|
+
threadType = ThreadType.WORKER;
|
|
17
|
+
}
|
|
18
|
+
else if (thread.name?.startsWith('CompositorTileWorker')) {
|
|
19
|
+
threadType = ThreadType.RASTERIZER;
|
|
20
|
+
}
|
|
21
|
+
else if (thread.name?.startsWith('ThreadPool')) {
|
|
22
|
+
// TODO(paulirish): perhaps exclude ThreadPoolServiceThread entirely
|
|
23
|
+
threadType = ThreadType.THREAD_POOL;
|
|
24
|
+
}
|
|
25
|
+
return threadType;
|
|
26
|
+
}
|
|
27
|
+
export function threadsInRenderer(rendererData) {
|
|
28
|
+
const foundThreads = [];
|
|
29
|
+
// If we have Renderer threads, we prefer to use those. In the event that a
|
|
30
|
+
// trace is a CPU Profile trace, we will never have Renderer threads, so we
|
|
31
|
+
// know if there are no Renderer threads that we can fallback to using the
|
|
32
|
+
// data from the SamplesHandler.
|
|
33
|
+
if (rendererData.processes.size) {
|
|
34
|
+
for (const [pid, process] of rendererData.processes) {
|
|
35
|
+
for (const [tid, thread] of process.threads) {
|
|
36
|
+
if (!thread.tree) {
|
|
37
|
+
// Drop threads where we could not create the tree; this indicates
|
|
38
|
+
// unexpected data and we won't be able to support all the UI
|
|
39
|
+
// filtering we need.
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const threadType = getThreadTypeForRendererThread(pid, thread);
|
|
43
|
+
foundThreads.push({
|
|
44
|
+
name: thread.name,
|
|
45
|
+
pid,
|
|
46
|
+
tid,
|
|
47
|
+
processIsOnMainFrame: process.isOnMainFrame,
|
|
48
|
+
entries: thread.entries,
|
|
49
|
+
tree: thread.tree,
|
|
50
|
+
type: threadType,
|
|
51
|
+
entryToNode: rendererData.entryToNode,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return foundThreads;
|
|
57
|
+
}
|
|
58
|
+
const threadsInHandlerDataCache = new WeakMap();
|
|
59
|
+
/**
|
|
60
|
+
* Given trace parsed data, this helper will return a high level array of
|
|
61
|
+
* ThreadData. This is useful because it allows you to get a list of threads
|
|
62
|
+
* regardless of if the trace is a CPU Profile or a Tracing profile. Thus you
|
|
63
|
+
* can use this helper to iterate over threads in confidence that it will work
|
|
64
|
+
* for both trace types.
|
|
65
|
+
* The resulting data is cached per-trace, so you can safely call this multiple times.
|
|
66
|
+
*/
|
|
67
|
+
export function threadsInTrace(handlerData) {
|
|
68
|
+
const cached = threadsInHandlerDataCache.get(handlerData);
|
|
69
|
+
if (cached) {
|
|
70
|
+
return cached;
|
|
71
|
+
}
|
|
72
|
+
// If we have Renderer threads, we prefer to use those.
|
|
73
|
+
const threadsFromRenderer = threadsInRenderer(handlerData.Renderer);
|
|
74
|
+
if (threadsFromRenderer.length) {
|
|
75
|
+
threadsInHandlerDataCache.set(handlerData, threadsFromRenderer);
|
|
76
|
+
return threadsFromRenderer;
|
|
77
|
+
}
|
|
78
|
+
// If it's a CPU Profile trace, there will be no Renderer threads.
|
|
79
|
+
// We can fallback to using the data from the SamplesHandler.
|
|
80
|
+
const foundThreads = [];
|
|
81
|
+
if (handlerData.Samples.profilesInProcess.size) {
|
|
82
|
+
for (const [pid, process] of handlerData.Samples.profilesInProcess) {
|
|
83
|
+
for (const [tid, thread] of process) {
|
|
84
|
+
if (!thread.profileTree) {
|
|
85
|
+
// Drop threads where we could not create the tree; this indicates
|
|
86
|
+
// unexpected data and we won't be able to support all the UI
|
|
87
|
+
// filtering we need.
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
foundThreads.push({
|
|
91
|
+
pid,
|
|
92
|
+
tid,
|
|
93
|
+
// CPU Profile threads do not have a name.
|
|
94
|
+
name: null,
|
|
95
|
+
entries: thread.profileCalls,
|
|
96
|
+
// There is no concept of a "Main Frame" in a CPU profile.
|
|
97
|
+
processIsOnMainFrame: false,
|
|
98
|
+
tree: thread.profileTree,
|
|
99
|
+
type: ThreadType.CPU_PROFILE,
|
|
100
|
+
entryToNode: handlerData.Samples.entryToNode,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
threadsInHandlerDataCache.set(handlerData, foundThreads);
|
|
106
|
+
return foundThreads;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=Threads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Threads.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/Threads.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAN,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,yCAA2B,CAAA;IAC3B,+BAAiB,CAAA;IACjB,uCAAyB,CAAA;IACzB,6BAAe,CAAA;IACf,yCAA2B,CAAA;IAC3B,yCAA2B,CAAA;AAC7B,CAAC,EAPW,UAAU,KAAV,UAAU,QAOrB;AAED,SAAS,8BAA8B,CAAC,GAA2B,EAAE,MAA+B;IAClG,IAAI,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC;IAClC,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;QACrC,UAAU,GAAG,UAAU,CAAC,WAAW,CAAC;IACtC,CAAC;SAAM,IAAI,MAAM,CAAC,IAAI,KAAK,wBAAwB,EAAE,CAAC;QACpD,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC;IACjC,CAAC;SAAM,IAAI,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,sBAAsB,CAAC,EAAE,CAAC;QAC3D,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;IACrC,CAAC;SAAM,IAAI,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACjD,oEAAoE;QACpE,UAAU,GAAG,UAAU,CAAC,WAAW,CAAC;IACt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AAG,iBAAiB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACpE,IAAI,mBAAmB,CAAC,MAAM,EAAE,CAAC;QAC/B,yBAAyB,CAAC,GAAG,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;QAChE,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED,kEAAkE;IAClE,6DAA6D;IAC7D,MAAM,YAAY,GAAiB,EAAE,CAAC;IACtC,IAAI,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAC/C,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;YACnE,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;gBACpC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;oBACxB,kEAAkE;oBAClE,6DAA6D;oBAC7D,qBAAqB;oBACrB,SAAS;gBACX,CAAC;gBAED,YAAY,CAAC,IAAI,CAAC;oBAChB,GAAG;oBACH,GAAG;oBACH,0CAA0C;oBAC1C,IAAI,EAAE,IAAI;oBACV,OAAO,EAAE,MAAM,CAAC,YAAY;oBAC5B,0DAA0D;oBAC1D,oBAAoB,EAAE,KAAK;oBAC3B,IAAI,EAAE,MAAM,CAAC,WAAW;oBACxB,IAAI,EAAE,UAAU,CAAC,WAAW;oBAC5B,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,WAAW;iBAC7C,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,yBAAyB,CAAC,GAAG,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IACzD,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors\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 Helpers from '../helpers/helpers.js';\nimport type * as Types from '../types/types.js';\n\nimport type * as Renderer from './RendererHandler.js';\nimport type {HandlerData} from './types.js';\n\nexport interface ThreadData {\n pid: Types.Events.ProcessID;\n tid: Types.Events.ThreadID;\n entries: readonly Types.Events.Event[];\n processIsOnMainFrame: boolean;\n tree: Helpers.TreeHelpers.TraceEntryTree;\n type: ThreadType;\n name: string|null;\n entryToNode: Map<Types.Events.Event, Helpers.TreeHelpers.TraceEntryNode>;\n}\n\nexport enum ThreadType {\n MAIN_THREAD = 'MAIN_THREAD',\n WORKER = 'WORKER',\n RASTERIZER = 'RASTERIZER',\n OTHER = 'OTHER',\n CPU_PROFILE = 'CPU_PROFILE',\n THREAD_POOL = 'THREAD_POOL',\n}\n\nfunction getThreadTypeForRendererThread(pid: Types.Events.ProcessID, thread: Renderer.RendererThread): ThreadType {\n let threadType = ThreadType.OTHER;\n if (thread.name === 'CrRendererMain') {\n threadType = ThreadType.MAIN_THREAD;\n } else if (thread.name === 'DedicatedWorker thread') {\n threadType = ThreadType.WORKER;\n } else if (thread.name?.startsWith('CompositorTileWorker')) {\n threadType = ThreadType.RASTERIZER;\n } else if (thread.name?.startsWith('ThreadPool')) {\n // TODO(paulirish): perhaps exclude ThreadPoolServiceThread entirely\n threadType = ThreadType.THREAD_POOL;\n }\n return threadType;\n}\n\nexport function threadsInRenderer(rendererData: Renderer.RendererHandlerData): readonly ThreadData[] {\n const foundThreads: ThreadData[] = [];\n // If we have Renderer threads, we prefer to use those. In the event that a\n // trace is a CPU Profile trace, we will never have Renderer threads, so we\n // know if there are no Renderer threads that we can fallback to using the\n // data from the SamplesHandler.\n if (rendererData.processes.size) {\n for (const [pid, process] of rendererData.processes) {\n for (const [tid, thread] of process.threads) {\n if (!thread.tree) {\n // Drop threads where we could not create the tree; this indicates\n // unexpected data and we won't be able to support all the UI\n // filtering we need.\n continue;\n }\n const threadType = getThreadTypeForRendererThread(pid, thread);\n foundThreads.push({\n name: thread.name,\n pid,\n tid,\n processIsOnMainFrame: process.isOnMainFrame,\n entries: thread.entries,\n tree: thread.tree,\n type: threadType,\n entryToNode: rendererData.entryToNode,\n });\n }\n }\n }\n return foundThreads;\n}\n\nconst threadsInHandlerDataCache = new WeakMap<HandlerData, readonly ThreadData[]>();\n\n/**\n * Given trace parsed data, this helper will return a high level array of\n * ThreadData. This is useful because it allows you to get a list of threads\n * regardless of if the trace is a CPU Profile or a Tracing profile. Thus you\n * can use this helper to iterate over threads in confidence that it will work\n * for both trace types.\n * The resulting data is cached per-trace, so you can safely call this multiple times.\n */\nexport function threadsInTrace(handlerData: HandlerData): readonly ThreadData[] {\n const cached = threadsInHandlerDataCache.get(handlerData);\n if (cached) {\n return cached;\n }\n\n // If we have Renderer threads, we prefer to use those.\n const threadsFromRenderer = threadsInRenderer(handlerData.Renderer);\n if (threadsFromRenderer.length) {\n threadsInHandlerDataCache.set(handlerData, threadsFromRenderer);\n return threadsFromRenderer;\n }\n\n // If it's a CPU Profile trace, there will be no Renderer threads.\n // We can fallback to using the data from the SamplesHandler.\n const foundThreads: ThreadData[] = [];\n if (handlerData.Samples.profilesInProcess.size) {\n for (const [pid, process] of handlerData.Samples.profilesInProcess) {\n for (const [tid, thread] of process) {\n if (!thread.profileTree) {\n // Drop threads where we could not create the tree; this indicates\n // unexpected data and we won't be able to support all the UI\n // filtering we need.\n continue;\n }\n\n foundThreads.push({\n pid,\n tid,\n // CPU Profile threads do not have a name.\n name: null,\n entries: thread.profileCalls,\n // There is no concept of a \"Main Frame\" in a CPU profile.\n processIsOnMainFrame: false,\n tree: thread.profileTree,\n type: ThreadType.CPU_PROFILE,\n entryToNode: handlerData.Samples.entryToNode,\n });\n }\n }\n }\n\n threadsInHandlerDataCache.set(handlerData, foundThreads);\n return foundThreads;\n}\n"]}
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
// Copyright 2022 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
import * as Platform from '../../../core/platform/platform.js';
|
|
5
|
+
import * as Helpers from '../helpers/helpers.js';
|
|
6
|
+
import * as Types from '../types/types.js';
|
|
7
|
+
import { data as metaHandlerData } from './MetaHandler.js';
|
|
8
|
+
import { ScoreClassification } from './PageLoadMetricsHandler.js';
|
|
9
|
+
// This handler gathers EventTimings into Interactions, which we use to show
|
|
10
|
+
// interactions and highlight long interactions to the user, along with INP.
|
|
11
|
+
let beginCommitCompositorFrameEvents = [];
|
|
12
|
+
let parseMetaViewportEvents = [];
|
|
13
|
+
export const LONG_INTERACTION_THRESHOLD = Helpers.Timing.milliToMicro(Types.Timing.Milli(200));
|
|
14
|
+
const INP_GOOD_TIMING = LONG_INTERACTION_THRESHOLD;
|
|
15
|
+
const INP_MEDIUM_TIMING = Helpers.Timing.milliToMicro(Types.Timing.Milli(500));
|
|
16
|
+
let longestInteractionEvent = null;
|
|
17
|
+
let interactionEvents = [];
|
|
18
|
+
let interactionEventsWithNoNesting = [];
|
|
19
|
+
let eventTimingStartEventsForInteractions = [];
|
|
20
|
+
let eventTimingEndEventsForInteractions = [];
|
|
21
|
+
export function reset() {
|
|
22
|
+
beginCommitCompositorFrameEvents = [];
|
|
23
|
+
parseMetaViewportEvents = [];
|
|
24
|
+
interactionEvents = [];
|
|
25
|
+
eventTimingStartEventsForInteractions = [];
|
|
26
|
+
eventTimingEndEventsForInteractions = [];
|
|
27
|
+
interactionEventsWithNoNesting = [];
|
|
28
|
+
longestInteractionEvent = null;
|
|
29
|
+
}
|
|
30
|
+
export function handleEvent(event) {
|
|
31
|
+
if (Types.Events.isBeginCommitCompositorFrame(event)) {
|
|
32
|
+
beginCommitCompositorFrameEvents.push(event);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (Types.Events.isParseMetaViewport(event)) {
|
|
36
|
+
parseMetaViewportEvents.push(event);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (!Types.Events.isEventTiming(event)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (Types.Events.isEventTimingEnd(event)) {
|
|
43
|
+
// Store the end event; for each start event that is an interaction, we need the matching end event to calculate the duration correctly.
|
|
44
|
+
eventTimingEndEventsForInteractions.push(event);
|
|
45
|
+
}
|
|
46
|
+
// From this point on we want to find events that represent interactions.
|
|
47
|
+
// These events are always start events - those are the ones that contain all
|
|
48
|
+
// the metadata about the interaction.
|
|
49
|
+
if (!Types.Events.isEventTimingStart(event) || !event.args.data) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const { duration, interactionId } = event.args.data;
|
|
53
|
+
// We exclude events for the sake of interactions if:
|
|
54
|
+
// 1. They have no duration.
|
|
55
|
+
// 2. They have no interactionId
|
|
56
|
+
// 3. They have an interactionId of 0: this indicates that it's not an
|
|
57
|
+
// interaction that we care about because it hasn't had its own interactionId
|
|
58
|
+
// set (0 is the default on the backend).
|
|
59
|
+
// See: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/timing/responsiveness_metrics.cc;l=133;drc=40c209a9c365ebb9f16fb99dfe78c7fe768b9594
|
|
60
|
+
if (duration < 1 || interactionId === undefined || interactionId === 0) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
// Store the start event. In the finalize() function we will pair this with
|
|
64
|
+
// its end event and create the synthetic interaction event.
|
|
65
|
+
eventTimingStartEventsForInteractions.push(event);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* See https://web.dev/better-responsiveness-metric/#interaction-types for the
|
|
69
|
+
* table that defines these sets.
|
|
70
|
+
**/
|
|
71
|
+
const pointerEventTypes = new Set([
|
|
72
|
+
'pointerdown',
|
|
73
|
+
'touchstart',
|
|
74
|
+
'pointerup',
|
|
75
|
+
'touchend',
|
|
76
|
+
'mousedown',
|
|
77
|
+
'mouseup',
|
|
78
|
+
'click',
|
|
79
|
+
]);
|
|
80
|
+
const keyboardEventTypes = new Set([
|
|
81
|
+
'keydown',
|
|
82
|
+
'keypress',
|
|
83
|
+
'keyup',
|
|
84
|
+
]);
|
|
85
|
+
export function categoryOfInteraction(interaction) {
|
|
86
|
+
if (pointerEventTypes.has(interaction.type)) {
|
|
87
|
+
return 'POINTER';
|
|
88
|
+
}
|
|
89
|
+
if (keyboardEventTypes.has(interaction.type)) {
|
|
90
|
+
return 'KEYBOARD';
|
|
91
|
+
}
|
|
92
|
+
return 'OTHER';
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* We define a set of interactions as nested where:
|
|
96
|
+
* 1. Their end times align.
|
|
97
|
+
* 2. The longest interaction's start time is earlier than all other
|
|
98
|
+
* interactions with the same end time.
|
|
99
|
+
* 3. The interactions are of the same category [each interaction is either
|
|
100
|
+
* categorised as keyboard, or pointer.]
|
|
101
|
+
*
|
|
102
|
+
* =============A=[pointerup]=
|
|
103
|
+
* ====B=[pointerdown]=
|
|
104
|
+
* ===C=[pointerdown]==
|
|
105
|
+
* ===D=[pointerup]===
|
|
106
|
+
*
|
|
107
|
+
* In this example, B, C and D are all nested and therefore should not be
|
|
108
|
+
* returned from this function.
|
|
109
|
+
*
|
|
110
|
+
* However, in this example we would only consider B nested (under A) and D
|
|
111
|
+
* nested (under C). A and C both stay because they are of different types.
|
|
112
|
+
* ========A=[keydown]====
|
|
113
|
+
* =======B=[keyup]=====
|
|
114
|
+
* ====C=[pointerdown]=
|
|
115
|
+
* =D=[pointerup]=
|
|
116
|
+
*
|
|
117
|
+
* Additionally, this method will also maximise the processing duration of the
|
|
118
|
+
* events that we keep as non-nested. We want to make sure we give an accurate
|
|
119
|
+
* representation of main thread activity, so if we keep an event + hide its
|
|
120
|
+
* nested children, we set the top level event's processing start &
|
|
121
|
+
* processing end to be the earliest processing start & the latest processing
|
|
122
|
+
* end of its children. This ensures we report a more accurate main thread
|
|
123
|
+
* activity time which is important as we want developers to focus on fixing
|
|
124
|
+
* this.
|
|
125
|
+
**/
|
|
126
|
+
export function removeNestedInteractionsAndSetProcessingTime(interactions) {
|
|
127
|
+
/**
|
|
128
|
+
* Because we nest events only that are in the same category, we store the
|
|
129
|
+
* longest event for a given end time by category.
|
|
130
|
+
**/
|
|
131
|
+
const earliestEventForEndTimePerCategory = {
|
|
132
|
+
POINTER: new Map(),
|
|
133
|
+
KEYBOARD: new Map(),
|
|
134
|
+
OTHER: new Map(),
|
|
135
|
+
};
|
|
136
|
+
function storeEventIfEarliestForCategoryAndEndTime(interaction) {
|
|
137
|
+
const category = categoryOfInteraction(interaction);
|
|
138
|
+
const earliestEventForEndTime = earliestEventForEndTimePerCategory[category];
|
|
139
|
+
const endTime = Types.Timing.Micro(interaction.ts + interaction.dur);
|
|
140
|
+
const earliestCurrentEvent = earliestEventForEndTime.get(endTime);
|
|
141
|
+
if (!earliestCurrentEvent) {
|
|
142
|
+
earliestEventForEndTime.set(endTime, interaction);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (interaction.ts < earliestCurrentEvent.ts) {
|
|
146
|
+
earliestEventForEndTime.set(endTime, interaction);
|
|
147
|
+
}
|
|
148
|
+
else if (interaction.ts === earliestCurrentEvent.ts &&
|
|
149
|
+
interaction.interactionId === earliestCurrentEvent.interactionId) {
|
|
150
|
+
// We have seen in traces that the same interaction can have multiple
|
|
151
|
+
// events (e.g. a 'click' and a 'pointerdown'). Often only one of these
|
|
152
|
+
// events will have an event handler bound to it which caused delay on
|
|
153
|
+
// the main thread, and the others will not. This leads to a situation
|
|
154
|
+
// where if we pick one of the events that had no event handler, its
|
|
155
|
+
// processing duration (processingEnd - processingStart) will be 0, but if we
|
|
156
|
+
// had picked the event that had the slow event handler, we would show
|
|
157
|
+
// correctly the main thread delay due to the event handler.
|
|
158
|
+
// So, if we find events with the same interactionId and the same
|
|
159
|
+
// begin/end times, we pick the one with the largest (processingEnd -
|
|
160
|
+
// processingStart) time in order to make sure we find the event with the
|
|
161
|
+
// worst main thread delay, as that is the one the user should care
|
|
162
|
+
// about.
|
|
163
|
+
const currentProcessingDuration = earliestCurrentEvent.processingEnd - earliestCurrentEvent.processingStart;
|
|
164
|
+
const newProcessingDuration = interaction.processingEnd - interaction.processingStart;
|
|
165
|
+
// Use the new interaction if it has a longer processing duration than the existing one.
|
|
166
|
+
if (newProcessingDuration > currentProcessingDuration) {
|
|
167
|
+
earliestEventForEndTime.set(endTime, interaction);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
// Maximize the processing duration based on the "children" interactions.
|
|
171
|
+
// We pick the earliest start processing duration, and the latest end
|
|
172
|
+
// processing duration to avoid under-reporting.
|
|
173
|
+
if (interaction.processingStart < earliestCurrentEvent.processingStart) {
|
|
174
|
+
earliestCurrentEvent.processingStart = interaction.processingStart;
|
|
175
|
+
writeSyntheticTimespans(earliestCurrentEvent);
|
|
176
|
+
}
|
|
177
|
+
if (interaction.processingEnd > earliestCurrentEvent.processingEnd) {
|
|
178
|
+
earliestCurrentEvent.processingEnd = interaction.processingEnd;
|
|
179
|
+
writeSyntheticTimespans(earliestCurrentEvent);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
for (const interaction of interactions) {
|
|
183
|
+
storeEventIfEarliestForCategoryAndEndTime(interaction);
|
|
184
|
+
}
|
|
185
|
+
// Combine all the events that we have kept from all the per-category event
|
|
186
|
+
// maps back into an array and sort them by timestamp.
|
|
187
|
+
const keptEvents = Object.values(earliestEventForEndTimePerCategory)
|
|
188
|
+
.flatMap(eventsByEndTime => Array.from(eventsByEndTime.values()));
|
|
189
|
+
keptEvents.sort((eventA, eventB) => {
|
|
190
|
+
return eventA.ts - eventB.ts;
|
|
191
|
+
});
|
|
192
|
+
return keptEvents;
|
|
193
|
+
}
|
|
194
|
+
function writeSyntheticTimespans(event) {
|
|
195
|
+
const startEvent = event.args.data.beginEvent;
|
|
196
|
+
const endEvent = event.args.data.endEvent;
|
|
197
|
+
event.inputDelay = Types.Timing.Micro(event.processingStart - startEvent.ts);
|
|
198
|
+
event.mainThreadHandling = Types.Timing.Micro(event.processingEnd - event.processingStart);
|
|
199
|
+
event.presentationDelay = Types.Timing.Micro(endEvent.ts - event.processingEnd);
|
|
200
|
+
}
|
|
201
|
+
export async function finalize() {
|
|
202
|
+
const { navigationsByFrameId } = metaHandlerData();
|
|
203
|
+
const beginAndEndEvents = Platform.ArrayUtilities.mergeOrdered(eventTimingStartEventsForInteractions, eventTimingEndEventsForInteractions, Helpers.Trace.eventTimeComparator);
|
|
204
|
+
// Pair up the begin & end events and create synthetic user timing events.
|
|
205
|
+
const beginEventById = new Map();
|
|
206
|
+
for (const event of beginAndEndEvents) {
|
|
207
|
+
if (Types.Events.isEventTimingStart(event)) {
|
|
208
|
+
const forId = beginEventById.get(event.id) ?? [];
|
|
209
|
+
forId.push(event);
|
|
210
|
+
beginEventById.set(event.id, forId);
|
|
211
|
+
}
|
|
212
|
+
else if (Types.Events.isEventTimingEnd(event)) {
|
|
213
|
+
const beginEvents = beginEventById.get(event.id) ?? [];
|
|
214
|
+
const beginEvent = beginEvents.pop();
|
|
215
|
+
if (!beginEvent) {
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
const { type, interactionId, timeStamp, processingStart, processingEnd } = beginEvent.args.data;
|
|
219
|
+
if (!type || !interactionId || !timeStamp || !processingStart || !processingEnd) {
|
|
220
|
+
// A valid interaction event that we care about has to have a type (e.g. pointerdown, keyup).
|
|
221
|
+
// We also need to ensure it has an interactionId and various timings. There are edge cases where these aren't included in the trace event.
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
// In the future we will add microsecond timestamps to the trace events…
|
|
225
|
+
// (See https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/timing/window_performance.cc;l=900-901;drc=b503c262e425eae59ced4a80d59d176ed07152c7 )
|
|
226
|
+
// …but until then we can use the millisecond precision values that are in
|
|
227
|
+
// the trace event. To adjust them to be relative to the event.ts and the
|
|
228
|
+
// trace timestamps, for both processingStart and processingEnd we subtract
|
|
229
|
+
// the event timestamp (NOT event.ts, but the timeStamp millisecond value
|
|
230
|
+
// emitted in args.data), and then add that value to the event.ts. This
|
|
231
|
+
// will give us a processingStart and processingEnd time in microseconds
|
|
232
|
+
// that is relative to event.ts, and can be used when drawing boxes.
|
|
233
|
+
// There is some inaccuracy here as we are converting milliseconds to
|
|
234
|
+
// microseconds, but it is good enough until the backend emits more
|
|
235
|
+
// accurate numbers.
|
|
236
|
+
const processingStartRelativeToTraceTime = Types.Timing.Micro(Helpers.Timing.milliToMicro(processingStart) - Helpers.Timing.milliToMicro(timeStamp) + beginEvent.ts);
|
|
237
|
+
const processingEndRelativeToTraceTime = Types.Timing.Micro((Helpers.Timing.milliToMicro(processingEnd) - Helpers.Timing.milliToMicro(timeStamp)) + beginEvent.ts);
|
|
238
|
+
// Ultimate frameId fallback only needed for TSC, see comments in the type.
|
|
239
|
+
const frameId = beginEvent.args.frame ?? beginEvent.args.data.frame ?? '';
|
|
240
|
+
const navigation = Helpers.Trace.getNavigationForTraceEvent(beginEvent, frameId, navigationsByFrameId);
|
|
241
|
+
const navigationId = navigation?.args.data?.navigationId;
|
|
242
|
+
const interactionEvent = Helpers.SyntheticEvents.SyntheticEventsManager.registerSyntheticEvent({
|
|
243
|
+
// Use the start event to define the common fields.
|
|
244
|
+
rawSourceEvent: beginEvent,
|
|
245
|
+
cat: beginEvent.cat,
|
|
246
|
+
name: beginEvent.name,
|
|
247
|
+
pid: beginEvent.pid,
|
|
248
|
+
tid: beginEvent.tid,
|
|
249
|
+
ph: beginEvent.ph,
|
|
250
|
+
processingStart: processingStartRelativeToTraceTime,
|
|
251
|
+
processingEnd: processingEndRelativeToTraceTime,
|
|
252
|
+
// These will be set in writeSyntheticTimespans()
|
|
253
|
+
inputDelay: Types.Timing.Micro(-1),
|
|
254
|
+
mainThreadHandling: Types.Timing.Micro(-1),
|
|
255
|
+
presentationDelay: Types.Timing.Micro(-1),
|
|
256
|
+
args: {
|
|
257
|
+
data: {
|
|
258
|
+
beginEvent,
|
|
259
|
+
endEvent: event,
|
|
260
|
+
frame: frameId,
|
|
261
|
+
navigationId,
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
ts: beginEvent.ts,
|
|
265
|
+
dur: Types.Timing.Micro(event.ts - beginEvent.ts),
|
|
266
|
+
type: beginEvent.args.data.type,
|
|
267
|
+
interactionId: beginEvent.args.data.interactionId,
|
|
268
|
+
});
|
|
269
|
+
writeSyntheticTimespans(interactionEvent);
|
|
270
|
+
interactionEvents.push(interactionEvent);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
// Once we gather up all the interactions, we want to remove nested
|
|
274
|
+
// interactions. Interactions can be nested because one user action (e.g. a
|
|
275
|
+
// click) will cause a pointerdown, pointerup and click. But we don't want to
|
|
276
|
+
// fill the interactions track with lots of noise. To fix this, we go through
|
|
277
|
+
// all the events and remove any nested ones so on the timeline we focus the
|
|
278
|
+
// user on the most important events, which we define as the longest one. But
|
|
279
|
+
// this algorithm assumes the events are in ASC order, so we first sort the
|
|
280
|
+
// set of interactions.
|
|
281
|
+
Helpers.Trace.sortTraceEventsInPlace(interactionEvents);
|
|
282
|
+
interactionEventsWithNoNesting.push(...removeNestedInteractionsAndSetProcessingTime(interactionEvents));
|
|
283
|
+
// Pick the longest interactions from the set that were not nested, as we
|
|
284
|
+
// know those are the set of the largest interactions.
|
|
285
|
+
for (const interactionEvent of interactionEventsWithNoNesting) {
|
|
286
|
+
if (!longestInteractionEvent || longestInteractionEvent.dur < interactionEvent.dur) {
|
|
287
|
+
longestInteractionEvent = interactionEvent;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
export function data() {
|
|
292
|
+
return {
|
|
293
|
+
beginCommitCompositorFrameEvents,
|
|
294
|
+
parseMetaViewportEvents,
|
|
295
|
+
interactionEvents,
|
|
296
|
+
interactionEventsWithNoNesting,
|
|
297
|
+
longestInteractionEvent,
|
|
298
|
+
interactionsOverThreshold: new Set(interactionEvents.filter(event => {
|
|
299
|
+
return event.dur > LONG_INTERACTION_THRESHOLD;
|
|
300
|
+
})),
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
export function deps() {
|
|
304
|
+
return ['Meta'];
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Classifications sourced from
|
|
308
|
+
* https://web.dev/articles/inp#good-score
|
|
309
|
+
*/
|
|
310
|
+
export function scoreClassificationForInteractionToNextPaint(timing) {
|
|
311
|
+
if (timing <= INP_GOOD_TIMING) {
|
|
312
|
+
return ScoreClassification.GOOD;
|
|
313
|
+
}
|
|
314
|
+
if (timing <= INP_MEDIUM_TIMING) {
|
|
315
|
+
return ScoreClassification.OK;
|
|
316
|
+
}
|
|
317
|
+
return ScoreClassification.BAD;
|
|
318
|
+
}
|
|
319
|
+
//# sourceMappingURL=UserInteractionsHandler.js.map
|