devtools-tracing 1.0.0
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/generate.ts +643 -0
- package/index.ts +16 -0
- package/lib/front_end/core/common/App.ts +7 -0
- package/lib/front_end/core/common/AppProvider.ts +32 -0
- package/lib/front_end/core/common/Base64.ts +47 -0
- package/lib/front_end/core/common/CharacterIdMap.ts +30 -0
- package/lib/front_end/core/common/Color.ts +2506 -0
- package/lib/front_end/core/common/ColorConverter.ts +402 -0
- package/lib/front_end/core/common/ColorUtils.ts +252 -0
- package/lib/front_end/core/common/Console.ts +114 -0
- package/lib/front_end/core/common/Debouncer.ts +15 -0
- package/lib/front_end/core/common/EventTarget.ts +52 -0
- package/lib/front_end/core/common/Gzip.ts +74 -0
- package/lib/front_end/core/common/JavaScriptMetaData.ts +29 -0
- package/lib/front_end/core/common/Lazy.ts +31 -0
- package/lib/front_end/core/common/Linkifier.ts +55 -0
- package/lib/front_end/core/common/MapWithDefault.ts +26 -0
- package/lib/front_end/core/common/Mutex.ts +55 -0
- package/lib/front_end/core/common/Object.ts +145 -0
- package/lib/front_end/core/common/ParsedURL.ts +554 -0
- package/lib/front_end/core/common/Progress.ts +180 -0
- package/lib/front_end/core/common/QueryParamHandler.ts +7 -0
- package/lib/front_end/core/common/ResolverBase.ts +85 -0
- package/lib/front_end/core/common/ResourceType.ts +588 -0
- package/lib/front_end/core/common/ReturnToPanel.ts +17 -0
- package/lib/front_end/core/common/Revealer.ts +192 -0
- package/lib/front_end/core/common/Runnable.ts +41 -0
- package/lib/front_end/core/common/SegmentedRange.ts +87 -0
- package/lib/front_end/core/common/SettingRegistration.ts +339 -0
- package/lib/front_end/core/common/Settings.ts +1497 -0
- package/lib/front_end/core/common/SimpleHistoryManager.ts +124 -0
- package/lib/front_end/core/common/StringOutputStream.ts +26 -0
- package/lib/front_end/core/common/TextDictionary.ts +48 -0
- package/lib/front_end/core/common/Throttler.ts +99 -0
- package/lib/front_end/core/common/Trie.ts +152 -0
- package/lib/front_end/core/common/Worker.ts +60 -0
- package/lib/front_end/core/common/common.ts +81 -0
- package/lib/front_end/core/host/AidaClient.ts +733 -0
- package/lib/front_end/core/host/GdpClient.ts +316 -0
- package/lib/front_end/core/host/InspectorFrontendHost.ts +648 -0
- package/lib/front_end/core/host/InspectorFrontendHostAPI.ts +551 -0
- package/lib/front_end/core/host/Platform.ts +76 -0
- package/lib/front_end/core/host/ResourceLoader.ts +282 -0
- package/lib/front_end/core/host/UserMetrics.ts +1230 -0
- package/lib/front_end/core/host/host.ts +23 -0
- package/lib/front_end/core/i18n/ByteUtilities.ts +82 -0
- package/lib/front_end/core/i18n/DevToolsLocale.ts +87 -0
- package/lib/front_end/core/i18n/NumberFormatter.ts +82 -0
- package/lib/front_end/core/i18n/i18n.ts +17 -0
- package/lib/front_end/core/i18n/i18nImpl.ts +204 -0
- package/lib/front_end/core/i18n/i18nTypes.ts +10 -0
- package/lib/front_end/core/i18n/locales.js +14 -0
- package/lib/front_end/core/i18n/time-utilities.ts +174 -0
- package/lib/front_end/core/platform/ArrayUtilities.ts +271 -0
- package/lib/front_end/core/platform/Brand.ts +23 -0
- package/lib/front_end/core/platform/Constructor.ts +10 -0
- package/lib/front_end/core/platform/DOMUtilities.ts +138 -0
- package/lib/front_end/core/platform/DateUtilities.ts +15 -0
- package/lib/front_end/core/platform/DevToolsPath.ts +53 -0
- package/lib/front_end/core/platform/KeyboardUtilities.ts +38 -0
- package/lib/front_end/core/platform/MapUtilities.ts +95 -0
- package/lib/front_end/core/platform/MimeType.ts +175 -0
- package/lib/front_end/core/platform/NumberUtilities.ts +80 -0
- package/lib/front_end/core/platform/StringUtilities.ts +588 -0
- package/lib/front_end/core/platform/Timing.ts +17 -0
- package/lib/front_end/core/platform/TypedArrayUtilities.ts +189 -0
- package/lib/front_end/core/platform/TypescriptUtilities.ts +86 -0
- package/lib/front_end/core/platform/UIString.ts +39 -0
- package/lib/front_end/core/platform/UserVisibleError.ts +28 -0
- package/lib/front_end/core/platform/platform.ts +45 -0
- package/lib/front_end/core/protocol_client/ConnectionTransport.ts +26 -0
- package/lib/front_end/core/protocol_client/InspectorBackend.ts +1050 -0
- package/lib/front_end/core/protocol_client/NodeURL.ts +42 -0
- package/lib/front_end/core/protocol_client/protocol_client.ts +13 -0
- package/lib/front_end/core/root/Runtime.ts +609 -0
- package/lib/front_end/core/root/root.ts +6 -0
- package/lib/front_end/core/sdk/AccessibilityModel.ts +353 -0
- package/lib/front_end/core/sdk/AnimationModel.ts +1041 -0
- package/lib/front_end/core/sdk/AutofillModel.ts +184 -0
- package/lib/front_end/core/sdk/CPUProfilerModel.ts +148 -0
- package/lib/front_end/core/sdk/CPUThrottlingManager.ts +282 -0
- package/lib/front_end/core/sdk/CSSContainerQuery.ts +139 -0
- package/lib/front_end/core/sdk/CSSFontFace.ts +40 -0
- package/lib/front_end/core/sdk/CSSLayer.ts +30 -0
- package/lib/front_end/core/sdk/CSSMatchedStyles.ts +1646 -0
- package/lib/front_end/core/sdk/CSSMedia.ts +121 -0
- package/lib/front_end/core/sdk/CSSMetadata.ts +1647 -0
- package/lib/front_end/core/sdk/CSSModel.ts +1128 -0
- package/lib/front_end/core/sdk/CSSProperty.ts +384 -0
- package/lib/front_end/core/sdk/CSSPropertyParser.ts +681 -0
- package/lib/front_end/core/sdk/CSSPropertyParserMatchers.ts +1395 -0
- package/lib/front_end/core/sdk/CSSQuery.ts +72 -0
- package/lib/front_end/core/sdk/CSSRule.ts +465 -0
- package/lib/front_end/core/sdk/CSSScope.ts +30 -0
- package/lib/front_end/core/sdk/CSSStartingStyle.ts +29 -0
- package/lib/front_end/core/sdk/CSSStyleDeclaration.ts +313 -0
- package/lib/front_end/core/sdk/CSSStyleSheetHeader.ts +196 -0
- package/lib/front_end/core/sdk/CSSSupports.ts +33 -0
- package/lib/front_end/core/sdk/CategorizedBreakpoint.ts +64 -0
- package/lib/front_end/core/sdk/ChildTargetManager.ts +314 -0
- package/lib/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +62 -0
- package/lib/front_end/core/sdk/Connections.ts +293 -0
- package/lib/front_end/core/sdk/ConsoleModel.ts +808 -0
- package/lib/front_end/core/sdk/ConsoleModelTypes.ts +15 -0
- package/lib/front_end/core/sdk/Cookie.ts +319 -0
- package/lib/front_end/core/sdk/CookieModel.ts +239 -0
- package/lib/front_end/core/sdk/CookieParser.ts +185 -0
- package/lib/front_end/core/sdk/DOMDebuggerModel.ts +787 -0
- package/lib/front_end/core/sdk/DOMModel.ts +1961 -0
- package/lib/front_end/core/sdk/DebuggerModel.ts +1605 -0
- package/lib/front_end/core/sdk/EmulationModel.ts +648 -0
- package/lib/front_end/core/sdk/EnhancedTracesParser.ts +515 -0
- package/lib/front_end/core/sdk/EventBreakpointsModel.ts +183 -0
- package/lib/front_end/core/sdk/FrameAssociated.ts +11 -0
- package/lib/front_end/core/sdk/FrameManager.ts +259 -0
- package/lib/front_end/core/sdk/HeapProfilerModel.ts +225 -0
- package/lib/front_end/core/sdk/HttpReasonPhraseStrings.ts +77 -0
- package/lib/front_end/core/sdk/IOModel.ts +91 -0
- package/lib/front_end/core/sdk/IsolateManager.ts +257 -0
- package/lib/front_end/core/sdk/IssuesModel.ts +70 -0
- package/lib/front_end/core/sdk/LayerTreeBase.ts +169 -0
- package/lib/front_end/core/sdk/LogModel.ts +56 -0
- package/lib/front_end/core/sdk/NetworkManager.ts +2823 -0
- package/lib/front_end/core/sdk/NetworkRequest.ts +2253 -0
- package/lib/front_end/core/sdk/OverlayColorGenerator.ts +52 -0
- package/lib/front_end/core/sdk/OverlayModel.ts +1011 -0
- package/lib/front_end/core/sdk/OverlayPersistentHighlighter.ts +522 -0
- package/lib/front_end/core/sdk/PageLoad.ts +35 -0
- package/lib/front_end/core/sdk/PageResourceLoader.ts +435 -0
- package/lib/front_end/core/sdk/PaintProfiler.ts +110 -0
- package/lib/front_end/core/sdk/PerformanceMetricsModel.ts +84 -0
- package/lib/front_end/core/sdk/PreloadingModel.ts +863 -0
- package/lib/front_end/core/sdk/RehydratingConnection.ts +386 -0
- package/lib/front_end/core/sdk/RehydratingObject.ts +66 -0
- package/lib/front_end/core/sdk/RemoteObject.ts +1160 -0
- package/lib/front_end/core/sdk/Resource.ts +232 -0
- package/lib/front_end/core/sdk/ResourceTreeModel.ts +1160 -0
- package/lib/front_end/core/sdk/RuntimeModel.ts +732 -0
- package/lib/front_end/core/sdk/SDKModel.ts +65 -0
- package/lib/front_end/core/sdk/ScopeTreeCache.ts +45 -0
- package/lib/front_end/core/sdk/ScreenCaptureModel.ts +255 -0
- package/lib/front_end/core/sdk/Script.ts +534 -0
- package/lib/front_end/core/sdk/SecurityOriginManager.ts +76 -0
- package/lib/front_end/core/sdk/ServerSentEvents.ts +80 -0
- package/lib/front_end/core/sdk/ServerSentEventsProtocol.ts +122 -0
- package/lib/front_end/core/sdk/ServerTiming.ts +260 -0
- package/lib/front_end/core/sdk/ServiceWorkerCacheModel.ts +377 -0
- package/lib/front_end/core/sdk/ServiceWorkerManager.ts +605 -0
- package/lib/front_end/core/sdk/SourceMap.ts +867 -0
- package/lib/front_end/core/sdk/SourceMapCache.ts +54 -0
- package/lib/front_end/core/sdk/SourceMapFunctionRanges.ts +156 -0
- package/lib/front_end/core/sdk/SourceMapManager.ts +239 -0
- package/lib/front_end/core/sdk/SourceMapScopeChainEntry.ts +189 -0
- package/lib/front_end/core/sdk/SourceMapScopesInfo.ts +508 -0
- package/lib/front_end/core/sdk/StorageBucketsModel.ts +204 -0
- package/lib/front_end/core/sdk/StorageKeyManager.ts +98 -0
- package/lib/front_end/core/sdk/Target.ts +332 -0
- package/lib/front_end/core/sdk/TargetManager.ts +453 -0
- package/lib/front_end/core/sdk/TraceObject.ts +61 -0
- package/lib/front_end/core/sdk/WebAuthnModel.ts +104 -0
- package/lib/front_end/core/sdk/sdk.ts +174 -0
- package/lib/front_end/entrypoints/formatter_worker/FormatterActions.ts +59 -0
- package/lib/front_end/generated/InspectorBackendCommands.js +1617 -0
- package/lib/front_end/generated/SupportedCSSProperties.js +7512 -0
- package/lib/front_end/generated/protocol-proxy-api.d.ts +5022 -0
- package/lib/front_end/generated/protocol.ts +22014 -0
- package/lib/front_end/models/cpu_profile/CPUProfileDataModel.ts +571 -0
- package/lib/front_end/models/cpu_profile/ProfileTreeModel.ts +103 -0
- package/lib/front_end/models/cpu_profile/cpu_profile.ts +11 -0
- package/lib/front_end/models/formatter/FormatterWorkerPool.ts +219 -0
- package/lib/front_end/models/formatter/ScriptFormatter.ts +112 -0
- package/lib/front_end/models/formatter/formatter.ts +8 -0
- package/lib/front_end/models/text_utils/CodeMirrorUtils.ts +37 -0
- package/lib/front_end/models/text_utils/ContentData.ts +199 -0
- package/lib/front_end/models/text_utils/ContentProvider.ts +68 -0
- package/lib/front_end/models/text_utils/StaticContentProvider.ts +49 -0
- package/lib/front_end/models/text_utils/StreamingContentData.ts +108 -0
- package/lib/front_end/models/text_utils/Text.ts +90 -0
- package/lib/front_end/models/text_utils/TextCursor.ts +44 -0
- package/lib/front_end/models/text_utils/TextRange.ts +266 -0
- package/lib/front_end/models/text_utils/TextUtils.ts +401 -0
- package/lib/front_end/models/text_utils/WasmDisassembly.ts +87 -0
- package/lib/front_end/models/text_utils/text_utils.ts +27 -0
- package/lib/front_end/models/trace/EntityMapper.ts +141 -0
- package/lib/front_end/models/trace/EventsSerializer.ts +101 -0
- package/lib/front_end/models/trace/LanternComputationData.ts +438 -0
- package/lib/front_end/models/trace/ModelImpl.ts +236 -0
- package/lib/front_end/models/trace/Name.ts +136 -0
- package/lib/front_end/models/trace/Processor.ts +652 -0
- package/lib/front_end/models/trace/Styles.ts +1138 -0
- package/lib/front_end/models/trace/extras/FilmStrip.ts +78 -0
- package/lib/front_end/models/trace/extras/MainThreadActivity.ts +86 -0
- package/lib/front_end/models/trace/extras/ScriptDuplication.ts +236 -0
- package/lib/front_end/models/trace/extras/StackTraceForEvent.ts +203 -0
- package/lib/front_end/models/trace/extras/ThirdParties.ts +164 -0
- package/lib/front_end/models/trace/extras/TraceFilter.ts +62 -0
- package/lib/front_end/models/trace/extras/TraceTree.ts +701 -0
- package/lib/front_end/models/trace/extras/extras.ts +11 -0
- package/lib/front_end/models/trace/handlers/AnimationFramesHandler.ts +128 -0
- package/lib/front_end/models/trace/handlers/AnimationHandler.ts +36 -0
- package/lib/front_end/models/trace/handlers/AsyncJSCallsHandler.ts +239 -0
- package/lib/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +183 -0
- package/lib/front_end/models/trace/handlers/DOMStatsHandler.ts +31 -0
- package/lib/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +306 -0
- package/lib/front_end/models/trace/handlers/FlowsHandler.ts +175 -0
- package/lib/front_end/models/trace/handlers/FramesHandler.ts +571 -0
- package/lib/front_end/models/trace/handlers/GPUHandler.ts +50 -0
- package/lib/front_end/models/trace/handlers/ImagePaintingHandler.ts +183 -0
- package/lib/front_end/models/trace/handlers/InitiatorsHandler.ts +193 -0
- package/lib/front_end/models/trace/handlers/InvalidationsHandler.ts +168 -0
- package/lib/front_end/models/trace/handlers/LargestImagePaintHandler.ts +109 -0
- package/lib/front_end/models/trace/handlers/LargestTextPaintHandler.ts +35 -0
- package/lib/front_end/models/trace/handlers/LayerTreeHandler.ts +123 -0
- package/lib/front_end/models/trace/handlers/LayoutShiftsHandler.ts +573 -0
- package/lib/front_end/models/trace/handlers/MemoryHandler.ts +31 -0
- package/lib/front_end/models/trace/handlers/MetaHandler.ts +525 -0
- package/lib/front_end/models/trace/handlers/ModelHandlers.ts +34 -0
- package/lib/front_end/models/trace/handlers/NetworkRequestsHandler.ts +672 -0
- package/lib/front_end/models/trace/handlers/PageFramesHandler.ts +52 -0
- package/lib/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +460 -0
- package/lib/front_end/models/trace/handlers/RendererHandler.ts +428 -0
- package/lib/front_end/models/trace/handlers/SamplesHandler.ts +271 -0
- package/lib/front_end/models/trace/handlers/ScreenshotsHandler.ts +122 -0
- package/lib/front_end/models/trace/handlers/ScriptsHandler.ts +336 -0
- package/lib/front_end/models/trace/handlers/SelectorStatsHandler.ts +110 -0
- package/lib/front_end/models/trace/handlers/Threads.ts +139 -0
- package/lib/front_end/models/trace/handlers/UserInteractionsHandler.ts +400 -0
- package/lib/front_end/models/trace/handlers/UserTimingsHandler.ts +233 -0
- package/lib/front_end/models/trace/handlers/WarningsHandler.ts +162 -0
- package/lib/front_end/models/trace/handlers/WorkersHandler.ts +45 -0
- package/lib/front_end/models/trace/handlers/handlers.ts +8 -0
- package/lib/front_end/models/trace/handlers/helpers.ts +196 -0
- package/lib/front_end/models/trace/handlers/types.ts +75 -0
- package/lib/front_end/models/trace/helpers/Extensions.ts +54 -0
- package/lib/front_end/models/trace/helpers/Network.ts +129 -0
- package/lib/front_end/models/trace/helpers/SamplesIntegrator.ts +544 -0
- package/lib/front_end/models/trace/helpers/SyntheticEvents.ts +87 -0
- package/lib/front_end/models/trace/helpers/Timing.ts +248 -0
- package/lib/front_end/models/trace/helpers/Trace.ts +928 -0
- package/lib/front_end/models/trace/helpers/TreeHelpers.ts +320 -0
- package/lib/front_end/models/trace/helpers/helpers.ts +11 -0
- package/lib/front_end/models/trace/insights/CLSCulprits.ts +668 -0
- package/lib/front_end/models/trace/insights/Cache.ts +269 -0
- package/lib/front_end/models/trace/insights/Common.ts +453 -0
- package/lib/front_end/models/trace/insights/DOMSize.ts +223 -0
- package/lib/front_end/models/trace/insights/DocumentLatency.ts +319 -0
- package/lib/front_end/models/trace/insights/DuplicatedJavaScript.ts +126 -0
- package/lib/front_end/models/trace/insights/FontDisplay.ts +119 -0
- package/lib/front_end/models/trace/insights/ForcedReflow.ts +220 -0
- package/lib/front_end/models/trace/insights/INPBreakdown.ts +171 -0
- package/lib/front_end/models/trace/insights/ImageDelivery.ts +348 -0
- package/lib/front_end/models/trace/insights/LCPBreakdown.ts +268 -0
- package/lib/front_end/models/trace/insights/LCPDiscovery.ts +237 -0
- package/lib/front_end/models/trace/insights/LegacyJavaScript.ts +138 -0
- package/lib/front_end/models/trace/insights/Models.ts +22 -0
- package/lib/front_end/models/trace/insights/ModernHTTP.ts +257 -0
- package/lib/front_end/models/trace/insights/NetworkDependencyTree.ts +726 -0
- package/lib/front_end/models/trace/insights/RenderBlocking.ts +257 -0
- package/lib/front_end/models/trace/insights/SlowCSSSelector.ts +175 -0
- package/lib/front_end/models/trace/insights/Statistics.ts +101 -0
- package/lib/front_end/models/trace/insights/ThirdParties.ts +130 -0
- package/lib/front_end/models/trace/insights/Viewport.ts +138 -0
- package/lib/front_end/models/trace/insights/insights.ts +10 -0
- package/lib/front_end/models/trace/insights/types.ts +157 -0
- package/lib/front_end/models/trace/lantern/core/LanternError.ts +7 -0
- package/lib/front_end/models/trace/lantern/core/NetworkAnalyzer.ts +619 -0
- package/lib/front_end/models/trace/lantern/core/core.ts +6 -0
- package/lib/front_end/models/trace/lantern/graph/BaseNode.ts +345 -0
- package/lib/front_end/models/trace/lantern/graph/CPUNode.ts +80 -0
- package/lib/front_end/models/trace/lantern/graph/NetworkNode.ts +101 -0
- package/lib/front_end/models/trace/lantern/graph/PageDependencyGraph.ts +636 -0
- package/lib/front_end/models/trace/lantern/graph/graph.ts +8 -0
- package/lib/front_end/models/trace/lantern/lantern.ts +17 -0
- package/lib/front_end/models/trace/lantern/metrics/FirstContentfulPaint.ts +187 -0
- package/lib/front_end/models/trace/lantern/metrics/Interactive.ts +88 -0
- package/lib/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +92 -0
- package/lib/front_end/models/trace/lantern/metrics/MaxPotentialFID.ts +72 -0
- package/lib/front_end/models/trace/lantern/metrics/Metric.ts +126 -0
- package/lib/front_end/models/trace/lantern/metrics/SpeedIndex.ts +126 -0
- package/lib/front_end/models/trace/lantern/metrics/TBTUtils.ts +82 -0
- package/lib/front_end/models/trace/lantern/metrics/TotalBlockingTime.ts +112 -0
- package/lib/front_end/models/trace/lantern/metrics/metrics.ts +12 -0
- package/lib/front_end/models/trace/lantern/simulation/ConnectionPool.ts +150 -0
- package/lib/front_end/models/trace/lantern/simulation/Constants.ts +46 -0
- package/lib/front_end/models/trace/lantern/simulation/DNSCache.ts +61 -0
- package/lib/front_end/models/trace/lantern/simulation/SimulationTimingMap.ts +196 -0
- package/lib/front_end/models/trace/lantern/simulation/Simulator.ts +556 -0
- package/lib/front_end/models/trace/lantern/simulation/TCPConnection.ts +192 -0
- package/lib/front_end/models/trace/lantern/simulation/simulation.ts +10 -0
- package/lib/front_end/models/trace/lantern/types/Lantern.ts +220 -0
- package/lib/front_end/models/trace/lantern/types/types.ts +5 -0
- package/lib/front_end/models/trace/trace.ts +33 -0
- package/lib/front_end/models/trace/types/Configuration.ts +110 -0
- package/lib/front_end/models/trace/types/Extensions.ts +136 -0
- package/lib/front_end/models/trace/types/File.ts +281 -0
- package/lib/front_end/models/trace/types/Overlays.ts +138 -0
- package/lib/front_end/models/trace/types/Timing.ts +30 -0
- package/lib/front_end/models/trace/types/TraceEvents.ts +3277 -0
- package/lib/front_end/models/trace/types/types.ts +10 -0
- package/lib/front_end/third_party/i18n/LICENSE +202 -0
- package/lib/front_end/third_party/i18n/README.chromium +15 -0
- package/lib/front_end/third_party/i18n/i18n-impl.ts +61 -0
- package/lib/front_end/third_party/i18n/i18n.ts +11 -0
- package/lib/front_end/third_party/i18n/localized-string-set.ts +129 -0
- package/lib/front_end/third_party/intl-messageformat/LICENSE +33 -0
- package/lib/front_end/third_party/intl-messageformat/README.chromium +24 -0
- package/lib/front_end/third_party/intl-messageformat/intl-messageformat-tsconfig.json +16 -0
- package/lib/front_end/third_party/intl-messageformat/intl-messageformat.ts +6 -0
- package/lib/front_end/third_party/intl-messageformat/package/LICENSE.md +33 -0
- package/lib/front_end/third_party/intl-messageformat/package/README.md +3 -0
- package/lib/front_end/third_party/intl-messageformat/package/index.d.ts +6 -0
- package/lib/front_end/third_party/intl-messageformat/package/index.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/index.js +13 -0
- package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.d.ts +5 -0
- package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.js +1710 -0
- package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.iife.js +1815 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts +6 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/index.js +10 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts +34 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.js +229 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts +28 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.js +48 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts +34 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.js +179 -0
- package/lib/front_end/third_party/intl-messageformat/package/package.json +42 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts +34 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/core.js +230 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts +28 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/error.js +51 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts +34 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/formatters.js +182 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/error.d.ts +79 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/index.d.ts +15 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/parser.d.ts +153 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/types.d.ts +139 -0
- package/lib/front_end/third_party/legacy-javascript/LICENSE +202 -0
- package/lib/front_end/third_party/legacy-javascript/README.chromium +13 -0
- package/lib/front_end/third_party/legacy-javascript/legacy-javascript-tsconfig.json +8 -0
- package/lib/front_end/third_party/legacy-javascript/legacy-javascript.ts +3 -0
- package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.d.ts +18 -0
- package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.js +943 -0
- package/lib/front_end/third_party/legacy-javascript/package.json +8 -0
- package/lib/front_end/third_party/legacy-javascript/rebuild.sh +9 -0
- package/lib/front_end/third_party/third-party-web/LICENSE +20 -0
- package/lib/front_end/third_party/third-party-web/README.chromium +13 -0
- package/lib/front_end/third_party/third-party-web/lib/nostats-subset.d.ts +2 -0
- package/lib/front_end/third_party/third-party-web/lib/nostats-subset.js +149 -0
- package/lib/front_end/third_party/third-party-web/package/LICENSE +20 -0
- package/lib/front_end/third_party/third-party-web/package/README.md +929 -0
- package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive-nostats.json +1 -0
- package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive.json +1 -0
- package/lib/front_end/third_party/third-party-web/package/dist/entities-nostats.json +1 -0
- package/lib/front_end/third_party/third-party-web/package/dist/entities.json +1 -0
- package/lib/front_end/third_party/third-party-web/package/facades.md +46 -0
- package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.js +1 -0
- package/lib/front_end/third_party/third-party-web/package/httparchive-subset.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/httparchive-subset.js +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/__snapshots__/index.test.js.snap +1006 -0
- package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.js +139 -0
- package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.test.js +44 -0
- package/lib/front_end/third_party/third-party-web/package/lib/entities.test.js +27 -0
- package/lib/front_end/third_party/third-party-web/package/lib/index.d.ts +34 -0
- package/lib/front_end/third_party/third-party-web/package/lib/index.js +3 -0
- package/lib/front_end/third_party/third-party-web/package/lib/index.test.js +246 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/faqs.partial.md +36 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/goals.partial.md +9 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/methodology.partial.md +5 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/template.md +151 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-02-01.md +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-03-01.md +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-06.md +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-13.md +14 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2021-01-01.md +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2024-07-01.md +3 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.js +3 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.js +3 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.js +3 -0
- package/lib/front_end/third_party/third-party-web/package/nostats-subset.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/nostats-subset.js +1 -0
- package/lib/front_end/third_party/third-party-web/package/package.json +46 -0
- package/lib/front_end/third_party/third-party-web/package.json +8 -0
- package/lib/front_end/third_party/third-party-web/rebuild.sh +13 -0
- package/lib/front_end/third_party/third-party-web/third-party-web-tsconfig.json +8 -0
- package/lib/front_end/third_party/third-party-web/third-party-web.ts +3 -0
- package/package.json +24 -0
- package/patches/chrome-devtools-frontend+1.0.1533544.patch +187 -0
|
@@ -0,0 +1,3277 @@
|
|
|
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
|
+
|
|
5
|
+
import type * as Platform from '../../../core/platform/platform.js';
|
|
6
|
+
import type * as SDK from '../../../core/sdk/sdk.js';
|
|
7
|
+
import type * as Protocol from '../../../generated/protocol.js';
|
|
8
|
+
|
|
9
|
+
import type {Micro, Milli, Seconds, TraceWindowMicro} from './Timing.js';
|
|
10
|
+
|
|
11
|
+
/** Trace Events. **/
|
|
12
|
+
export const enum Phase {
|
|
13
|
+
// Standard
|
|
14
|
+
BEGIN = 'B',
|
|
15
|
+
END = 'E',
|
|
16
|
+
COMPLETE = 'X',
|
|
17
|
+
INSTANT = 'I',
|
|
18
|
+
COUNTER = 'C',
|
|
19
|
+
|
|
20
|
+
// Async
|
|
21
|
+
ASYNC_NESTABLE_START = 'b',
|
|
22
|
+
ASYNC_NESTABLE_INSTANT = 'n',
|
|
23
|
+
ASYNC_NESTABLE_END = 'e',
|
|
24
|
+
ASYNC_STEP_INTO = 'T',
|
|
25
|
+
ASYNC_BEGIN = 'S',
|
|
26
|
+
ASYNC_END = 'F',
|
|
27
|
+
ASYNC_STEP_PAST = 'p',
|
|
28
|
+
|
|
29
|
+
// Flow
|
|
30
|
+
FLOW_START = 's',
|
|
31
|
+
FLOW_STEP = 't',
|
|
32
|
+
FLOW_END = 'f',
|
|
33
|
+
|
|
34
|
+
// Sample
|
|
35
|
+
SAMPLE = 'P',
|
|
36
|
+
|
|
37
|
+
// Object
|
|
38
|
+
OBJECT_CREATED = 'N',
|
|
39
|
+
OBJECT_SNAPSHOT = 'O',
|
|
40
|
+
OBJECT_DESTROYED = 'D',
|
|
41
|
+
|
|
42
|
+
// Metadata
|
|
43
|
+
METADATA = 'M',
|
|
44
|
+
|
|
45
|
+
// Memory Dump
|
|
46
|
+
MEMORY_DUMP_GLOBAL = 'V',
|
|
47
|
+
MEMORY_DUMP_PROCESS = 'v',
|
|
48
|
+
|
|
49
|
+
// Mark
|
|
50
|
+
MARK = 'R',
|
|
51
|
+
|
|
52
|
+
// Clock sync
|
|
53
|
+
CLOCK_SYNC = 'c',
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function isNestableAsyncPhase(phase: Phase): boolean {
|
|
57
|
+
return phase === Phase.ASYNC_NESTABLE_START || phase === Phase.ASYNC_NESTABLE_END ||
|
|
58
|
+
phase === Phase.ASYNC_NESTABLE_INSTANT;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function isPhaseAsync(phase: Phase): boolean {
|
|
62
|
+
return isNestableAsyncPhase(phase) || phase === Phase.ASYNC_BEGIN || phase === Phase.ASYNC_STEP_INTO ||
|
|
63
|
+
phase === Phase.ASYNC_END || phase === Phase.ASYNC_STEP_PAST;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function isFlowPhase(phase: Phase): boolean {
|
|
67
|
+
return phase === Phase.FLOW_START || phase === Phase.FLOW_STEP || phase === Phase.FLOW_END;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const enum Scope {
|
|
71
|
+
THREAD = 't',
|
|
72
|
+
PROCESS = 'p',
|
|
73
|
+
GLOBAL = 'g',
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface Event {
|
|
77
|
+
args?: Args;
|
|
78
|
+
cat: string;
|
|
79
|
+
name: string;
|
|
80
|
+
ph: Phase;
|
|
81
|
+
pid: ProcessID;
|
|
82
|
+
tid: ThreadID;
|
|
83
|
+
tts?: Micro;
|
|
84
|
+
ts: Micro;
|
|
85
|
+
tdur?: Micro;
|
|
86
|
+
dur?: Micro;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface Args {
|
|
90
|
+
data?: ArgsData;
|
|
91
|
+
sampleTraceId?: number;
|
|
92
|
+
stackTrace?: CallFrame[];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface ArgsData {
|
|
96
|
+
stackTrace?: CallFrame[];
|
|
97
|
+
sampleTraceId?: number;
|
|
98
|
+
url?: string;
|
|
99
|
+
navigationId?: string;
|
|
100
|
+
frame?: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface CallFrame {
|
|
104
|
+
codeType?: string;
|
|
105
|
+
functionName: string;
|
|
106
|
+
// Trace events are inconsistent here sadly :(
|
|
107
|
+
scriptId: number|string;
|
|
108
|
+
columnNumber: number;
|
|
109
|
+
lineNumber: number;
|
|
110
|
+
url: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function objectIsCallFrame(object: object): object is CallFrame {
|
|
114
|
+
return ('functionName' in object && typeof object.functionName === 'string') &&
|
|
115
|
+
('scriptId' in object && (typeof object.scriptId === 'string' || typeof object.scriptId === 'number')) &&
|
|
116
|
+
('columnNumber' in object && typeof object.columnNumber === 'number') &&
|
|
117
|
+
('lineNumber' in object && typeof object.lineNumber === 'number') &&
|
|
118
|
+
('url' in object && typeof object.url === 'string');
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface TraceFrame {
|
|
122
|
+
frame: string;
|
|
123
|
+
name: string;
|
|
124
|
+
processId: ProcessID;
|
|
125
|
+
url: string;
|
|
126
|
+
parent?: string;
|
|
127
|
+
// Added to Chrome in April 2024:
|
|
128
|
+
// crrev.com/c/5424783
|
|
129
|
+
isOutermostMainFrame?: boolean;
|
|
130
|
+
// Added to Chrome in June 2024:
|
|
131
|
+
// crrev.com/c/5595033
|
|
132
|
+
isInPrimaryMainFrame?: boolean;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Sample events.
|
|
136
|
+
|
|
137
|
+
export interface Sample extends Event {
|
|
138
|
+
ph: Phase.SAMPLE;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* A fake trace event created to support CDP.Profiler.Profiles in the
|
|
143
|
+
* trace engine.
|
|
144
|
+
*
|
|
145
|
+
* Do not extend the SyntheticBased interface because this one doesn't have a raw trace event but a raw cpu profile.
|
|
146
|
+
* Also we won't manage this event through SyntheticEventsManager.
|
|
147
|
+
*/
|
|
148
|
+
export interface SyntheticCpuProfile extends Complete {
|
|
149
|
+
name: Name.CPU_PROFILE;
|
|
150
|
+
id: ProfileID;
|
|
151
|
+
args: Args&{
|
|
152
|
+
data: ArgsData & {
|
|
153
|
+
cpuProfile: Protocol.Profiler.Profile,
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface Profile extends Sample {
|
|
159
|
+
name: Name.PROFILE;
|
|
160
|
+
id: ProfileID;
|
|
161
|
+
args: Args&{
|
|
162
|
+
data: ArgsData & {
|
|
163
|
+
startTime: Micro,
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface ProfileChunk extends Sample {
|
|
169
|
+
name: Name.PROFILE_CHUNK;
|
|
170
|
+
id: ProfileID;
|
|
171
|
+
args: Args&{
|
|
172
|
+
// `data` is only missing in "fake" traces
|
|
173
|
+
data?: ArgsData & {
|
|
174
|
+
cpuProfile?: PartialProfile,
|
|
175
|
+
timeDeltas?: Micro[],
|
|
176
|
+
lines?: Micro[],
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export interface PartialProfile {
|
|
182
|
+
nodes?: PartialNode[];
|
|
183
|
+
samples: CallFrameID[];
|
|
184
|
+
/**
|
|
185
|
+
* Contains trace ids assigned to samples, if any. Trace ids are
|
|
186
|
+
* keyed by the sample index in the profile (the keys of the object
|
|
187
|
+
* are strings containing the numeric index).
|
|
188
|
+
*/
|
|
189
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
190
|
+
trace_ids?: Record<string, number>;
|
|
191
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface PartialNode {
|
|
195
|
+
callFrame: CallFrame;
|
|
196
|
+
id: CallFrameID;
|
|
197
|
+
parent?: CallFrameID;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Complete events.
|
|
201
|
+
|
|
202
|
+
export interface Complete extends Event {
|
|
203
|
+
ph: Phase.COMPLETE;
|
|
204
|
+
dur: Micro;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface RunTask extends Complete {
|
|
208
|
+
name: Name.RUN_TASK;
|
|
209
|
+
}
|
|
210
|
+
export function isRunTask(event: Event): event is RunTask {
|
|
211
|
+
return event.name === Name.RUN_TASK && event.ph === Phase.COMPLETE;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export interface FireIdleCallback extends Complete {
|
|
215
|
+
name: Name.FIRE_IDLE_CALLBACK;
|
|
216
|
+
args: Args&{
|
|
217
|
+
data: ArgsData & {
|
|
218
|
+
allottedMilliseconds: Milli,
|
|
219
|
+
frame: string,
|
|
220
|
+
id: number,
|
|
221
|
+
timedOut: boolean,
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export interface SchedulePostMessage extends Instant {
|
|
227
|
+
name: Name.SCHEDULE_POST_MESSAGE;
|
|
228
|
+
args: Args&{
|
|
229
|
+
data: ArgsData & {
|
|
230
|
+
traceId: string,
|
|
231
|
+
},
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export interface HandlePostMessage extends Complete {
|
|
236
|
+
name: Name.HANDLE_POST_MESSAGE;
|
|
237
|
+
args: Args&{
|
|
238
|
+
data: ArgsData & {
|
|
239
|
+
traceId: string,
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export interface Dispatch extends Complete {
|
|
245
|
+
name: 'EventDispatch';
|
|
246
|
+
args: Args&{
|
|
247
|
+
data: ArgsData & {
|
|
248
|
+
type: string,
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export interface ParseHTML extends Complete {
|
|
254
|
+
name: 'ParseHTML';
|
|
255
|
+
args: Args&{
|
|
256
|
+
beginData: {
|
|
257
|
+
frame: string,
|
|
258
|
+
startLine: number,
|
|
259
|
+
url: string,
|
|
260
|
+
sampleTraceId?: number,
|
|
261
|
+
},
|
|
262
|
+
endData?: {
|
|
263
|
+
endLine: number,
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export interface Begin extends Event {
|
|
269
|
+
ph: Phase.BEGIN;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export interface End extends Event {
|
|
273
|
+
ph: Phase.END;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* This denotes a complete event created from a pair of begin and end
|
|
278
|
+
* events. For practicality, instead of always having to look for the
|
|
279
|
+
* end event corresponding to a begin event, we create a synthetic
|
|
280
|
+
* complete event that comprises the data of both from the beginning in
|
|
281
|
+
* the RendererHandler.
|
|
282
|
+
*/
|
|
283
|
+
export type SyntheticComplete = Complete;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* TODO(paulirish): Migrate to the new (Sept 2024) EventTiming trace events.
|
|
287
|
+
* See https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/timing/window_performance.cc;l=900-901;drc=b503c262e425eae59ced4a80d59d176ed07152c7
|
|
288
|
+
**/
|
|
289
|
+
export type EventTimingBeginOrEnd = EventTimingBegin|EventTimingEnd;
|
|
290
|
+
|
|
291
|
+
export interface EventTimingBegin extends Event {
|
|
292
|
+
ph: Phase.ASYNC_NESTABLE_START;
|
|
293
|
+
name: Name.EVENT_TIMING;
|
|
294
|
+
id: string;
|
|
295
|
+
args: Args&{
|
|
296
|
+
// https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/timing/performance_event_timing.cc;l=297;drc=4f00803ca25c0d0480ed14844d6406933c21e80e
|
|
297
|
+
data: ArgsData & {
|
|
298
|
+
cancelable: boolean,
|
|
299
|
+
duration: Milli,
|
|
300
|
+
type: string,
|
|
301
|
+
interactionId: number,
|
|
302
|
+
interactionOffset: number,
|
|
303
|
+
nodeId: Protocol.DOM.BackendNodeId,
|
|
304
|
+
frame?: string, // From May 2022 onwards, this is where frame is located. https://chromium-review.googlesource.com/c/chromium/src/+/3632661
|
|
305
|
+
processingEnd?: Milli,
|
|
306
|
+
processingStart?: Milli,
|
|
307
|
+
timeStamp?: Milli,
|
|
308
|
+
enqueuedToMainThreadTime?: Milli,
|
|
309
|
+
commitFinishTime?: Milli,
|
|
310
|
+
},
|
|
311
|
+
frame?: string, // Prior to May 2022, `frame` was here in args.
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
export interface EventTimingEnd extends Event {
|
|
315
|
+
ph: Phase.ASYNC_NESTABLE_END;
|
|
316
|
+
name: Name.EVENT_TIMING;
|
|
317
|
+
id: string;
|
|
318
|
+
args: Args;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export interface GPUTask extends Complete {
|
|
322
|
+
name: 'GPUTask';
|
|
323
|
+
args: Args&{
|
|
324
|
+
data?: ArgsData & {
|
|
325
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
326
|
+
renderer_pid: ProcessID,
|
|
327
|
+
used_bytes: number,
|
|
328
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
329
|
+
},
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export interface SyntheticNetworkRedirect {
|
|
334
|
+
url: string;
|
|
335
|
+
priority: string;
|
|
336
|
+
requestMethod?: string;
|
|
337
|
+
ts: Micro;
|
|
338
|
+
dur: Micro;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* ProcessedArgsData is used to store the processed data of a network
|
|
343
|
+
* request. Which is used to distinguish from the date we extract from the
|
|
344
|
+
* trace event directly.
|
|
345
|
+
**/
|
|
346
|
+
interface SyntheticArgsData {
|
|
347
|
+
dnsLookup: Micro;
|
|
348
|
+
download: Micro;
|
|
349
|
+
downloadStart: Micro;
|
|
350
|
+
finishTime: Micro;
|
|
351
|
+
initialConnection: Micro;
|
|
352
|
+
isDiskCached: boolean;
|
|
353
|
+
isHttps: boolean;
|
|
354
|
+
isMemoryCached: boolean;
|
|
355
|
+
isPushedResource: boolean;
|
|
356
|
+
networkDuration: Micro;
|
|
357
|
+
processingDuration: Micro;
|
|
358
|
+
proxyNegotiation: Micro;
|
|
359
|
+
queueing: Micro;
|
|
360
|
+
redirectionDuration: Micro;
|
|
361
|
+
requestSent: Micro;
|
|
362
|
+
sendStartTime: Micro;
|
|
363
|
+
ssl: Micro;
|
|
364
|
+
stalled: Micro;
|
|
365
|
+
totalTime: Micro;
|
|
366
|
+
/** receiveHeadersEnd - sendEnd */
|
|
367
|
+
waiting: Micro;
|
|
368
|
+
/** receiveHeadersStart - sendEnd */
|
|
369
|
+
serverResponseTime: Micro;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export interface SyntheticNetworkRequest extends Complete, SyntheticBased<Phase.COMPLETE> {
|
|
373
|
+
rawSourceEvent: ResourceSendRequest;
|
|
374
|
+
args: Args&{
|
|
375
|
+
data: ArgsData & {
|
|
376
|
+
syntheticData: SyntheticArgsData,
|
|
377
|
+
// All fields below are from TraceEventsForNetworkRequest,
|
|
378
|
+
// Required fields
|
|
379
|
+
/** Size of the resource after decompression (if applicable). */
|
|
380
|
+
decodedBodyLength: number,
|
|
381
|
+
/**
|
|
382
|
+
* Size of the resource over the network. Includes size of headers and
|
|
383
|
+
* anything else in the HTTP response packet.
|
|
384
|
+
*/
|
|
385
|
+
encodedDataLength: number,
|
|
386
|
+
frame: string,
|
|
387
|
+
fromServiceWorker: boolean|undefined,
|
|
388
|
+
isLinkPreload: boolean,
|
|
389
|
+
/** Empty string if no response. */
|
|
390
|
+
mimeType: string,
|
|
391
|
+
priority: Protocol.Network.ResourcePriority,
|
|
392
|
+
initialPriority: Protocol.Network.ResourcePriority,
|
|
393
|
+
/**
|
|
394
|
+
* This is the protocol used to resolve the request.
|
|
395
|
+
*
|
|
396
|
+
* Note, this is not the same as URL.protocol.
|
|
397
|
+
*
|
|
398
|
+
* Example values (not exhaustive): http/0.9, http/1.0, http/1.1, http, h2, h3-Q050, data, blob, file
|
|
399
|
+
*/
|
|
400
|
+
protocol: string,
|
|
401
|
+
redirects: SyntheticNetworkRedirect[],
|
|
402
|
+
renderBlocking: RenderBlocking,
|
|
403
|
+
requestId: string,
|
|
404
|
+
requestingFrameUrl: string,
|
|
405
|
+
/** 0 if no response. */
|
|
406
|
+
statusCode: number,
|
|
407
|
+
resourceType: Protocol.Network.ResourceType,
|
|
408
|
+
responseHeaders: Array<{name: string, value: string}>|null,
|
|
409
|
+
fetchPriorityHint: FetchPriorityHint,
|
|
410
|
+
url: string,
|
|
411
|
+
/** True only if got a 'resourceFinish' event indicating a failure. */
|
|
412
|
+
failed: boolean,
|
|
413
|
+
/** True only if got a 'resourceFinish' event. Note even failed requests with no response may be "finished". */
|
|
414
|
+
finished: boolean,
|
|
415
|
+
hasResponse: boolean,
|
|
416
|
+
/** If undefined, trace was either too old or had no response. */
|
|
417
|
+
connectionId: number|undefined,
|
|
418
|
+
/** If undefined, trace was either too old or had no response. */
|
|
419
|
+
connectionReused: boolean|undefined,
|
|
420
|
+
// Optional fields
|
|
421
|
+
initiator?: Initiator,
|
|
422
|
+
requestMethod?: string,
|
|
423
|
+
timing?: ResourceReceiveResponseTimingData,
|
|
424
|
+
/** Server response time according to Lightrider. */
|
|
425
|
+
lrServerResponseTime?: Milli,
|
|
426
|
+
},
|
|
427
|
+
};
|
|
428
|
+
cat: 'loading';
|
|
429
|
+
name: Name.SYNTHETIC_NETWORK_REQUEST;
|
|
430
|
+
ph: Phase.COMPLETE;
|
|
431
|
+
dur: Micro;
|
|
432
|
+
tdur: Micro;
|
|
433
|
+
ts: Micro;
|
|
434
|
+
tts: Micro;
|
|
435
|
+
pid: ProcessID;
|
|
436
|
+
tid: ThreadID;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
export interface SyntheticWebSocketConnection extends Complete, SyntheticBased<Phase.COMPLETE> {
|
|
440
|
+
rawSourceEvent: Event;
|
|
441
|
+
args: Args&{
|
|
442
|
+
data: ArgsData & {
|
|
443
|
+
identifier: number,
|
|
444
|
+
priority: Protocol.Network.ResourcePriority,
|
|
445
|
+
url: string,
|
|
446
|
+
},
|
|
447
|
+
};
|
|
448
|
+
cat: string;
|
|
449
|
+
name: 'SyntheticWebSocketConnection';
|
|
450
|
+
ph: Phase.COMPLETE;
|
|
451
|
+
dur: Micro;
|
|
452
|
+
ts: Micro;
|
|
453
|
+
pid: ProcessID;
|
|
454
|
+
tid: ThreadID;
|
|
455
|
+
s: Scope;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
export const enum AuctionWorkletType {
|
|
459
|
+
BIDDER = 'bidder',
|
|
460
|
+
SELLER = 'seller',
|
|
461
|
+
// Not expected to be used, but here as a fallback in case new types get
|
|
462
|
+
// added and we have yet to update the trace engine.
|
|
463
|
+
UNKNOWN = 'unknown',
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export interface SyntheticAuctionWorklet extends Instant, SyntheticBased<Phase.INSTANT> {
|
|
467
|
+
rawSourceEvent: Event;
|
|
468
|
+
name: 'SyntheticAuctionWorklet';
|
|
469
|
+
// The PID that the AuctionWorklet is running in.
|
|
470
|
+
pid: ProcessID;
|
|
471
|
+
// URL
|
|
472
|
+
host: string;
|
|
473
|
+
// An ID used to pair up runningInProcessEvents with doneWithProcessEvents
|
|
474
|
+
target: string;
|
|
475
|
+
type: AuctionWorkletType;
|
|
476
|
+
args: Args&{
|
|
477
|
+
data: ArgsData & {
|
|
478
|
+
// There are two threads for a worklet that we care about, so we gather
|
|
479
|
+
// the thread_name events so we can know the PID and TID for them (and
|
|
480
|
+
// hence display the right events in the track for each thread)
|
|
481
|
+
utilityThread: ThreadName,
|
|
482
|
+
v8HelperThread: ThreadName,
|
|
483
|
+
} &
|
|
484
|
+
(
|
|
485
|
+
// This type looks odd, but this is because these events could either have:
|
|
486
|
+
// 1. Just the DoneWithProcess event
|
|
487
|
+
// 2. Just the RunningInProcess event
|
|
488
|
+
// 3. Both events
|
|
489
|
+
// But crucially it cannot have both events missing, hence listing all the
|
|
490
|
+
// allowed cases.
|
|
491
|
+
// Clang is disabled as the combination of nested types and optional
|
|
492
|
+
// properties cause it to weirdly indent some of the properties and make it
|
|
493
|
+
// very unreadable.
|
|
494
|
+
// clang-format off
|
|
495
|
+
{
|
|
496
|
+
runningInProcessEvent: AuctionWorkletRunningInProcess,
|
|
497
|
+
doneWithProcessEvent: AuctionWorkletDoneWithProcess,
|
|
498
|
+
} |
|
|
499
|
+
{
|
|
500
|
+
doneWithProcessEvent: AuctionWorkletDoneWithProcess,
|
|
501
|
+
runningInProcessEvent?: AuctionWorkletRunningInProcess,
|
|
502
|
+
} |
|
|
503
|
+
{
|
|
504
|
+
runningInProcessEvent: AuctionWorkletRunningInProcess,
|
|
505
|
+
doneWithProcessEvent?: AuctionWorkletDoneWithProcess,
|
|
506
|
+
|
|
507
|
+
}),
|
|
508
|
+
// clang-format on
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
export interface AuctionWorkletRunningInProcess extends Event {
|
|
512
|
+
name: 'AuctionWorkletRunningInProcess';
|
|
513
|
+
ph: Phase.INSTANT;
|
|
514
|
+
args: Args&{
|
|
515
|
+
data: ArgsData & {
|
|
516
|
+
host: string,
|
|
517
|
+
pid: ProcessID,
|
|
518
|
+
target: string,
|
|
519
|
+
type: AuctionWorkletType,
|
|
520
|
+
},
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
export interface AuctionWorkletDoneWithProcess extends Event {
|
|
524
|
+
name: 'AuctionWorkletDoneWithProcess';
|
|
525
|
+
ph: Phase.INSTANT;
|
|
526
|
+
args: Args&{
|
|
527
|
+
data: ArgsData & {
|
|
528
|
+
host: string,
|
|
529
|
+
pid: ProcessID,
|
|
530
|
+
target: string,
|
|
531
|
+
type: AuctionWorkletType,
|
|
532
|
+
},
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
export function isAuctionWorkletRunningInProcess(event: Event): event is AuctionWorkletRunningInProcess {
|
|
537
|
+
return event.name === 'AuctionWorkletRunningInProcess';
|
|
538
|
+
}
|
|
539
|
+
export function isAuctionWorkletDoneWithProcess(event: Event): event is AuctionWorkletDoneWithProcess {
|
|
540
|
+
return event.name === 'AuctionWorkletDoneWithProcess';
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
// Snapshot events.
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* In January 2025 when crrev.com/c/6197645 landed, it changed the format of screenshot events.
|
|
547
|
+
* That is why we two screenshot types:
|
|
548
|
+
* `LegacyScreenshot` and `LegacySyntheticScreenshot`: BEFORE the above CL.
|
|
549
|
+
* `Screenshot`: AFTER the above CL.
|
|
550
|
+
* Important things to note:
|
|
551
|
+
* 1. Both the "old" and "new" events share the name "Screenshot" but their format is very different.
|
|
552
|
+
* 2. The old events had both a raw event (LegacyScreenshot) and a synthetic
|
|
553
|
+
* event (LegacySyntheticScreenshot). The new events only have a raw event, as
|
|
554
|
+
* we do not need the additional complexity of a synthetic event.
|
|
555
|
+
* 3. Because we like to support "old" traces, DevTools will maintain its
|
|
556
|
+
* support for both screenshot events for the foreseeable future. If you are
|
|
557
|
+
* consuming screenshot events from the ScreenshotHandler, you must make sure
|
|
558
|
+
* to have your code deal with the two different formats.
|
|
559
|
+
*/
|
|
560
|
+
export interface LegacyScreenshot extends Event {
|
|
561
|
+
/**
|
|
562
|
+
* @deprecated This value is incorrect. Use ScreenshotHandler.getPresentationTimestamp()
|
|
563
|
+
*/
|
|
564
|
+
ts: Micro;
|
|
565
|
+
/** The id is the frame sequence number in hex */
|
|
566
|
+
id: string;
|
|
567
|
+
args: Args&{
|
|
568
|
+
snapshot: string,
|
|
569
|
+
};
|
|
570
|
+
name: Name.SCREENSHOT;
|
|
571
|
+
cat: 'disabled-by-default-devtools.screenshot';
|
|
572
|
+
ph: Phase.OBJECT_SNAPSHOT;
|
|
573
|
+
}
|
|
574
|
+
export function isLegacyScreenshot(event: Event): event is LegacyScreenshot {
|
|
575
|
+
return event.name === Name.SCREENSHOT && 'id' in event;
|
|
576
|
+
}
|
|
577
|
+
export function isLegacySyntheticScreenshot(event: Event): event is LegacySyntheticScreenshot {
|
|
578
|
+
return event.name === Name.SCREENSHOT && 'dataUri' in (event.args ?? {});
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
export function isScreenshot(event: Event): event is Screenshot {
|
|
582
|
+
return event.name === Name.SCREENSHOT && 'source_id' in (event.args ?? {});
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
export interface LegacySyntheticScreenshot extends Event, SyntheticBased {
|
|
586
|
+
rawSourceEvent: LegacyScreenshot;
|
|
587
|
+
/** This is the correct presentation timestamp. */
|
|
588
|
+
ts: Micro;
|
|
589
|
+
args: Args&{
|
|
590
|
+
dataUri: string,
|
|
591
|
+
};
|
|
592
|
+
name: Name.SCREENSHOT;
|
|
593
|
+
cat: 'disabled-by-default-devtools.screenshot';
|
|
594
|
+
ph: Phase.OBJECT_SNAPSHOT;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
export interface Screenshot extends Instant {
|
|
598
|
+
args: Args&{
|
|
599
|
+
snapshot: string,
|
|
600
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
601
|
+
source_id: number,
|
|
602
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
603
|
+
frame_sequence: number,
|
|
604
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
605
|
+
expected_display_time: number,
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
// Animation events.
|
|
610
|
+
|
|
611
|
+
export interface Animation extends Event {
|
|
612
|
+
args: Args&{
|
|
613
|
+
data: ArgsData & {
|
|
614
|
+
nodeName?: string,
|
|
615
|
+
nodeId?: Protocol.DOM.BackendNodeId,
|
|
616
|
+
displayName?: string,
|
|
617
|
+
id?: string,
|
|
618
|
+
name?: string,
|
|
619
|
+
state?: string,
|
|
620
|
+
compositeFailed?: number,
|
|
621
|
+
unsupportedProperties?: string[],
|
|
622
|
+
},
|
|
623
|
+
};
|
|
624
|
+
name: 'Animation';
|
|
625
|
+
id2?: {
|
|
626
|
+
local?: string,
|
|
627
|
+
};
|
|
628
|
+
ph: Phase.ASYNC_NESTABLE_START|Phase.ASYNC_NESTABLE_END|Phase.ASYNC_NESTABLE_INSTANT;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
// Metadata events.
|
|
632
|
+
|
|
633
|
+
export interface Metadata extends Event {
|
|
634
|
+
ph: Phase.METADATA;
|
|
635
|
+
args: Args&{
|
|
636
|
+
name?: string,
|
|
637
|
+
uptime?: string,
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
export interface ThreadName extends Metadata {
|
|
642
|
+
name: Name.THREAD_NAME;
|
|
643
|
+
args: Args&{
|
|
644
|
+
name?: string,
|
|
645
|
+
};
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
export interface ProcessName extends Metadata {
|
|
649
|
+
name: 'process_name';
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
// Mark events.
|
|
653
|
+
|
|
654
|
+
export interface Mark extends Event {
|
|
655
|
+
ph: Phase.MARK;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
export interface NavigationStart extends Mark {
|
|
659
|
+
name: 'navigationStart';
|
|
660
|
+
args: Args&{
|
|
661
|
+
frame: string,
|
|
662
|
+
data?: ArgsData&{
|
|
663
|
+
/** Must be non-empty to be valid. An empty documentLoaderURL means the event can be ignored. */
|
|
664
|
+
documentLoaderURL: string,
|
|
665
|
+
isLoadingMainFrame: boolean,
|
|
666
|
+
navigationId: string,
|
|
667
|
+
/**
|
|
668
|
+
* `isOutermostMainFrame` was introduced in crrev.com/c/3625434 and exists because of Fenced Frames
|
|
669
|
+
* [github.com/WICG/fenced-frame/tree/master/explainer]. Fenced frames introduce a situation where
|
|
670
|
+
* `isLoadingMainFrame` could be true for a navigation, but that navigation be within an embedded "main frame", and
|
|
671
|
+
* therefore it wouldn't be on the top level main frame. In situations where we need to distinguish that, we can
|
|
672
|
+
* rely on `isOutermostMainFrame`, which will only be true for navigations on the top level main frame.
|
|
673
|
+
* This flag is optional as it was introduced in May 2022; so users reasonably may import traces from before that
|
|
674
|
+
* date that do not have this field present.
|
|
675
|
+
*/
|
|
676
|
+
isOutermostMainFrame?: boolean,
|
|
677
|
+
/**
|
|
678
|
+
* @deprecated use documentLoaderURL for navigation events URLs
|
|
679
|
+
*/
|
|
680
|
+
url?: string,
|
|
681
|
+
},
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
export interface FirstContentfulPaint extends Mark {
|
|
686
|
+
name: Name.MARK_FCP;
|
|
687
|
+
args: Args&{
|
|
688
|
+
frame: string,
|
|
689
|
+
data?: ArgsData&{
|
|
690
|
+
navigationId: string,
|
|
691
|
+
},
|
|
692
|
+
};
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
export interface FirstPaint extends Mark {
|
|
696
|
+
name: 'firstPaint';
|
|
697
|
+
args: Args&{
|
|
698
|
+
frame: string,
|
|
699
|
+
data?: ArgsData&{
|
|
700
|
+
navigationId: string,
|
|
701
|
+
},
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
export type PageLoadEvent = FirstContentfulPaint|MarkDOMContent|InteractiveTime|LargestContentfulPaintCandidate|
|
|
706
|
+
LayoutShift|FirstPaint|MarkLoad|NavigationStart;
|
|
707
|
+
|
|
708
|
+
const markerTypeGuards = [
|
|
709
|
+
isMarkDOMContent,
|
|
710
|
+
isMarkLoad,
|
|
711
|
+
isFirstPaint,
|
|
712
|
+
isFirstContentfulPaint,
|
|
713
|
+
isLargestContentfulPaintCandidate,
|
|
714
|
+
isNavigationStart,
|
|
715
|
+
];
|
|
716
|
+
|
|
717
|
+
export const MarkerName =
|
|
718
|
+
['MarkDOMContent', 'MarkLoad', 'firstPaint', 'firstContentfulPaint', 'largestContentfulPaint::Candidate'] as const;
|
|
719
|
+
|
|
720
|
+
export interface MarkerEvent extends Event {
|
|
721
|
+
name: typeof MarkerName[number];
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
export function isMarkerEvent(event: Event): event is MarkerEvent {
|
|
725
|
+
if (event.ph === Phase.INSTANT || event.ph === Phase.MARK) {
|
|
726
|
+
return markerTypeGuards.some(fn => fn(event));
|
|
727
|
+
}
|
|
728
|
+
return false;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
const pageLoadEventTypeGuards = [
|
|
732
|
+
...markerTypeGuards,
|
|
733
|
+
isInteractiveTime,
|
|
734
|
+
];
|
|
735
|
+
|
|
736
|
+
export function eventIsPageLoadEvent(event: Event): event is PageLoadEvent {
|
|
737
|
+
if (event.ph === Phase.INSTANT || event.ph === Phase.MARK) {
|
|
738
|
+
return pageLoadEventTypeGuards.some(fn => fn(event));
|
|
739
|
+
}
|
|
740
|
+
return false;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
export interface LargestContentfulPaintCandidate extends Mark {
|
|
744
|
+
name: Name.MARK_LCP_CANDIDATE;
|
|
745
|
+
args: Args&{
|
|
746
|
+
frame: string,
|
|
747
|
+
data?: ArgsData&{
|
|
748
|
+
candidateIndex: number,
|
|
749
|
+
isOutermostMainFrame: boolean,
|
|
750
|
+
isMainFrame: boolean,
|
|
751
|
+
navigationId: string,
|
|
752
|
+
nodeId: Protocol.DOM.BackendNodeId,
|
|
753
|
+
loadingAttr: string,
|
|
754
|
+
type?: string,
|
|
755
|
+
// Landed in Chrome M140: crrev.com/c/6702010
|
|
756
|
+
nodeName?: string,
|
|
757
|
+
},
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
export interface LargestImagePaintCandidate extends Mark {
|
|
761
|
+
name: 'LargestImagePaint::Candidate';
|
|
762
|
+
args: Args&{
|
|
763
|
+
frame: string,
|
|
764
|
+
data?: ArgsData&{
|
|
765
|
+
candidateIndex: number,
|
|
766
|
+
imageUrl: string,
|
|
767
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
768
|
+
DOMNodeId: Protocol.DOM.BackendNodeId,
|
|
769
|
+
},
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
export interface LargestTextPaintCandidate extends Mark {
|
|
773
|
+
name: 'LargestTextPaint::Candidate';
|
|
774
|
+
args: Args&{
|
|
775
|
+
frame: string,
|
|
776
|
+
data?: ArgsData&{
|
|
777
|
+
candidateIndex: number,
|
|
778
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
779
|
+
DOMNodeId: Protocol.DOM.BackendNodeId,
|
|
780
|
+
// Added in crbug.com/413284569
|
|
781
|
+
nodeName?: string,
|
|
782
|
+
},
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
export interface InteractiveTime extends Mark {
|
|
787
|
+
name: 'InteractiveTime';
|
|
788
|
+
args: Args&{
|
|
789
|
+
args: {
|
|
790
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
791
|
+
total_blocking_time_ms: number,
|
|
792
|
+
},
|
|
793
|
+
frame: string,
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
// Instant events.
|
|
798
|
+
|
|
799
|
+
export interface Instant extends Event {
|
|
800
|
+
ph: Phase.INSTANT;
|
|
801
|
+
s: Scope;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
export interface DOMStats extends Instant {
|
|
805
|
+
name: 'DOMStats';
|
|
806
|
+
args: Args&{
|
|
807
|
+
data: ArgsData & {
|
|
808
|
+
frame: string,
|
|
809
|
+
totalElements: number,
|
|
810
|
+
maxChildren?: {
|
|
811
|
+
nodeId: Protocol.DOM.BackendNodeId,
|
|
812
|
+
nodeName: string,
|
|
813
|
+
numChildren: number,
|
|
814
|
+
},
|
|
815
|
+
maxDepth?: {
|
|
816
|
+
nodeId: Protocol.DOM.BackendNodeId,
|
|
817
|
+
nodeName: string,
|
|
818
|
+
depth: number,
|
|
819
|
+
},
|
|
820
|
+
},
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
export interface UpdateCounters extends Instant {
|
|
825
|
+
name: 'UpdateCounters';
|
|
826
|
+
args: Args&{
|
|
827
|
+
data: ArgsData & {
|
|
828
|
+
documents: number,
|
|
829
|
+
jsEventListeners: number,
|
|
830
|
+
jsHeapSizeUsed: number,
|
|
831
|
+
nodes: number,
|
|
832
|
+
gpuMemoryLimitKB?: number,
|
|
833
|
+
},
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
export type RendererEvent = Instant|Complete;
|
|
838
|
+
|
|
839
|
+
export interface TracingStartedInBrowser extends Instant {
|
|
840
|
+
name: Name.TRACING_STARTED_IN_BROWSER;
|
|
841
|
+
args: Args&{
|
|
842
|
+
data?: ArgsData & {
|
|
843
|
+
frameTreeNodeId: number,
|
|
844
|
+
// Frames can only missing in "fake" traces
|
|
845
|
+
persistentIds: boolean,
|
|
846
|
+
frames?: TraceFrame[],
|
|
847
|
+
},
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
export interface TracingSessionIdForWorker extends Instant {
|
|
852
|
+
name: 'TracingSessionIdForWorker';
|
|
853
|
+
args: Args&{
|
|
854
|
+
data?: ArgsData & {
|
|
855
|
+
url: string,
|
|
856
|
+
workerId: WorkerId,
|
|
857
|
+
workerThreadId: ThreadID,
|
|
858
|
+
frame: string,
|
|
859
|
+
},
|
|
860
|
+
};
|
|
861
|
+
}
|
|
862
|
+
export function isTracingSessionIdForWorker(event: Event): event is TracingSessionIdForWorker {
|
|
863
|
+
return event.name === 'TracingSessionIdForWorker';
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
export interface FrameCommittedInBrowser extends Instant {
|
|
867
|
+
name: 'FrameCommittedInBrowser';
|
|
868
|
+
args: Args&{
|
|
869
|
+
data?: ArgsData & TraceFrame,
|
|
870
|
+
};
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
export interface MainFrameViewport extends Instant {
|
|
874
|
+
name: 'PaintTimingVisualizer::Viewport';
|
|
875
|
+
args: {
|
|
876
|
+
data: ArgsData&{
|
|
877
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
878
|
+
viewport_rect: number[],
|
|
879
|
+
/** Device Pixel Ratio. Added in m128 */
|
|
880
|
+
dpr: number,
|
|
881
|
+
},
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
export interface CommitLoad extends Instant {
|
|
886
|
+
name: 'CommitLoad';
|
|
887
|
+
args: Args&{
|
|
888
|
+
data?: ArgsData & {
|
|
889
|
+
frame: string,
|
|
890
|
+
isMainFrame: boolean,
|
|
891
|
+
name: string,
|
|
892
|
+
nodeId: number,
|
|
893
|
+
page: string,
|
|
894
|
+
parent: string,
|
|
895
|
+
url: string,
|
|
896
|
+
},
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
export interface MarkDOMContent extends Instant {
|
|
901
|
+
name: 'MarkDOMContent';
|
|
902
|
+
args: Args&{
|
|
903
|
+
data?: ArgsData & {
|
|
904
|
+
frame: string,
|
|
905
|
+
isMainFrame: boolean,
|
|
906
|
+
page: string,
|
|
907
|
+
isOutermostMainFrame?: boolean,
|
|
908
|
+
},
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
export interface MarkLoad extends Instant {
|
|
913
|
+
name: 'MarkLoad';
|
|
914
|
+
args: Args&{
|
|
915
|
+
data?: ArgsData & {
|
|
916
|
+
frame: string,
|
|
917
|
+
isMainFrame: boolean,
|
|
918
|
+
page: string,
|
|
919
|
+
isOutermostMainFrame?: boolean,
|
|
920
|
+
},
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
export interface Async extends Event {
|
|
925
|
+
ph: Phase.ASYNC_NESTABLE_START|Phase.ASYNC_NESTABLE_INSTANT|Phase.ASYNC_NESTABLE_END|Phase.ASYNC_STEP_INTO|
|
|
926
|
+
Phase.ASYNC_BEGIN|Phase.ASYNC_END|Phase.ASYNC_STEP_PAST;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
export type TraceRect = [number, number, number, number];
|
|
930
|
+
export interface TraceImpactedNode {
|
|
931
|
+
// These keys come from the trace data, so we have to use underscores.
|
|
932
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
933
|
+
new_rect: TraceRect;
|
|
934
|
+
node_id: Protocol.DOM.BackendNodeId;
|
|
935
|
+
old_rect: TraceRect;
|
|
936
|
+
debug_name?: string;
|
|
937
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
type LayoutShiftData = ArgsData&{
|
|
941
|
+
// These keys come from the trace data, so we have to use underscores.
|
|
942
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
943
|
+
cumulative_score: number,
|
|
944
|
+
frame_max_distance: number,
|
|
945
|
+
had_recent_input: boolean,
|
|
946
|
+
impacted_nodes: TraceImpactedNode[] | undefined,
|
|
947
|
+
is_main_frame: boolean,
|
|
948
|
+
overall_max_distance: number,
|
|
949
|
+
region_rects: TraceRect[],
|
|
950
|
+
/** @deprecated This value will incorrectly overreport for shifts within an iframe. */
|
|
951
|
+
score: number,
|
|
952
|
+
/** This is the preferred "score", used for CLS. If `is_main_frame` is true, `score` and `weighted_score_delta` will be equal. But if the shift is from an iframe, `weighted_score_delta` will be appropriately reduced to account for the viewport size of that iframe. https://wicg.github.io/layout-instability/#subframe-weighting-factor and b/275509162 */
|
|
953
|
+
weighted_score_delta: number,
|
|
954
|
+
navigationId?: string,
|
|
955
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
956
|
+
};
|
|
957
|
+
export interface LayoutShift extends Instant {
|
|
958
|
+
name: Name.LAYOUT_SHIFT;
|
|
959
|
+
normalized?: boolean;
|
|
960
|
+
args: Args&{
|
|
961
|
+
frame: string,
|
|
962
|
+
data?: LayoutShiftData,
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
interface LayoutShiftSessionWindowData {
|
|
967
|
+
// The sum of the weighted score of all the shifts
|
|
968
|
+
// that belong to a session window.
|
|
969
|
+
cumulativeWindowScore: number;
|
|
970
|
+
// A consecutive generated in the frontend to
|
|
971
|
+
// to identify a session window.
|
|
972
|
+
id: number;
|
|
973
|
+
}
|
|
974
|
+
export interface LayoutShiftParsedData {
|
|
975
|
+
/** screenshot taken before and after this shift. Before *should* always exist, but after might not at the end of a trace. */
|
|
976
|
+
screenshots: {before: LegacySyntheticScreenshot|Screenshot|null, after: LegacySyntheticScreenshot|Screenshot|null};
|
|
977
|
+
timeFromNavigation?: Micro;
|
|
978
|
+
// The sum of the weighted scores of the shifts that
|
|
979
|
+
// belong to a session window up until this shift
|
|
980
|
+
// (inclusive).
|
|
981
|
+
cumulativeWeightedScoreInWindow: number;
|
|
982
|
+
sessionWindowData: LayoutShiftSessionWindowData;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
export interface SyntheticLayoutShift extends Omit<LayoutShift, 'name'>, SyntheticBased<Phase.INSTANT> {
|
|
986
|
+
name: Name.SYNTHETIC_LAYOUT_SHIFT;
|
|
987
|
+
rawSourceEvent: LayoutShift;
|
|
988
|
+
args: Args&{
|
|
989
|
+
frame: string,
|
|
990
|
+
data?: LayoutShiftData&{
|
|
991
|
+
rawEvent: LayoutShift,
|
|
992
|
+
},
|
|
993
|
+
};
|
|
994
|
+
parsedData: LayoutShiftParsedData;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
export const NO_NAVIGATION = 'NO_NAVIGATION';
|
|
998
|
+
|
|
999
|
+
/**
|
|
1000
|
+
* This maybe be a navigation id string from Chrome, or `NO_NAVIGATION`, which represents the
|
|
1001
|
+
* portion of the trace for which we don't have any navigation event for (as it happeneded prior
|
|
1002
|
+
* to the trace start).
|
|
1003
|
+
*/
|
|
1004
|
+
export type NavigationId = string|typeof NO_NAVIGATION;
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* This is a synthetic Layout shift cluster. The rawSourceEvent is the worst layout shift event
|
|
1008
|
+
* in the cluster.
|
|
1009
|
+
*/
|
|
1010
|
+
export interface SyntheticLayoutShiftCluster extends SyntheticBased<Phase.COMPLETE> {
|
|
1011
|
+
name: 'SyntheticLayoutShiftCluster';
|
|
1012
|
+
clusterWindow: TraceWindowMicro;
|
|
1013
|
+
clusterCumulativeScore: number;
|
|
1014
|
+
events: SyntheticLayoutShift[];
|
|
1015
|
+
// For convenience we split apart the cluster into good, NI, and bad windows.
|
|
1016
|
+
// Since a cluster may remain in the good window, we mark NI and bad as being
|
|
1017
|
+
// possibly null.
|
|
1018
|
+
scoreWindows: {
|
|
1019
|
+
good: TraceWindowMicro,
|
|
1020
|
+
needsImprovement?: TraceWindowMicro,
|
|
1021
|
+
bad?: TraceWindowMicro,
|
|
1022
|
+
};
|
|
1023
|
+
// The last navigation that happened before this cluster.
|
|
1024
|
+
navigationId?: NavigationId;
|
|
1025
|
+
worstShiftEvent?: Event;
|
|
1026
|
+
// This is the start of the cluster: the start of the first layout shift of the cluster.
|
|
1027
|
+
ts: Micro;
|
|
1028
|
+
// The duration of the cluster. This should include up until the end of the last
|
|
1029
|
+
// layout shift in this cluster.
|
|
1030
|
+
dur: Micro;
|
|
1031
|
+
cat: '';
|
|
1032
|
+
ph: Phase.COMPLETE;
|
|
1033
|
+
pid: ProcessID;
|
|
1034
|
+
tid: ThreadID;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
export type FetchPriorityHint = 'low'|'high'|'auto';
|
|
1038
|
+
export type RenderBlocking =
|
|
1039
|
+
'blocking'|'non_blocking'|'in_body_parser_blocking'|'potentially_blocking'|'dynamically_injected_non_blocking';
|
|
1040
|
+
|
|
1041
|
+
export interface Initiator {
|
|
1042
|
+
type: Protocol.Network.InitiatorType;
|
|
1043
|
+
fetchType: string;
|
|
1044
|
+
columnNumber?: number;
|
|
1045
|
+
lineNumber?: number;
|
|
1046
|
+
url?: string;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
export interface ResourceSendRequest extends Instant {
|
|
1050
|
+
name: 'ResourceSendRequest';
|
|
1051
|
+
args: Args&{
|
|
1052
|
+
data: ArgsData & {
|
|
1053
|
+
frame: string,
|
|
1054
|
+
requestId: string,
|
|
1055
|
+
url: string,
|
|
1056
|
+
priority: Protocol.Network.ResourcePriority,
|
|
1057
|
+
/** Added Feb 2024. https://crrev.com/c/5277583 */
|
|
1058
|
+
resourceType?: Protocol.Network.ResourceType,
|
|
1059
|
+
/** Added Feb 2024. https://crrev.com/c/5297615 */
|
|
1060
|
+
fetchPriorityHint?: FetchPriorityHint,
|
|
1061
|
+
// TODO(crbug.com/1457985): change requestMethod to enum when confirm in the backend code.
|
|
1062
|
+
requestMethod?: string,
|
|
1063
|
+
renderBlocking?: RenderBlocking,
|
|
1064
|
+
initiator?: Initiator,
|
|
1065
|
+
isLinkPreload?: boolean,
|
|
1066
|
+
},
|
|
1067
|
+
};
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
export interface ResourceChangePriority extends Instant {
|
|
1071
|
+
name: 'ResourceChangePriority';
|
|
1072
|
+
args: Args&{
|
|
1073
|
+
data: ArgsData & {
|
|
1074
|
+
requestId: string,
|
|
1075
|
+
priority: Protocol.Network.ResourcePriority,
|
|
1076
|
+
},
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
/** Only sent for navigations. https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/devtools_instrumentation.cc;l=1612-1647;drc=ec7daf93d0479b758610c75f4e146fd4d2d6ed2b */
|
|
1081
|
+
export interface ResourceWillSendRequest extends Instant {
|
|
1082
|
+
name: Name.RESOURCE_WILL_SEND_REQUEST;
|
|
1083
|
+
args: Args&{
|
|
1084
|
+
data: ArgsData & {
|
|
1085
|
+
requestId: string,
|
|
1086
|
+
},
|
|
1087
|
+
};
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
export interface ResourceFinish extends Instant {
|
|
1091
|
+
name: 'ResourceFinish';
|
|
1092
|
+
args: Args&{
|
|
1093
|
+
data: ArgsData & {
|
|
1094
|
+
decodedBodyLength: number,
|
|
1095
|
+
didFail: boolean,
|
|
1096
|
+
encodedDataLength: number,
|
|
1097
|
+
finishTime: Seconds,
|
|
1098
|
+
requestId: string,
|
|
1099
|
+
},
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
export interface ResourceReceivedData extends Instant {
|
|
1104
|
+
name: 'ResourceReceivedData';
|
|
1105
|
+
args: Args&{
|
|
1106
|
+
data: ArgsData & {
|
|
1107
|
+
encodedDataLength: number,
|
|
1108
|
+
frame: string,
|
|
1109
|
+
requestId: string,
|
|
1110
|
+
},
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
/** See https://mdn.github.io/shared-assets/images/diagrams/api/performance/timestamp-diagram.svg */
|
|
1115
|
+
interface ResourceReceiveResponseTimingData {
|
|
1116
|
+
connectEnd: Milli;
|
|
1117
|
+
connectStart: Milli;
|
|
1118
|
+
dnsEnd: Milli;
|
|
1119
|
+
dnsStart: Milli;
|
|
1120
|
+
proxyEnd: Milli;
|
|
1121
|
+
proxyStart: Milli;
|
|
1122
|
+
pushEnd: Milli;
|
|
1123
|
+
pushStart: Milli;
|
|
1124
|
+
receiveHeadersEnd: Milli;
|
|
1125
|
+
/** M116. */
|
|
1126
|
+
receiveHeadersStart?: Milli;
|
|
1127
|
+
/** When the network service is about to handle a request, ie. just before going to the HTTP cache or going to the network for DNS/connection setup. */
|
|
1128
|
+
requestTime: Seconds;
|
|
1129
|
+
sendEnd: Milli;
|
|
1130
|
+
sendStart: Milli;
|
|
1131
|
+
sslEnd: Milli;
|
|
1132
|
+
sslStart: Milli;
|
|
1133
|
+
workerReady: Milli;
|
|
1134
|
+
workerStart: Milli;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
export interface ResourceReceiveResponse extends Instant {
|
|
1138
|
+
name: 'ResourceReceiveResponse';
|
|
1139
|
+
args: Args&{
|
|
1140
|
+
data: ArgsData & {
|
|
1141
|
+
/**
|
|
1142
|
+
* This is the protocol used to resolve the request.
|
|
1143
|
+
*
|
|
1144
|
+
* Note, this is not the same as URL.protocol.
|
|
1145
|
+
*
|
|
1146
|
+
* Example values (not exhaustive): http/0.9, http/1.0, http/1.1, http, h2, h3-Q050, data, blob
|
|
1147
|
+
*/
|
|
1148
|
+
protocol: string,
|
|
1149
|
+
encodedDataLength: number,
|
|
1150
|
+
frame: string,
|
|
1151
|
+
fromCache: boolean,
|
|
1152
|
+
fromServiceWorker: boolean,
|
|
1153
|
+
mimeType: string,
|
|
1154
|
+
requestId: string,
|
|
1155
|
+
responseTime: Milli,
|
|
1156
|
+
statusCode: number,
|
|
1157
|
+
// Some cached events don't have this field
|
|
1158
|
+
connectionId: number,
|
|
1159
|
+
connectionReused: boolean,
|
|
1160
|
+
timing?: ResourceReceiveResponseTimingData,
|
|
1161
|
+
headers?: Array<{name: string, value: string}>,
|
|
1162
|
+
},
|
|
1163
|
+
};
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
export interface ResourceMarkAsCached extends Instant {
|
|
1167
|
+
name: 'ResourceMarkAsCached';
|
|
1168
|
+
args: Args&{
|
|
1169
|
+
data: ArgsData & {
|
|
1170
|
+
requestId: string,
|
|
1171
|
+
},
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
export const enum LayoutInvalidationReason {
|
|
1176
|
+
SIZE_CHANGED = 'Size changed',
|
|
1177
|
+
ATTRIBUTE = 'Attribute',
|
|
1178
|
+
ADDED_TO_LAYOUT = 'Added to layout',
|
|
1179
|
+
SCROLLBAR_CHANGED = 'Scrollbar changed',
|
|
1180
|
+
REMOVED_FROM_LAYOUT = 'Removed from layout',
|
|
1181
|
+
STYLE_CHANGED = 'Style changed',
|
|
1182
|
+
FONTS_CHANGED = 'Fonts changed',
|
|
1183
|
+
UNKNOWN = 'Unknown',
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
export interface LayoutInvalidationTracking extends Instant {
|
|
1187
|
+
name: Name.LAYOUT_INVALIDATION_TRACKING;
|
|
1188
|
+
args: Args&{
|
|
1189
|
+
data: ArgsData & {
|
|
1190
|
+
frame: string,
|
|
1191
|
+
nodeId: Protocol.DOM.BackendNodeId,
|
|
1192
|
+
reason: LayoutInvalidationReason,
|
|
1193
|
+
nodeName?: string,
|
|
1194
|
+
},
|
|
1195
|
+
};
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
export interface ScheduleStyleInvalidationTracking extends Instant {
|
|
1199
|
+
name: Name.SCHEDULE_STYLE_INVALIDATION_TRACKING;
|
|
1200
|
+
args: Args&{
|
|
1201
|
+
data: ArgsData & {
|
|
1202
|
+
frame: string,
|
|
1203
|
+
nodeId: Protocol.DOM.BackendNodeId,
|
|
1204
|
+
invalidationSet?: string,
|
|
1205
|
+
invalidatedSelectorId?: string,
|
|
1206
|
+
reason?: LayoutInvalidationReason,
|
|
1207
|
+
changedClass?: string,
|
|
1208
|
+
changedAttribute?: string,
|
|
1209
|
+
changedId?: string,
|
|
1210
|
+
nodeName?: string,
|
|
1211
|
+
stackTrace?: CallFrame[],
|
|
1212
|
+
},
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
export function isScheduleStyleInvalidationTracking(event: Event): event is ScheduleStyleInvalidationTracking {
|
|
1216
|
+
return event.name === Name.SCHEDULE_STYLE_INVALIDATION_TRACKING;
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
export const enum StyleRecalcInvalidationReason {
|
|
1220
|
+
ANIMATION = 'Animation',
|
|
1221
|
+
RELATED_STYLE_RULE = 'Related style rule',
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
export interface StyleRecalcInvalidationTracking extends Instant {
|
|
1225
|
+
name: Name.STYLE_RECALC_INVALIDATION_TRACKING;
|
|
1226
|
+
args: Args&{
|
|
1227
|
+
data: ArgsData & {
|
|
1228
|
+
frame: string,
|
|
1229
|
+
nodeId: Protocol.DOM.BackendNodeId,
|
|
1230
|
+
reason: StyleRecalcInvalidationReason,
|
|
1231
|
+
subtree: boolean,
|
|
1232
|
+
nodeName?: string,
|
|
1233
|
+
extraData?: string,
|
|
1234
|
+
},
|
|
1235
|
+
};
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
export function isStyleRecalcInvalidationTracking(event: Event): event is StyleRecalcInvalidationTracking {
|
|
1239
|
+
return event.name === Name.STYLE_RECALC_INVALIDATION_TRACKING;
|
|
1240
|
+
}
|
|
1241
|
+
export interface StyleInvalidatorInvalidationTracking extends Instant {
|
|
1242
|
+
name: Name.STYLE_INVALIDATOR_INVALIDATION_TRACKING;
|
|
1243
|
+
args: Args&{
|
|
1244
|
+
data: ArgsData & {
|
|
1245
|
+
frame: string,
|
|
1246
|
+
nodeId: Protocol.DOM.BackendNodeId,
|
|
1247
|
+
reason: string,
|
|
1248
|
+
invalidationList: Array<{id: string, classes?: string[]}>,
|
|
1249
|
+
subtree: boolean,
|
|
1250
|
+
nodeName?: string,
|
|
1251
|
+
extraData?: string,
|
|
1252
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1253
|
+
selectors?: Array<{selector: string, style_sheet_id: string}>,
|
|
1254
|
+
},
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
export function isStyleInvalidatorInvalidationTracking(event: Event): event is StyleInvalidatorInvalidationTracking {
|
|
1258
|
+
return event.name === Name.STYLE_INVALIDATOR_INVALIDATION_TRACKING;
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
export interface BeginCommitCompositorFrame extends Instant {
|
|
1262
|
+
name: Name.BEGIN_COMMIT_COMPOSITOR_FRAME;
|
|
1263
|
+
args: Args&{
|
|
1264
|
+
frame: string,
|
|
1265
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1266
|
+
is_mobile_optimized: boolean,
|
|
1267
|
+
};
|
|
1268
|
+
}
|
|
1269
|
+
export function isBeginCommitCompositorFrame(event: Event): event is BeginCommitCompositorFrame {
|
|
1270
|
+
return event.name === Name.BEGIN_COMMIT_COMPOSITOR_FRAME;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
export interface ParseMetaViewport extends Instant {
|
|
1274
|
+
name: Name.PARSE_META_VIEWPORT;
|
|
1275
|
+
args: Args&{
|
|
1276
|
+
data: {
|
|
1277
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1278
|
+
node_id: Protocol.DOM.BackendNodeId,
|
|
1279
|
+
content: string,
|
|
1280
|
+
frame?: string,
|
|
1281
|
+
},
|
|
1282
|
+
};
|
|
1283
|
+
}
|
|
1284
|
+
export function isParseMetaViewport(event: Event): event is ParseMetaViewport {
|
|
1285
|
+
return event.name === Name.PARSE_META_VIEWPORT;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
export interface LinkPreconnect extends Instant {
|
|
1289
|
+
name: Name.LINK_PRECONNECT;
|
|
1290
|
+
args: Args&{
|
|
1291
|
+
data: {
|
|
1292
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1293
|
+
node_id: Protocol.DOM.BackendNodeId,
|
|
1294
|
+
url: string,
|
|
1295
|
+
frame?: string,
|
|
1296
|
+
},
|
|
1297
|
+
};
|
|
1298
|
+
}
|
|
1299
|
+
export function isLinkPreconnect(event: Event): event is LinkPreconnect {
|
|
1300
|
+
return event.name === Name.LINK_PRECONNECT;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
export interface ScheduleStyleRecalculation extends Instant {
|
|
1304
|
+
name: Name.SCHEDULE_STYLE_RECALCULATION;
|
|
1305
|
+
args: Args&{
|
|
1306
|
+
data: {
|
|
1307
|
+
frame: string,
|
|
1308
|
+
reason?: StyleRecalcInvalidationReason,
|
|
1309
|
+
subtree?: boolean,
|
|
1310
|
+
nodeId?: Protocol.DOM.BackendNodeId,
|
|
1311
|
+
},
|
|
1312
|
+
};
|
|
1313
|
+
}
|
|
1314
|
+
export function isScheduleStyleRecalculation(event: Event): event is ScheduleStyleRecalculation {
|
|
1315
|
+
return event.name === Name.SCHEDULE_STYLE_RECALCULATION;
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
export interface RenderFrameImplCreateChildFrame extends Event {
|
|
1319
|
+
name: Name.RENDER_FRAME_IMPL_CREATE_CHILD_FRAME;
|
|
1320
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
1321
|
+
args: Args&{
|
|
1322
|
+
child_frame_token: string,
|
|
1323
|
+
frame_token: string,
|
|
1324
|
+
};
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
export function isRenderFrameImplCreateChildFrame(event: Event): event is RenderFrameImplCreateChildFrame {
|
|
1328
|
+
return event.name === Name.RENDER_FRAME_IMPL_CREATE_CHILD_FRAME;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
export interface LayoutImageUnsized extends Event {
|
|
1332
|
+
name: Name.LAYOUT_IMAGE_UNSIZED;
|
|
1333
|
+
args: Args&{
|
|
1334
|
+
data: {
|
|
1335
|
+
nodeId: Protocol.DOM.BackendNodeId,
|
|
1336
|
+
frameId: string,
|
|
1337
|
+
},
|
|
1338
|
+
};
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
export function isLayoutImageUnsized(event: Event): event is LayoutImageUnsized {
|
|
1342
|
+
return event.name === Name.LAYOUT_IMAGE_UNSIZED;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
export interface PrePaint extends Complete {
|
|
1346
|
+
name: 'PrePaint';
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
export interface PairableAsync extends Event {
|
|
1350
|
+
ph: Phase.ASYNC_NESTABLE_START|Phase.ASYNC_NESTABLE_END|Phase.ASYNC_NESTABLE_INSTANT;
|
|
1351
|
+
// The id2 field gives flexibility to explicitly specify if an event
|
|
1352
|
+
// id is global among processes or process local. However not all
|
|
1353
|
+
// events use it, so both kind of ids need to be marked as optional.
|
|
1354
|
+
id2?: {local?: string, global?: string};
|
|
1355
|
+
id?: string;
|
|
1356
|
+
}
|
|
1357
|
+
export interface PairableAsyncBegin extends PairableAsync {
|
|
1358
|
+
ph: Phase.ASYNC_NESTABLE_START;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
export interface PairableAsyncInstant extends PairableAsync {
|
|
1362
|
+
ph: Phase.ASYNC_NESTABLE_INSTANT;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
export interface PairableAsyncEnd extends PairableAsync {
|
|
1366
|
+
ph: Phase.ASYNC_NESTABLE_END;
|
|
1367
|
+
}
|
|
1368
|
+
export function isPairableAsyncBegin(e: Event): e is PairableAsyncBegin {
|
|
1369
|
+
return e.ph === Phase.ASYNC_NESTABLE_START;
|
|
1370
|
+
}
|
|
1371
|
+
export function isPairableAsyncEnd(e: Event): e is PairableAsyncEnd {
|
|
1372
|
+
return e.ph === Phase.ASYNC_NESTABLE_END;
|
|
1373
|
+
}
|
|
1374
|
+
export function isPairableAsyncInstant(e: Event): e is PairableAsyncInstant {
|
|
1375
|
+
return e.ph === Phase.ASYNC_NESTABLE_INSTANT;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
export interface AnimationFrame extends PairableAsync {
|
|
1379
|
+
name: Name.ANIMATION_FRAME;
|
|
1380
|
+
args?: AnimationFrameArgs;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
export type AnimationFrameArgs = Args&{
|
|
1384
|
+
animation_frame_timing_info: {
|
|
1385
|
+
blocking_duration_ms: number,
|
|
1386
|
+
duration_ms: number,
|
|
1387
|
+
num_scripts: number,
|
|
1388
|
+
},
|
|
1389
|
+
id: string,
|
|
1390
|
+
};
|
|
1391
|
+
|
|
1392
|
+
export interface AnimationFrameAsyncStart extends AnimationFrame {
|
|
1393
|
+
ph: Phase.ASYNC_NESTABLE_START;
|
|
1394
|
+
}
|
|
1395
|
+
export interface AnimationFrameAsyncEnd extends AnimationFrame {
|
|
1396
|
+
ph: Phase.ASYNC_NESTABLE_END;
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
export function isAnimationFrameAsyncStart(data: Event): data is AnimationFrameAsyncStart {
|
|
1400
|
+
return data.name === Name.ANIMATION_FRAME && data.ph === Phase.ASYNC_NESTABLE_START;
|
|
1401
|
+
}
|
|
1402
|
+
export function isAnimationFrameAsyncEnd(data: Event): data is AnimationFrameAsyncEnd {
|
|
1403
|
+
return data.name === Name.ANIMATION_FRAME && data.ph === Phase.ASYNC_NESTABLE_END;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
export interface AnimationFramePresentation extends Event {
|
|
1407
|
+
name: Name.ANIMATION_FRAME_PRESENTATION;
|
|
1408
|
+
ph: Phase.ASYNC_NESTABLE_INSTANT;
|
|
1409
|
+
args?: Args&{
|
|
1410
|
+
id: string,
|
|
1411
|
+
};
|
|
1412
|
+
}
|
|
1413
|
+
export function isAnimationFramePresentation(data: Event): data is AnimationFramePresentation {
|
|
1414
|
+
return data.name === Name.ANIMATION_FRAME_PRESENTATION;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
export interface UserTiming extends Event {
|
|
1418
|
+
id2?: {local?: string, global?: string};
|
|
1419
|
+
id?: string;
|
|
1420
|
+
cat: 'blink.user_timing';
|
|
1421
|
+
// Note that the timestamp for user timing trace events is set to the
|
|
1422
|
+
// start time passed by the user at the call site of the timing (based
|
|
1423
|
+
// on the UserTiming spec).
|
|
1424
|
+
// https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/timing/performance_user_timing.cc;l=236;drc=494419358caf690316f160a1f27d9e771a14c033
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
export interface DomLoading extends UserTiming {
|
|
1428
|
+
name: Name.DOM_LOADING;
|
|
1429
|
+
args: Args&{
|
|
1430
|
+
frame?: string,
|
|
1431
|
+
};
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
export interface BeginRemoteFontLoad extends UserTiming {
|
|
1435
|
+
name: Name.BEGIN_REMOTE_FONT_LOAD;
|
|
1436
|
+
args: Args&{
|
|
1437
|
+
display: string,
|
|
1438
|
+
id: number,
|
|
1439
|
+
url?: string,
|
|
1440
|
+
};
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
export interface RemoteFontLoaded extends UserTiming {
|
|
1444
|
+
name: Name.REMOTE_FONT_LOADED;
|
|
1445
|
+
args: Args&{
|
|
1446
|
+
url: string,
|
|
1447
|
+
name: string,
|
|
1448
|
+
};
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
export type PairableUserTiming = UserTiming&PairableAsync;
|
|
1452
|
+
|
|
1453
|
+
export interface PerformanceMeasureBegin extends PairableUserTiming {
|
|
1454
|
+
args: Args&{
|
|
1455
|
+
detail?: string,
|
|
1456
|
+
callTime?: Micro,
|
|
1457
|
+
traceId?: number,
|
|
1458
|
+
};
|
|
1459
|
+
ph: Phase.ASYNC_NESTABLE_START;
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
export type PerformanceMeasureEnd = PairableUserTiming&PairableAsyncEnd;
|
|
1463
|
+
export type PerformanceMeasure = PerformanceMeasureBegin|PerformanceMeasureEnd;
|
|
1464
|
+
|
|
1465
|
+
export interface PerformanceMark extends UserTiming {
|
|
1466
|
+
args: Args&{
|
|
1467
|
+
data?: ArgsData & {
|
|
1468
|
+
detail?: string,
|
|
1469
|
+
callTime?: Micro,
|
|
1470
|
+
},
|
|
1471
|
+
};
|
|
1472
|
+
ph: Phase.INSTANT|Phase.MARK|Phase.ASYNC_NESTABLE_INSTANT;
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
export interface ConsoleTimeBegin extends PairableAsyncBegin {
|
|
1476
|
+
cat: 'blink.console';
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
export interface ConsoleTimeEnd extends PairableAsyncEnd {
|
|
1480
|
+
cat: 'blink.console';
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
export type ConsoleTime = ConsoleTimeBegin|ConsoleTimeEnd;
|
|
1484
|
+
|
|
1485
|
+
export interface ConsoleTimeStamp extends Event {
|
|
1486
|
+
cat: 'devtools.timeline';
|
|
1487
|
+
name: Name.TIME_STAMP;
|
|
1488
|
+
ph: Phase.INSTANT;
|
|
1489
|
+
args: Args&{
|
|
1490
|
+
data?: ArgsData & {
|
|
1491
|
+
// The console.timeStamp allows to pass integers as values as well
|
|
1492
|
+
// as strings
|
|
1493
|
+
message: string,
|
|
1494
|
+
name?: string|number,
|
|
1495
|
+
start?: string|number,
|
|
1496
|
+
end?: string|number,
|
|
1497
|
+
track?: string|number,
|
|
1498
|
+
trackGroup?: string|number,
|
|
1499
|
+
color?: string|number,
|
|
1500
|
+
devtools?: string,
|
|
1501
|
+
sampleTraceId?: number,
|
|
1502
|
+
},
|
|
1503
|
+
};
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
export interface SyntheticConsoleTimeStamp extends Event, SyntheticBased {
|
|
1507
|
+
cat: 'disabled-by-default-v8.inspector';
|
|
1508
|
+
ph: Phase.COMPLETE;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
export interface UserTimingMeasure extends Event {
|
|
1512
|
+
cat: 'devtools.timeline';
|
|
1513
|
+
ph: Phase.COMPLETE;
|
|
1514
|
+
name: Name.USER_TIMING_MEASURE;
|
|
1515
|
+
args: Args&{
|
|
1516
|
+
sampleTraceId: number,
|
|
1517
|
+
traceId: number,
|
|
1518
|
+
};
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
/**
|
|
1522
|
+
* ChromeFrameReporter args for PipelineReporter event.
|
|
1523
|
+
* Matching proto: https://source.chromium.org/chromium/chromium/src/+/main:third_party/perfetto/protos/perfetto/trace/track_event/chrome_frame_reporter.proto
|
|
1524
|
+
*/
|
|
1525
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
1526
|
+
interface ChromeFrameReporter {
|
|
1527
|
+
state: State;
|
|
1528
|
+
enum: FrameDropReason;
|
|
1529
|
+
/** The reason is set only if |state| is not |STATE_UPDATED_ALL|. */
|
|
1530
|
+
reason: FrameDropReason;
|
|
1531
|
+
frame_source: number;
|
|
1532
|
+
/**
|
|
1533
|
+
* Identifies a BeginFrameArgs (along with the source_id).
|
|
1534
|
+
* See comments in components/viz/common/frame_sinks/begin_frame_args.h.
|
|
1535
|
+
*/
|
|
1536
|
+
frame_sequence: number;
|
|
1537
|
+
/**
|
|
1538
|
+
* If this is a dropped frame (i.e. if |state| is set to |STATE_DROPPED| or
|
|
1539
|
+
* |STATE_PRESENTED_PARTIAL|), then indicates whether this frame impacts smoothness.
|
|
1540
|
+
*/
|
|
1541
|
+
affects_smoothness: boolean;
|
|
1542
|
+
/** The type of active scroll. */
|
|
1543
|
+
scroll_state: ScrollState;
|
|
1544
|
+
/** If any main thread animation is active during this frame. */
|
|
1545
|
+
has_main_animation: boolean;
|
|
1546
|
+
/** If any compositor thread animation is active during this frame. */
|
|
1547
|
+
has_compositor_animation: boolean;
|
|
1548
|
+
/** If any touch-driven UX (not scroll) is active during this frame. */
|
|
1549
|
+
has_smooth_input_main: boolean;
|
|
1550
|
+
/**
|
|
1551
|
+
* Whether the frame contained any missing content (i.e. whether there was
|
|
1552
|
+
* checkerboarding in the frame).
|
|
1553
|
+
*/
|
|
1554
|
+
has_missing_content: boolean;
|
|
1555
|
+
/** The id of layer_tree_host that the frame has been produced for. */
|
|
1556
|
+
layer_tree_host_id: number;
|
|
1557
|
+
/** If total latency of PipelineReporter exceeds a certain limit. */
|
|
1558
|
+
has_high_latency: boolean;
|
|
1559
|
+
/**
|
|
1560
|
+
* Indicate if the frame is "FORKED" (i.e. a PipelineReporter event starts at
|
|
1561
|
+
* the same frame sequence as another PipelineReporter) or "BACKFILL"
|
|
1562
|
+
* (i.e. dropped frames when there are no partial compositor updates).
|
|
1563
|
+
*/
|
|
1564
|
+
frame_type: FrameType;
|
|
1565
|
+
/**
|
|
1566
|
+
* The breakdown stage of PipelineReporter that is most likely accountable for
|
|
1567
|
+
* high latency.
|
|
1568
|
+
*/
|
|
1569
|
+
high_latency_contribution_stage: string[];
|
|
1570
|
+
}
|
|
1571
|
+
const enum State {
|
|
1572
|
+
/** The frame did not have any updates to present. **/
|
|
1573
|
+
STATE_NO_UPDATE_DESIRED = 'STATE_NO_UPDATE_DESIRED',
|
|
1574
|
+
/**
|
|
1575
|
+
* The frame presented all the desired updates (i.e. any updates requested
|
|
1576
|
+
* from both the compositor thread and main-threads were handled). *
|
|
1577
|
+
*/
|
|
1578
|
+
STATE_PRESENTED_ALL = 'STATE_PRESENTED_ALL',
|
|
1579
|
+
/**
|
|
1580
|
+
* The frame was presented with some updates, but also missed some updates
|
|
1581
|
+
* (e.g. missed updates from the main-thread, but included updates from the
|
|
1582
|
+
* compositor thread). *
|
|
1583
|
+
*/
|
|
1584
|
+
STATE_PRESENTED_PARTIAL = 'STATE_PRESENTED_PARTIAL',
|
|
1585
|
+
/**
|
|
1586
|
+
* The frame was dropped, i.e. some updates were desired for the frame, but
|
|
1587
|
+
* was not presented. *
|
|
1588
|
+
*/
|
|
1589
|
+
STATE_DROPPED = 'STATE_DROPPED',
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
const enum FrameDropReason {
|
|
1593
|
+
REASON_UNSPECIFIED = 'REASON_UNSPECIFIED',
|
|
1594
|
+
/**
|
|
1595
|
+
* Frame was dropped by the display-compositor.
|
|
1596
|
+
* The display-compositor may drop a frame some times (e.g. the frame missed
|
|
1597
|
+
* the deadline, or was blocked on surface-sync, etc.) *
|
|
1598
|
+
*/
|
|
1599
|
+
REASON_DISPLAY_COMPOSITOR = 'REASON_DISPLAY_COMPOSITOR',
|
|
1600
|
+
/**
|
|
1601
|
+
* Frame was dropped because of the main-thread.
|
|
1602
|
+
* The main-thread may cause a frame to be dropped, e.g. if the main-thread
|
|
1603
|
+
* is running expensive javascript, or doing a lot of layout updates, etc. *
|
|
1604
|
+
*/
|
|
1605
|
+
REASON_MAIN_THREAD = 'REASON_MAIN_THREAD',
|
|
1606
|
+
/**
|
|
1607
|
+
* Frame was dropped by the client compositor.
|
|
1608
|
+
* The client compositor can drop some frames too (e.g. attempting to
|
|
1609
|
+
* recover latency, missing the deadline, etc.). *
|
|
1610
|
+
*/
|
|
1611
|
+
REASON_CLIENT_COMPOSITOR = 'REASON_CLIENT_COMPOSITOR',
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
const enum ScrollState {
|
|
1615
|
+
SCROLL_NONE = 'SCROLL_NONE',
|
|
1616
|
+
SCROLL_MAIN_THREAD = 'SCROLL_MAIN_THREAD',
|
|
1617
|
+
SCROLL_COMPOSITOR_THREAD = 'SCROLL_COMPOSITOR_THREAD',
|
|
1618
|
+
|
|
1619
|
+
/** Used when it can't be determined whether a scroll is in progress or not. */
|
|
1620
|
+
SCROLL_UNKNOWN = 'SCROLL_UNKNOWN',
|
|
1621
|
+
}
|
|
1622
|
+
const enum FrameType {
|
|
1623
|
+
FORKED = 'FORKED',
|
|
1624
|
+
BACKFILL = 'BACKFILL',
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
/**
|
|
1628
|
+
* TODO(crbug.com/409484302): Remove once Chrome migrates from
|
|
1629
|
+
* ChromeTrackEvent.chrome_frame_reporter to ChromeTrackEvent.frame_reporter.
|
|
1630
|
+
**/
|
|
1631
|
+
export interface OldChromeFrameReporterArgs {
|
|
1632
|
+
chrome_frame_reporter: ChromeFrameReporter;
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
export interface NewChromeFrameReporterArgs {
|
|
1636
|
+
frame_reporter: ChromeFrameReporter;
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
export interface PipelineReporter extends Event {
|
|
1640
|
+
id2?: {
|
|
1641
|
+
local?: string,
|
|
1642
|
+
};
|
|
1643
|
+
ph: Phase.ASYNC_NESTABLE_START|Phase.ASYNC_NESTABLE_END;
|
|
1644
|
+
args: Args&(OldChromeFrameReporterArgs|NewChromeFrameReporterArgs);
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
export function isPipelineReporter(event: Event): event is PipelineReporter {
|
|
1648
|
+
return event.name === Name.PIPELINE_REPORTER;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
/**
|
|
1652
|
+
* A type used for synthetic events created based on a raw trace event.
|
|
1653
|
+
* A branded type is used to ensure not all events can be typed as
|
|
1654
|
+
* SyntheticBased and prevent places different to the
|
|
1655
|
+
* SyntheticEventsManager from creating synthetic events. This is
|
|
1656
|
+
* because synthetic events need to be registered in order to resolve
|
|
1657
|
+
* serialized event keys into event objects, so we ensure events are
|
|
1658
|
+
* registered at the time they are created by the SyntheticEventsManager.
|
|
1659
|
+
**/
|
|
1660
|
+
export interface SyntheticBased<Ph extends Phase = Phase, T extends Event = Event> extends Event {
|
|
1661
|
+
ph: Ph;
|
|
1662
|
+
rawSourceEvent: T;
|
|
1663
|
+
_tag: 'SyntheticEntryTag';
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
export function isSyntheticBased(event: Event): event is SyntheticBased {
|
|
1667
|
+
return 'rawSourceEvent' in event;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
/**
|
|
1671
|
+
* Nestable async events with a duration are made up of two distinct
|
|
1672
|
+
* events: the begin, and the end. We need both of them to be able to
|
|
1673
|
+
* display the right information, so we create these synthetic events.
|
|
1674
|
+
**/
|
|
1675
|
+
export interface SyntheticEventPair<T extends PairableAsync = PairableAsync> extends SyntheticBased<Phase, T> {
|
|
1676
|
+
rawSourceEvent: T;
|
|
1677
|
+
name: T['name'];
|
|
1678
|
+
cat: T['cat'];
|
|
1679
|
+
id?: string;
|
|
1680
|
+
id2?: {local?: string, global?: string};
|
|
1681
|
+
|
|
1682
|
+
dur: Micro;
|
|
1683
|
+
args: Args&{
|
|
1684
|
+
data: {
|
|
1685
|
+
beginEvent: T & PairableAsyncBegin,
|
|
1686
|
+
endEvent: T&PairableAsyncEnd,
|
|
1687
|
+
instantEvents?: Array<T&PairableAsyncInstant>,
|
|
1688
|
+
},
|
|
1689
|
+
};
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
export type SyntheticPipelineReporterPair = SyntheticEventPair<PipelineReporter>;
|
|
1693
|
+
export type SyntheticAnimationFramePair = SyntheticEventPair<AnimationFrame>;
|
|
1694
|
+
|
|
1695
|
+
export type SyntheticUserTimingPair = SyntheticEventPair<PerformanceMeasure>;
|
|
1696
|
+
|
|
1697
|
+
export type SyntheticConsoleTimingPair = SyntheticEventPair<ConsoleTime>;
|
|
1698
|
+
|
|
1699
|
+
export type SyntheticAnimationPair = SyntheticEventPair<Animation>;
|
|
1700
|
+
|
|
1701
|
+
export interface SyntheticInteractionPair extends SyntheticEventPair<EventTimingBeginOrEnd> {
|
|
1702
|
+
// InteractionID and type are available within the beginEvent's data, but we
|
|
1703
|
+
// put them on the top level for ease of access.
|
|
1704
|
+
interactionId: number;
|
|
1705
|
+
type: string;
|
|
1706
|
+
// This is equivalent to startEvent.ts;
|
|
1707
|
+
ts: Micro;
|
|
1708
|
+
// This duration can be calculated via endEvent.ts - startEvent.ts, but we do
|
|
1709
|
+
// that and put it here to make it easier. This also makes these events
|
|
1710
|
+
// consistent with real events that have a dur field.
|
|
1711
|
+
dur: Micro;
|
|
1712
|
+
// These values are provided in the startEvent's args.data field as
|
|
1713
|
+
// millisecond values, but during the handler phase we parse these into
|
|
1714
|
+
// microseconds and put them on the top level for easy access.
|
|
1715
|
+
processingStart: Micro;
|
|
1716
|
+
processingEnd: Micro;
|
|
1717
|
+
// These 3 values represent the breakdown of the parts of an interaction:
|
|
1718
|
+
// 1. inputDelay: time from the user clicking to the input being handled
|
|
1719
|
+
inputDelay: Micro;
|
|
1720
|
+
// 2. mainThreadHandling: time spent processing the event handler
|
|
1721
|
+
mainThreadHandling: Micro;
|
|
1722
|
+
// 3. presentationDelay: delay between the event being processed and the frame being rendered
|
|
1723
|
+
presentationDelay: Micro;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
/**
|
|
1727
|
+
* A profile call created in the frontend from samples disguised as a
|
|
1728
|
+
* trace event.
|
|
1729
|
+
*
|
|
1730
|
+
* We store the sampleIndex, profileId and nodeId so that we can easily link
|
|
1731
|
+
* back a Synthetic Trace Entry to an individual Sample trace event within a
|
|
1732
|
+
* Profile.
|
|
1733
|
+
*
|
|
1734
|
+
* Because a sample contains a set of call frames representing the stack at the
|
|
1735
|
+
* point in time that the sample was created, we also have to store the ID of
|
|
1736
|
+
* the Node that points to the function call that this profile call represents.
|
|
1737
|
+
*/
|
|
1738
|
+
export interface SyntheticProfileCall extends Event {
|
|
1739
|
+
callFrame: Protocol.Runtime.CallFrame;
|
|
1740
|
+
nodeId: Protocol.integer;
|
|
1741
|
+
sampleIndex: number;
|
|
1742
|
+
profileId: ProfileID;
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
/**
|
|
1746
|
+
* A JS Sample reflects a single sample from the V8 CPU Profile
|
|
1747
|
+
*/
|
|
1748
|
+
export interface SyntheticJSSample extends Event {
|
|
1749
|
+
name: Name.JS_SAMPLE;
|
|
1750
|
+
args: Args&{
|
|
1751
|
+
data: ArgsData & {
|
|
1752
|
+
// Used to associate a stack sample with a trace event.
|
|
1753
|
+
stackTrace: Protocol.Runtime.CallFrame[],
|
|
1754
|
+
traceId?: number,
|
|
1755
|
+
},
|
|
1756
|
+
};
|
|
1757
|
+
ph: Phase.INSTANT;
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
export function isSyntheticInteraction(event: Event): event is SyntheticInteractionPair {
|
|
1761
|
+
return Boolean(
|
|
1762
|
+
'interactionId' in event && event.args?.data && 'beginEvent' in event.args.data && 'endEvent' in event.args.data);
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
// Events relating to frames.
|
|
1766
|
+
|
|
1767
|
+
export interface DrawFrame extends Instant {
|
|
1768
|
+
name: Name.DRAW_FRAME;
|
|
1769
|
+
args: Args&{
|
|
1770
|
+
layerTreeId: number,
|
|
1771
|
+
frameSeqId: number,
|
|
1772
|
+
};
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
export function isDrawFrame(event: Event): event is DrawFrame {
|
|
1776
|
+
// The extra check for INSTANT here is because in the past DrawFrame events had an ASYNC_NESTABLE_START and ASYNC_NESTABLE_END pair. We don't want to support those old events, so we have to check we are dealing with an instant event.
|
|
1777
|
+
return event.name === Name.DRAW_FRAME && event.ph === Phase.INSTANT;
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
export interface BeginFrame extends Instant {
|
|
1781
|
+
name: Name.BEGIN_FRAME;
|
|
1782
|
+
args: Args&{
|
|
1783
|
+
layerTreeId: number,
|
|
1784
|
+
frameSeqId: number,
|
|
1785
|
+
};
|
|
1786
|
+
}
|
|
1787
|
+
export function isBeginFrame(event: Event): event is BeginFrame {
|
|
1788
|
+
// Old traces did not have frameSeqId; but we do not want to support these.
|
|
1789
|
+
return Boolean(event.name === Name.BEGIN_FRAME && event.args && 'frameSeqId' in event.args);
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
export interface DroppedFrame extends Instant {
|
|
1793
|
+
name: Name.DROPPED_FRAME;
|
|
1794
|
+
args: Args&{
|
|
1795
|
+
layerTreeId: number,
|
|
1796
|
+
frameSeqId: number,
|
|
1797
|
+
hasPartialUpdate?: boolean,
|
|
1798
|
+
};
|
|
1799
|
+
}
|
|
1800
|
+
export function isDroppedFrame(event: Event): event is DroppedFrame {
|
|
1801
|
+
// Old traces did not have frameSeqId; but we do not want to support these.
|
|
1802
|
+
return Boolean(event.name === Name.DROPPED_FRAME && event.args && 'frameSeqId' in event.args);
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
export interface RequestMainThreadFrame extends Instant {
|
|
1806
|
+
name: Name.REQUEST_MAIN_THREAD_FRAME;
|
|
1807
|
+
args: Args&{
|
|
1808
|
+
layerTreeId: number,
|
|
1809
|
+
};
|
|
1810
|
+
}
|
|
1811
|
+
export function isRequestMainThreadFrame(event: Event): event is RequestMainThreadFrame {
|
|
1812
|
+
return event.name === Name.REQUEST_MAIN_THREAD_FRAME;
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
export interface BeginMainThreadFrame extends Instant {
|
|
1816
|
+
name: Name.BEGIN_MAIN_THREAD_FRAME;
|
|
1817
|
+
args: Args&{
|
|
1818
|
+
layerTreeId: number,
|
|
1819
|
+
data: ArgsData&{
|
|
1820
|
+
frameId?: number,
|
|
1821
|
+
},
|
|
1822
|
+
};
|
|
1823
|
+
}
|
|
1824
|
+
export function isBeginMainThreadFrame(event: Event): event is BeginMainThreadFrame {
|
|
1825
|
+
return event.name === Name.BEGIN_MAIN_THREAD_FRAME;
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
export interface NeedsBeginFrameChanged extends Instant {
|
|
1829
|
+
name: Name.NEEDS_BEGIN_FRAME_CHANGED;
|
|
1830
|
+
args: Args&{
|
|
1831
|
+
layerTreeId: number,
|
|
1832
|
+
data: ArgsData&{
|
|
1833
|
+
needsBeginFrame: number,
|
|
1834
|
+
},
|
|
1835
|
+
};
|
|
1836
|
+
}
|
|
1837
|
+
export function isNeedsBeginFrameChanged(event: Event): event is NeedsBeginFrameChanged {
|
|
1838
|
+
return event.name === Name.NEEDS_BEGIN_FRAME_CHANGED;
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
export interface Commit extends Instant {
|
|
1842
|
+
name: Name.COMMIT;
|
|
1843
|
+
args: Args&{
|
|
1844
|
+
layerTreeId: number,
|
|
1845
|
+
frameSeqId: number,
|
|
1846
|
+
};
|
|
1847
|
+
}
|
|
1848
|
+
export function isCommit(event: Event): event is Commit {
|
|
1849
|
+
// Old traces did not have frameSeqId; but we do not want to support these.
|
|
1850
|
+
return Boolean(event.name === Name.COMMIT && event.args && 'frameSeqId' in event.args);
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
export interface RasterTask extends Complete {
|
|
1854
|
+
name: Name.RASTER_TASK;
|
|
1855
|
+
args: Args&{
|
|
1856
|
+
tileData?: {
|
|
1857
|
+
layerId: number,
|
|
1858
|
+
sourceFrameNumber: number,
|
|
1859
|
+
tileId: {
|
|
1860
|
+
|
|
1861
|
+
id_ref: string,
|
|
1862
|
+
},
|
|
1863
|
+
tileResolution: string,
|
|
1864
|
+
},
|
|
1865
|
+
};
|
|
1866
|
+
}
|
|
1867
|
+
export function isRasterTask(event: Event): event is RasterTask {
|
|
1868
|
+
return event.name === Name.RASTER_TASK;
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
/** CompositeLayers has been replaced by "Commit", but we support both to not break old traces being imported. **/
|
|
1872
|
+
export interface CompositeLayers extends Instant {
|
|
1873
|
+
name: Name.COMPOSITE_LAYERS;
|
|
1874
|
+
args: Args&{
|
|
1875
|
+
layerTreeId: number,
|
|
1876
|
+
};
|
|
1877
|
+
}
|
|
1878
|
+
export function isCompositeLayers(event: Event): event is CompositeLayers {
|
|
1879
|
+
return event.name === Name.COMPOSITE_LAYERS;
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
export interface ActivateLayerTree extends Instant {
|
|
1883
|
+
name: Name.ACTIVATE_LAYER_TREE;
|
|
1884
|
+
args: Args&{
|
|
1885
|
+
layerTreeId: number,
|
|
1886
|
+
frameId: number,
|
|
1887
|
+
};
|
|
1888
|
+
}
|
|
1889
|
+
export function isActivateLayerTree(event: Event): event is ActivateLayerTree {
|
|
1890
|
+
return event.name === Name.ACTIVATE_LAYER_TREE;
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
export type InvalidationTrackingEvent = ScheduleStyleInvalidationTracking|StyleRecalcInvalidationTracking|
|
|
1894
|
+
StyleInvalidatorInvalidationTracking|LayoutInvalidationTracking;
|
|
1895
|
+
|
|
1896
|
+
export function isInvalidationTracking(event: Event): event is InvalidationTrackingEvent {
|
|
1897
|
+
return isScheduleStyleInvalidationTracking(event) || isStyleRecalcInvalidationTracking(event) ||
|
|
1898
|
+
isStyleInvalidatorInvalidationTracking(event) || isLayoutInvalidationTracking(event);
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
export interface DrawLazyPixelRef extends Instant {
|
|
1902
|
+
name: Name.DRAW_LAZY_PIXEL_REF;
|
|
1903
|
+
args?: Args&{
|
|
1904
|
+
|
|
1905
|
+
LazyPixelRef: number,
|
|
1906
|
+
};
|
|
1907
|
+
}
|
|
1908
|
+
export function isDrawLazyPixelRef(event: Event): event is DrawLazyPixelRef {
|
|
1909
|
+
return event.name === Name.DRAW_LAZY_PIXEL_REF;
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
export interface DecodeLazyPixelRef extends Instant {
|
|
1913
|
+
name: Name.DECODE_LAZY_PIXEL_REF;
|
|
1914
|
+
args?: Args&{
|
|
1915
|
+
|
|
1916
|
+
LazyPixelRef: number,
|
|
1917
|
+
};
|
|
1918
|
+
}
|
|
1919
|
+
export function isDecodeLazyPixelRef(event: Event): event is DecodeLazyPixelRef {
|
|
1920
|
+
return event.name === Name.DECODE_LAZY_PIXEL_REF;
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
export interface DecodeImage extends Complete {
|
|
1924
|
+
name: Name.DECODE_IMAGE;
|
|
1925
|
+
args: Args&{
|
|
1926
|
+
imageType: string,
|
|
1927
|
+
};
|
|
1928
|
+
}
|
|
1929
|
+
export function isDecodeImage(event: Event): event is DecodeImage {
|
|
1930
|
+
return event.name === Name.DECODE_IMAGE;
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
export const enum InvalidationEventType {
|
|
1934
|
+
StyleInvalidatorInvalidationTracking = 'StyleInvalidatorInvalidationTracking',
|
|
1935
|
+
StyleRecalcInvalidationTracking = 'StyleRecalcInvalidationTracking',
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
export interface SelectorTiming {
|
|
1939
|
+
'elapsed (us)': number;
|
|
1940
|
+
fast_reject_count: number;
|
|
1941
|
+
match_attempts: number;
|
|
1942
|
+
selector: string;
|
|
1943
|
+
style_sheet_id: string;
|
|
1944
|
+
match_count: number;
|
|
1945
|
+
invalidation_count: number;
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
export enum SelectorTimingsKey {
|
|
1949
|
+
Elapsed = 'elapsed (us)',
|
|
1950
|
+
RejectPercentage = 'reject_percentage',
|
|
1951
|
+
FastRejectCount = 'fast_reject_count',
|
|
1952
|
+
MatchAttempts = 'match_attempts',
|
|
1953
|
+
MatchCount = 'match_count',
|
|
1954
|
+
Selector = 'selector',
|
|
1955
|
+
StyleSheetId = 'style_sheet_id',
|
|
1956
|
+
InvalidationCount = 'invalidation_count',
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
export interface SelectorStats {
|
|
1960
|
+
selector_timings: SelectorTiming[];
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
export interface SelectorStats extends Complete {
|
|
1964
|
+
name: Name.SELECTOR_STATS;
|
|
1965
|
+
args: Args&{
|
|
1966
|
+
|
|
1967
|
+
selector_stats?: SelectorStats,
|
|
1968
|
+
};
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
export function isSelectorStats(event: Event): event is SelectorStats {
|
|
1972
|
+
return event.name === Name.SELECTOR_STATS;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
export interface RecalcStyle extends Complete {
|
|
1976
|
+
name: Name.RECALC_STYLE;
|
|
1977
|
+
args: Args&{
|
|
1978
|
+
elementCount: number,
|
|
1979
|
+
beginData?: {
|
|
1980
|
+
frame: string,
|
|
1981
|
+
sampleTraceId?: number,
|
|
1982
|
+
stackTrace?: CallFrame[],
|
|
1983
|
+
},
|
|
1984
|
+
};
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
/** The real trace event is called 'UpdateLayoutTree' but we've aliased it for convenience. */
|
|
1988
|
+
export function isRecalcStyle(event: Event): event is RecalcStyle {
|
|
1989
|
+
return event.name === Name.RECALC_STYLE;
|
|
1990
|
+
}
|
|
1991
|
+
|
|
1992
|
+
export interface Layout extends Complete {
|
|
1993
|
+
name: Name.LAYOUT;
|
|
1994
|
+
args: Args&{
|
|
1995
|
+
beginData: {
|
|
1996
|
+
frame: string,
|
|
1997
|
+
dirtyObjects: number,
|
|
1998
|
+
partialLayout: boolean,
|
|
1999
|
+
totalObjects: number,
|
|
2000
|
+
sampleTraceId?: number,
|
|
2001
|
+
stackTrace?: CallFrame[],
|
|
2002
|
+
},
|
|
2003
|
+
// endData is not reliably populated.
|
|
2004
|
+
// Why? TBD. https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/local_frame_view.cc;l=847-851;drc=8b6aaad8027390ce6b32d82d57328e93f34bb8e5
|
|
2005
|
+
endData?: {
|
|
2006
|
+
layoutRoots: Array<{
|
|
2007
|
+
depth: number,
|
|
2008
|
+
nodeId: Protocol.DOM.BackendNodeId,
|
|
2009
|
+
quads: number[][],
|
|
2010
|
+
}>,
|
|
2011
|
+
},
|
|
2012
|
+
};
|
|
2013
|
+
}
|
|
2014
|
+
export function isLayout(event: Event): event is Layout {
|
|
2015
|
+
return event.name === Name.LAYOUT && Boolean(event.args && 'beginData' in event.args);
|
|
2016
|
+
}
|
|
2017
|
+
export interface InvalidateLayout extends Instant {
|
|
2018
|
+
name: Name.INVALIDATE_LAYOUT;
|
|
2019
|
+
args: Args&{
|
|
2020
|
+
data: {
|
|
2021
|
+
frame: string,
|
|
2022
|
+
nodeId: Protocol.DOM.BackendNodeId,
|
|
2023
|
+
},
|
|
2024
|
+
};
|
|
2025
|
+
}
|
|
2026
|
+
export function isInvalidateLayout(event: Event): event is InvalidateLayout {
|
|
2027
|
+
return event.name === Name.INVALIDATE_LAYOUT;
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
export interface DebuggerAsyncTaskScheduled extends Event {
|
|
2031
|
+
name: Name.DEBUGGER_ASYNC_TASK_SCHEDULED;
|
|
2032
|
+
args: Args&{
|
|
2033
|
+
taskName: string,
|
|
2034
|
+
};
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
export function isDebuggerAsyncTaskScheduled(event: Event): event is DebuggerAsyncTaskScheduled {
|
|
2038
|
+
return event.name === Name.DEBUGGER_ASYNC_TASK_SCHEDULED;
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
export interface DebuggerAsyncTaskRun extends Event {
|
|
2042
|
+
name: Name.DEBUGGER_ASYNC_TASK_RUN;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
export function isDebuggerAsyncTaskRun(event: Event): event is DebuggerAsyncTaskRun {
|
|
2046
|
+
return event.name === Name.DEBUGGER_ASYNC_TASK_RUN;
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
export type ProfileID = Platform.Brand.Brand<string, 'profileIdTag'>;
|
|
2050
|
+
|
|
2051
|
+
export function ProfileID(value: string): ProfileID {
|
|
2052
|
+
return value as ProfileID;
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
export type CallFrameID = Platform.Brand.Brand<number, 'callFrameIdTag'>;
|
|
2056
|
+
|
|
2057
|
+
export function CallFrameID(value: number): CallFrameID {
|
|
2058
|
+
return value as CallFrameID;
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
export type SampleIndex = Platform.Brand.Brand<number, 'sampleIndexTag'>;
|
|
2062
|
+
|
|
2063
|
+
export function SampleIndex(value: number): SampleIndex {
|
|
2064
|
+
return value as SampleIndex;
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
export type ProcessID = Platform.Brand.Brand<number, 'processIdTag'>;
|
|
2068
|
+
|
|
2069
|
+
export function ProcessID(value: number): ProcessID {
|
|
2070
|
+
return value as ProcessID;
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
export type ThreadID = Platform.Brand.Brand<number, 'threadIdTag'>;
|
|
2074
|
+
|
|
2075
|
+
export function ThreadID(value: number): ThreadID {
|
|
2076
|
+
return value as ThreadID;
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
export type WorkerId = Platform.Brand.Brand<string, 'workerIdTag'>;
|
|
2080
|
+
|
|
2081
|
+
export function WorkerId(value: string): WorkerId {
|
|
2082
|
+
return value as WorkerId;
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2085
|
+
export function isComplete(event: Event): event is Complete {
|
|
2086
|
+
return event.ph === Phase.COMPLETE;
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
export function isBegin(event: Event): event is Begin {
|
|
2090
|
+
return event.ph === Phase.BEGIN;
|
|
2091
|
+
}
|
|
2092
|
+
|
|
2093
|
+
export function isEnd(event: Event): event is End {
|
|
2094
|
+
return event.ph === Phase.END;
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
export function isDispatch(event: Event): event is Dispatch {
|
|
2098
|
+
return event.name === 'EventDispatch' && event.ph === Phase.COMPLETE;
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
export function isInstant(event: Event): event is Instant {
|
|
2102
|
+
return event.ph === Phase.INSTANT;
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
export function isRendererEvent(event: Event): event is RendererEvent {
|
|
2106
|
+
return isInstant(event) || isComplete(event);
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
export function isFireIdleCallback(event: Event): event is FireIdleCallback {
|
|
2110
|
+
return event.name === 'FireIdleCallback' && event.ph === Phase.COMPLETE;
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
export function isSchedulePostMessage(event: Event): event is SchedulePostMessage {
|
|
2114
|
+
return event.name === Name.SCHEDULE_POST_MESSAGE;
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
export function isHandlePostMessage(event: Event): event is HandlePostMessage {
|
|
2118
|
+
return event.name === Name.HANDLE_POST_MESSAGE && event.ph === Phase.COMPLETE;
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
export function isUpdateCounters(event: Event): event is UpdateCounters {
|
|
2122
|
+
return event.name === 'UpdateCounters';
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
export function isDOMStats(event: Event): event is DOMStats {
|
|
2126
|
+
return event.name === 'DOMStats';
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
export function isThreadName(
|
|
2130
|
+
event: Event,
|
|
2131
|
+
): event is ThreadName {
|
|
2132
|
+
return event.name === Name.THREAD_NAME;
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
export function isProcessName(
|
|
2136
|
+
event: Event,
|
|
2137
|
+
): event is ProcessName {
|
|
2138
|
+
return event.name === 'process_name';
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
export function isTracingStartedInBrowser(
|
|
2142
|
+
event: Event,
|
|
2143
|
+
): event is TracingStartedInBrowser {
|
|
2144
|
+
return event.name === Name.TRACING_STARTED_IN_BROWSER;
|
|
2145
|
+
}
|
|
2146
|
+
|
|
2147
|
+
export function isFrameCommittedInBrowser(
|
|
2148
|
+
event: Event,
|
|
2149
|
+
): event is FrameCommittedInBrowser {
|
|
2150
|
+
return event.name === 'FrameCommittedInBrowser';
|
|
2151
|
+
}
|
|
2152
|
+
|
|
2153
|
+
export function isCommitLoad(
|
|
2154
|
+
event: Event,
|
|
2155
|
+
): event is CommitLoad {
|
|
2156
|
+
return event.name === 'CommitLoad';
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
export function isAnimation(
|
|
2160
|
+
event: Event,
|
|
2161
|
+
): event is Animation {
|
|
2162
|
+
// We've found some rare traces with an Animation trace event from a different category: https://crbug.com/1472375#comment7
|
|
2163
|
+
return event.name === 'Animation' && event.cat.includes('devtools.timeline');
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
export function isSyntheticAnimation(event: Event): event is SyntheticAnimationPair {
|
|
2167
|
+
if (event.name !== 'Animation' || !event.cat.includes('devtools.timeline')) {
|
|
2168
|
+
return false;
|
|
2169
|
+
}
|
|
2170
|
+
const data = event.args?.data;
|
|
2171
|
+
if (!data) {
|
|
2172
|
+
return false;
|
|
2173
|
+
}
|
|
2174
|
+
return 'beginEvent' in data && 'endEvent' in data;
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
export function isLayoutShift(
|
|
2178
|
+
event: Event,
|
|
2179
|
+
): event is LayoutShift {
|
|
2180
|
+
return event.name === Name.LAYOUT_SHIFT;
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
export function isLayoutInvalidationTracking(
|
|
2184
|
+
event: Event,
|
|
2185
|
+
): event is LayoutInvalidationTracking {
|
|
2186
|
+
return event.name === Name.LAYOUT_INVALIDATION_TRACKING;
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
export function isFirstContentfulPaint(event: Event): event is FirstContentfulPaint {
|
|
2190
|
+
return event.name === 'firstContentfulPaint';
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
export function isLargestContentfulPaintCandidate(event: Event): event is LargestContentfulPaintCandidate {
|
|
2194
|
+
return event.name === Name.MARK_LCP_CANDIDATE;
|
|
2195
|
+
}
|
|
2196
|
+
export function isLargestImagePaintCandidate(event: Event): event is LargestImagePaintCandidate {
|
|
2197
|
+
return event.name === 'LargestImagePaint::Candidate';
|
|
2198
|
+
}
|
|
2199
|
+
export function isLargestTextPaintCandidate(event: Event): event is LargestTextPaintCandidate {
|
|
2200
|
+
return event.name === 'LargestTextPaint::Candidate';
|
|
2201
|
+
}
|
|
2202
|
+
|
|
2203
|
+
export function isMarkLoad(event: Event): event is MarkLoad {
|
|
2204
|
+
return event.name === 'MarkLoad';
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2207
|
+
export function isFirstPaint(event: Event): event is FirstPaint {
|
|
2208
|
+
return event.name === 'firstPaint';
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
export function isMarkDOMContent(event: Event): event is MarkDOMContent {
|
|
2212
|
+
return event.name === 'MarkDOMContent';
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
export function isInteractiveTime(event: Event): event is InteractiveTime {
|
|
2216
|
+
return event.name === 'InteractiveTime';
|
|
2217
|
+
}
|
|
2218
|
+
|
|
2219
|
+
export function isEventTiming(event: Event): event is EventTimingBeginOrEnd {
|
|
2220
|
+
return event.name === Name.EVENT_TIMING;
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
export function isEventTimingEnd(event: Event): event is EventTimingEnd {
|
|
2224
|
+
return isEventTiming(event) && event.ph === Phase.ASYNC_NESTABLE_END;
|
|
2225
|
+
}
|
|
2226
|
+
export function isEventTimingStart(event: Event): event is EventTimingBegin {
|
|
2227
|
+
return isEventTiming(event) && event.ph === Phase.ASYNC_NESTABLE_START;
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2230
|
+
export function isGPUTask(event: Event): event is GPUTask {
|
|
2231
|
+
return event.name === 'GPUTask';
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
export function isProfile(event: Event): event is Profile {
|
|
2235
|
+
return event.name === Name.PROFILE;
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
export function isSyntheticCpuProfile(event: Event): event is SyntheticCpuProfile {
|
|
2239
|
+
return event.name === Name.CPU_PROFILE && event.ph === Phase.COMPLETE;
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
export function isProfileChunk(event: Event): event is ProfileChunk {
|
|
2243
|
+
return event.name === Name.PROFILE_CHUNK;
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
export function isResourceChangePriority(
|
|
2247
|
+
event: Event,
|
|
2248
|
+
): event is ResourceChangePriority {
|
|
2249
|
+
return event.name === 'ResourceChangePriority';
|
|
2250
|
+
}
|
|
2251
|
+
|
|
2252
|
+
export function isResourceSendRequest(
|
|
2253
|
+
event: Event,
|
|
2254
|
+
): event is ResourceSendRequest {
|
|
2255
|
+
return event.name === 'ResourceSendRequest';
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
export function isResourceReceiveResponse(
|
|
2259
|
+
event: Event,
|
|
2260
|
+
): event is ResourceReceiveResponse {
|
|
2261
|
+
return event.name === 'ResourceReceiveResponse';
|
|
2262
|
+
}
|
|
2263
|
+
|
|
2264
|
+
export function isResourceMarkAsCached(
|
|
2265
|
+
event: Event,
|
|
2266
|
+
): event is ResourceMarkAsCached {
|
|
2267
|
+
return event.name === 'ResourceMarkAsCached';
|
|
2268
|
+
}
|
|
2269
|
+
|
|
2270
|
+
export function isResourceFinish(
|
|
2271
|
+
event: Event,
|
|
2272
|
+
): event is ResourceFinish {
|
|
2273
|
+
return event.name === 'ResourceFinish';
|
|
2274
|
+
}
|
|
2275
|
+
|
|
2276
|
+
export function isResourceWillSendRequest(
|
|
2277
|
+
event: Event,
|
|
2278
|
+
): event is ResourceWillSendRequest {
|
|
2279
|
+
return event.name === 'ResourceWillSendRequest';
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
export function isResourceReceivedData(
|
|
2283
|
+
event: Event,
|
|
2284
|
+
): event is ResourceReceivedData {
|
|
2285
|
+
return event.name === 'ResourceReceivedData';
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2288
|
+
/** Any event where we receive data (and get an encodedDataLength) **/
|
|
2289
|
+
export function isReceivedDataEvent(
|
|
2290
|
+
event: Event,
|
|
2291
|
+
): event is ResourceReceivedData|ResourceFinish|ResourceReceiveResponse {
|
|
2292
|
+
return event.name === 'ResourceReceivedData' || event.name === 'ResourceFinish' ||
|
|
2293
|
+
event.name === 'ResourceReceiveResponse';
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
export function isSyntheticNetworkRequest(
|
|
2297
|
+
event: Event,
|
|
2298
|
+
): event is SyntheticNetworkRequest {
|
|
2299
|
+
return event.name === Name.SYNTHETIC_NETWORK_REQUEST;
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
export function isSyntheticWebSocketConnection(
|
|
2303
|
+
event: Event,
|
|
2304
|
+
): event is SyntheticWebSocketConnection {
|
|
2305
|
+
return event.name === 'SyntheticWebSocketConnection';
|
|
2306
|
+
}
|
|
2307
|
+
|
|
2308
|
+
export function isNetworkTrackEntry(event: Event): event is SyntheticWebSocketConnection|SyntheticNetworkRequest {
|
|
2309
|
+
return isSyntheticNetworkRequest(event) || isSyntheticWebSocketConnection(event) || isWebSocketTraceEvent(event);
|
|
2310
|
+
}
|
|
2311
|
+
|
|
2312
|
+
export function isPrePaint(
|
|
2313
|
+
event: Event,
|
|
2314
|
+
): event is PrePaint {
|
|
2315
|
+
return event.name === 'PrePaint';
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
/** A VALID navigation start (as it has a populated documentLoaderURL) */
|
|
2319
|
+
export function isNavigationStart(event: Event): event is NavigationStart {
|
|
2320
|
+
return event.name === 'navigationStart' && (event as NavigationStart).args?.data?.documentLoaderURL !== '';
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
export interface DidCommitSameDocumentNavigation extends Complete {
|
|
2324
|
+
name: 'RenderFrameHostImpl::DidCommitSameDocumentNavigation';
|
|
2325
|
+
args: Args&{
|
|
2326
|
+
url: string,
|
|
2327
|
+
render_frame_host: {
|
|
2328
|
+
frame_type: string,
|
|
2329
|
+
},
|
|
2330
|
+
};
|
|
2331
|
+
}
|
|
2332
|
+
|
|
2333
|
+
export function isDidCommitSameDocumentNavigation(event: Event): event is DidCommitSameDocumentNavigation {
|
|
2334
|
+
return event.name === 'RenderFrameHostImpl::DidCommitSameDocumentNavigation' && event.ph === Phase.COMPLETE;
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
export function isMainFrameViewport(
|
|
2338
|
+
event: Event,
|
|
2339
|
+
): event is MainFrameViewport {
|
|
2340
|
+
return event.name === 'PaintTimingVisualizer::Viewport';
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
export function isSyntheticUserTiming(event: Event): event is SyntheticUserTimingPair {
|
|
2344
|
+
if (event.cat !== 'blink.user_timing') {
|
|
2345
|
+
return false;
|
|
2346
|
+
}
|
|
2347
|
+
const data = event.args?.data;
|
|
2348
|
+
if (!data) {
|
|
2349
|
+
return false;
|
|
2350
|
+
}
|
|
2351
|
+
return 'beginEvent' in data && 'endEvent' in data;
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2354
|
+
export function isSyntheticConsoleTiming(event: Event): event is SyntheticConsoleTimingPair {
|
|
2355
|
+
if (event.cat !== 'blink.console') {
|
|
2356
|
+
return false;
|
|
2357
|
+
}
|
|
2358
|
+
const data = event.args?.data;
|
|
2359
|
+
if (!data) {
|
|
2360
|
+
return false;
|
|
2361
|
+
}
|
|
2362
|
+
return 'beginEvent' in data && 'endEvent' in data;
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
export function isUserTiming(event: Event): event is UserTiming {
|
|
2366
|
+
return event.cat === 'blink.user_timing';
|
|
2367
|
+
}
|
|
2368
|
+
|
|
2369
|
+
export function isDomLoading(event: Event): event is DomLoading {
|
|
2370
|
+
return event.name === Name.DOM_LOADING;
|
|
2371
|
+
}
|
|
2372
|
+
|
|
2373
|
+
export function isBeginRemoteFontLoad(event: Event): event is BeginRemoteFontLoad {
|
|
2374
|
+
return event.name === Name.BEGIN_REMOTE_FONT_LOAD;
|
|
2375
|
+
}
|
|
2376
|
+
|
|
2377
|
+
export function isRemoteFontLoaded(event: Event): event is RemoteFontLoaded {
|
|
2378
|
+
return event.name === Name.REMOTE_FONT_LOADED;
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
export function isPerformanceMeasure(event: Event): event is PerformanceMeasure {
|
|
2382
|
+
return isUserTiming(event) && isPhaseAsync(event.ph);
|
|
2383
|
+
}
|
|
2384
|
+
|
|
2385
|
+
export function isPerformanceMeasureBegin(event: Event): event is PerformanceMeasureBegin {
|
|
2386
|
+
return isPerformanceMeasure(event) && event.ph === Phase.ASYNC_NESTABLE_START;
|
|
2387
|
+
}
|
|
2388
|
+
|
|
2389
|
+
export function isPerformanceMark(event: Event): event is PerformanceMark {
|
|
2390
|
+
return isUserTiming(event) && (event.ph === Phase.MARK || event.ph === Phase.INSTANT);
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
export function isConsoleTime(event: Event): event is ConsoleTime {
|
|
2394
|
+
return event.cat === 'blink.console' && isPhaseAsync(event.ph);
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2397
|
+
export function isConsoleTimeStamp(event: Event): event is ConsoleTimeStamp {
|
|
2398
|
+
return event.ph === Phase.INSTANT && event.name === Name.TIME_STAMP;
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2401
|
+
export function isUserTimingMeasure(event: Event): event is UserTimingMeasure {
|
|
2402
|
+
return event.name === Name.USER_TIMING_MEASURE;
|
|
2403
|
+
}
|
|
2404
|
+
|
|
2405
|
+
export function isParseHTML(event: Event): event is ParseHTML {
|
|
2406
|
+
return event.name === 'ParseHTML';
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2409
|
+
export interface Async extends Event {
|
|
2410
|
+
ph: Phase.ASYNC_NESTABLE_START|Phase.ASYNC_NESTABLE_INSTANT|Phase.ASYNC_NESTABLE_END|Phase.ASYNC_STEP_INTO|
|
|
2411
|
+
Phase.ASYNC_BEGIN|Phase.ASYNC_END|Phase.ASYNC_STEP_PAST;
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2414
|
+
export function isSyntheticLayoutShift(event: Event): event is SyntheticLayoutShift {
|
|
2415
|
+
return event.name === Name.SYNTHETIC_LAYOUT_SHIFT;
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2418
|
+
export function isSyntheticLayoutShiftCluster(event: Event): event is SyntheticLayoutShiftCluster {
|
|
2419
|
+
return event.name === Name.SYNTHETIC_LAYOUT_SHIFT_CLUSTER;
|
|
2420
|
+
}
|
|
2421
|
+
|
|
2422
|
+
export function isProfileCall(event: Event): event is SyntheticProfileCall {
|
|
2423
|
+
return 'callFrame' in event;
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
export interface Paint extends Event {
|
|
2427
|
+
name: Name.PAINT;
|
|
2428
|
+
args: Args&{
|
|
2429
|
+
data: ArgsData & {
|
|
2430
|
+
frame: string,
|
|
2431
|
+
layerId: number,
|
|
2432
|
+
// With CompositeAfterPaint enabled, paint events are no longer
|
|
2433
|
+
// associated with a Node, and nodeId will not be present.
|
|
2434
|
+
nodeId?: Protocol.DOM.BackendNodeId,
|
|
2435
|
+
// Optional as it was added in M137: crrev.com/c/6491448
|
|
2436
|
+
nodeName?: string,
|
|
2437
|
+
/** This rect is unreliable and often wrong. We'll remove it. crbug.com/41402938#comment10 */
|
|
2438
|
+
clip?: number[],
|
|
2439
|
+
},
|
|
2440
|
+
};
|
|
2441
|
+
}
|
|
2442
|
+
|
|
2443
|
+
export function isPaint(event: Event): event is Paint {
|
|
2444
|
+
return event.name === Name.PAINT;
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
export interface PaintImage extends Complete {
|
|
2448
|
+
name: Name.PAINT_IMAGE;
|
|
2449
|
+
args: Args&{
|
|
2450
|
+
data: Event & {
|
|
2451
|
+
height: number,
|
|
2452
|
+
width: number,
|
|
2453
|
+
x: number,
|
|
2454
|
+
y: number,
|
|
2455
|
+
isCSS: boolean,
|
|
2456
|
+
srcHeight: number,
|
|
2457
|
+
srcWidth: number,
|
|
2458
|
+
isPicture?: boolean,
|
|
2459
|
+
loadingAttribute?: string,
|
|
2460
|
+
srcsetAttribute?: string,
|
|
2461
|
+
url?: string,
|
|
2462
|
+
nodeId?: Protocol.DOM.BackendNodeId,
|
|
2463
|
+
// Optional as it was added in M137: crrev.com/c/6491448
|
|
2464
|
+
nodeName?: string,
|
|
2465
|
+
frame?: string,
|
|
2466
|
+
},
|
|
2467
|
+
};
|
|
2468
|
+
}
|
|
2469
|
+
export function isPaintImage(event: Event): event is PaintImage {
|
|
2470
|
+
return event.name === Name.PAINT_IMAGE && event.ph === Phase.COMPLETE;
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
export interface ScrollLayer extends Complete {
|
|
2474
|
+
name: Name.SCROLL_LAYER;
|
|
2475
|
+
args: Args&{
|
|
2476
|
+
data: Event & {
|
|
2477
|
+
frame: string,
|
|
2478
|
+
nodeId?: Protocol.DOM.BackendNodeId,
|
|
2479
|
+
},
|
|
2480
|
+
};
|
|
2481
|
+
}
|
|
2482
|
+
export function isScrollLayer(event: Event): event is ScrollLayer {
|
|
2483
|
+
return event.name === Name.SCROLL_LAYER && event.ph === Phase.COMPLETE;
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2486
|
+
export interface SetLayerTreeId extends Instant {
|
|
2487
|
+
name: Name.SET_LAYER_TREE_ID;
|
|
2488
|
+
args: Args&{
|
|
2489
|
+
data: ArgsData & {
|
|
2490
|
+
frame: string,
|
|
2491
|
+
layerTreeId: number,
|
|
2492
|
+
},
|
|
2493
|
+
};
|
|
2494
|
+
}
|
|
2495
|
+
export function isSetLayerId(event: Event): event is SetLayerTreeId {
|
|
2496
|
+
return event.name === Name.SET_LAYER_TREE_ID;
|
|
2497
|
+
}
|
|
2498
|
+
export interface UpdateLayer extends Event {
|
|
2499
|
+
name: Name.UPDATE_LAYER;
|
|
2500
|
+
args: Args&{
|
|
2501
|
+
layerId: number,
|
|
2502
|
+
layerTreeId: number,
|
|
2503
|
+
};
|
|
2504
|
+
}
|
|
2505
|
+
export function isUpdateLayer(event: Event): event is UpdateLayer {
|
|
2506
|
+
return event.name === Name.UPDATE_LAYER;
|
|
2507
|
+
}
|
|
2508
|
+
|
|
2509
|
+
export interface DisplayItemListSnapshot extends Event {
|
|
2510
|
+
name: Name.DISPLAY_ITEM_LIST_SNAPSHOT;
|
|
2511
|
+
ph: Phase.OBJECT_SNAPSHOT;
|
|
2512
|
+
id2: {
|
|
2513
|
+
local?: string,
|
|
2514
|
+
};
|
|
2515
|
+
args: Args&{
|
|
2516
|
+
snapshot: {
|
|
2517
|
+
skp64: string,
|
|
2518
|
+
params?: {
|
|
2519
|
+
|
|
2520
|
+
layer_rect: [number, number, number, number],
|
|
2521
|
+
},
|
|
2522
|
+
},
|
|
2523
|
+
};
|
|
2524
|
+
}
|
|
2525
|
+
export function isDisplayListItemListSnapshot(event: Event): event is DisplayItemListSnapshot {
|
|
2526
|
+
return event.name === Name.DISPLAY_ITEM_LIST_SNAPSHOT;
|
|
2527
|
+
}
|
|
2528
|
+
|
|
2529
|
+
export interface LayerTreeHostImplSnapshot extends Event {
|
|
2530
|
+
name: Name.LAYER_TREE_HOST_IMPL_SNAPSHOT;
|
|
2531
|
+
ph: Phase.OBJECT_SNAPSHOT;
|
|
2532
|
+
id: string;
|
|
2533
|
+
args: Args&{
|
|
2534
|
+
snapshot: {
|
|
2535
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2536
|
+
active_tiles: Array<{
|
|
2537
|
+
id: string,
|
|
2538
|
+
layer_id: string,
|
|
2539
|
+
gpu_memory_usage: number,
|
|
2540
|
+
content_rect: number[],
|
|
2541
|
+
}>,
|
|
2542
|
+
device_viewport_size: {
|
|
2543
|
+
width: number,
|
|
2544
|
+
height: number,
|
|
2545
|
+
},
|
|
2546
|
+
active_tree: {
|
|
2547
|
+
root_layer: TraceLayer,
|
|
2548
|
+
layers: TraceLayer[],
|
|
2549
|
+
},
|
|
2550
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
2551
|
+
},
|
|
2552
|
+
};
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
export function isLayerTreeHostImplSnapshot(event: Event): event is LayerTreeHostImplSnapshot {
|
|
2556
|
+
return event.name === Name.LAYER_TREE_HOST_IMPL_SNAPSHOT;
|
|
2557
|
+
}
|
|
2558
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2559
|
+
export interface TraceLayer {
|
|
2560
|
+
bounds: {height: number, width: number};
|
|
2561
|
+
children: TraceLayer[];
|
|
2562
|
+
layer_id: number;
|
|
2563
|
+
position: number[];
|
|
2564
|
+
scroll_offset: number[];
|
|
2565
|
+
layer_quad: number[];
|
|
2566
|
+
draws_content: number;
|
|
2567
|
+
gpu_memory_usage: number;
|
|
2568
|
+
transform: number[];
|
|
2569
|
+
owner_node: Protocol.DOM.BackendNodeId;
|
|
2570
|
+
compositing_reasons: string[];
|
|
2571
|
+
compositing_reason_ids: string[];
|
|
2572
|
+
non_fast_scrollable_region: number[];
|
|
2573
|
+
touch_event_handler_region: number[];
|
|
2574
|
+
wheel_event_handler_region: number[];
|
|
2575
|
+
scroll_event_handler_region: number[];
|
|
2576
|
+
}
|
|
2577
|
+
|
|
2578
|
+
export interface TracingLayerTile {
|
|
2579
|
+
id: string;
|
|
2580
|
+
layer_id: string;
|
|
2581
|
+
gpu_memory_usage: number;
|
|
2582
|
+
content_rect: number[];
|
|
2583
|
+
}
|
|
2584
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
2585
|
+
|
|
2586
|
+
export interface FireAnimationFrame extends Complete {
|
|
2587
|
+
name: Name.FIRE_ANIMATION_FRAME;
|
|
2588
|
+
args: Args&{
|
|
2589
|
+
data: {
|
|
2590
|
+
frame: string,
|
|
2591
|
+
id: number,
|
|
2592
|
+
},
|
|
2593
|
+
};
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2596
|
+
export function isFireAnimationFrame(event: Event): event is FireAnimationFrame {
|
|
2597
|
+
return event.name === Name.FIRE_ANIMATION_FRAME && event.ph === Phase.COMPLETE;
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2600
|
+
export interface RequestAnimationFrame extends Instant {
|
|
2601
|
+
name: Name.REQUEST_ANIMATION_FRAME;
|
|
2602
|
+
args: Args&{
|
|
2603
|
+
data: {
|
|
2604
|
+
frame: string,
|
|
2605
|
+
id: number,
|
|
2606
|
+
stackTrace?: CallFrame,
|
|
2607
|
+
},
|
|
2608
|
+
};
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
export interface TimerInstall extends Instant {
|
|
2612
|
+
name: Name.TIMER_INSTALL;
|
|
2613
|
+
args: Args&{
|
|
2614
|
+
data: {
|
|
2615
|
+
frame: string,
|
|
2616
|
+
singleShot: boolean,
|
|
2617
|
+
timeout: number,
|
|
2618
|
+
timerId: number,
|
|
2619
|
+
stackTrace?: CallFrame,
|
|
2620
|
+
},
|
|
2621
|
+
};
|
|
2622
|
+
}
|
|
2623
|
+
export function isTimerInstall(event: Event): event is TimerInstall {
|
|
2624
|
+
return event.name === Name.TIMER_INSTALL;
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
export interface TimerFire extends Complete {
|
|
2628
|
+
name: Name.TIMER_FIRE;
|
|
2629
|
+
args: Args&{
|
|
2630
|
+
data: {
|
|
2631
|
+
frame: string,
|
|
2632
|
+
timerId: number,
|
|
2633
|
+
},
|
|
2634
|
+
};
|
|
2635
|
+
}
|
|
2636
|
+
export function isTimerFire(event: Event): event is TimerFire {
|
|
2637
|
+
return event.name === Name.TIMER_FIRE && event.ph === Phase.COMPLETE;
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2640
|
+
export interface RequestIdleCallback extends Instant {
|
|
2641
|
+
name: Name.REQUEST_IDLE_CALLBACK;
|
|
2642
|
+
args: Args&{
|
|
2643
|
+
data: {
|
|
2644
|
+
frame: string,
|
|
2645
|
+
id: number,
|
|
2646
|
+
timeout: Milli,
|
|
2647
|
+
stackTrace?: CallFrame,
|
|
2648
|
+
},
|
|
2649
|
+
|
|
2650
|
+
};
|
|
2651
|
+
}
|
|
2652
|
+
|
|
2653
|
+
export function isRequestIdleCallback(event: Event): event is RequestIdleCallback {
|
|
2654
|
+
return event.name === Name.REQUEST_IDLE_CALLBACK;
|
|
2655
|
+
}
|
|
2656
|
+
|
|
2657
|
+
export interface WebSocketCreate extends Instant {
|
|
2658
|
+
name: Name.WEB_SOCKET_CREATE;
|
|
2659
|
+
args: Args&{
|
|
2660
|
+
data: {
|
|
2661
|
+
identifier: number,
|
|
2662
|
+
url: string,
|
|
2663
|
+
frame?: string,
|
|
2664
|
+
workerId?: string,
|
|
2665
|
+
websocketProtocol?: string,
|
|
2666
|
+
stackTrace?: CallFrame,
|
|
2667
|
+
},
|
|
2668
|
+
};
|
|
2669
|
+
}
|
|
2670
|
+
export function isWebSocketCreate(event: Event): event is WebSocketCreate {
|
|
2671
|
+
return event.name === Name.WEB_SOCKET_CREATE;
|
|
2672
|
+
}
|
|
2673
|
+
|
|
2674
|
+
export interface WebSocketInfo extends Instant {
|
|
2675
|
+
name: Name.WEB_SOCKET_DESTROY|Name.WEB_SOCKET_RECEIVE_HANDSHAKE|Name.WEB_SOCKET_RECEIVE_HANDSHAKE_REQUEST;
|
|
2676
|
+
args: Args&{
|
|
2677
|
+
data: ArgsData & {
|
|
2678
|
+
identifier: number,
|
|
2679
|
+
url: string,
|
|
2680
|
+
frame?: string,
|
|
2681
|
+
workerId?: string,
|
|
2682
|
+
},
|
|
2683
|
+
};
|
|
2684
|
+
}
|
|
2685
|
+
export interface WebSocketTransfer extends Instant {
|
|
2686
|
+
name: Name.WEB_SOCKET_SEND|Name.WEB_SOCKET_RECEIVE;
|
|
2687
|
+
args: Args&{
|
|
2688
|
+
data: ArgsData & {
|
|
2689
|
+
identifier: number,
|
|
2690
|
+
url: string,
|
|
2691
|
+
dataLength: number,
|
|
2692
|
+
frame?: string,
|
|
2693
|
+
workerId?: string,
|
|
2694
|
+
},
|
|
2695
|
+
};
|
|
2696
|
+
}
|
|
2697
|
+
export function isWebSocketInfo(event: Event): event is WebSocketInfo {
|
|
2698
|
+
return event.name === Name.WEB_SOCKET_SEND_HANDSHAKE_REQUEST ||
|
|
2699
|
+
event.name === Name.WEB_SOCKET_RECEIVE_HANDSHAKE_REQUEST || event.name === Name.WEB_SOCKET_DESTROY;
|
|
2700
|
+
}
|
|
2701
|
+
|
|
2702
|
+
export function isWebSocketTransfer(event: Event): event is WebSocketTransfer {
|
|
2703
|
+
return event.name === Name.WEB_SOCKET_SEND || event.name === Name.WEB_SOCKET_RECEIVE;
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2706
|
+
export interface WebSocketSend extends Instant {
|
|
2707
|
+
name: Name.WEB_SOCKET_SEND;
|
|
2708
|
+
args: Args&{
|
|
2709
|
+
data: ArgsData & {
|
|
2710
|
+
identifier: number,
|
|
2711
|
+
url: string,
|
|
2712
|
+
dataLength: number,
|
|
2713
|
+
frame?: string,
|
|
2714
|
+
workerId?: string,
|
|
2715
|
+
},
|
|
2716
|
+
};
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
export interface WebSocketReceive extends Instant {
|
|
2720
|
+
name: Name.WEB_SOCKET_RECEIVE;
|
|
2721
|
+
args: Args&{
|
|
2722
|
+
data: ArgsData & {
|
|
2723
|
+
identifier: number,
|
|
2724
|
+
url: string,
|
|
2725
|
+
dataLength: number,
|
|
2726
|
+
frame?: string,
|
|
2727
|
+
workerId?: string,
|
|
2728
|
+
},
|
|
2729
|
+
};
|
|
2730
|
+
}
|
|
2731
|
+
|
|
2732
|
+
export interface WebSocketSendHandshakeRequest extends Instant {
|
|
2733
|
+
name: Name.WEB_SOCKET_SEND_HANDSHAKE_REQUEST;
|
|
2734
|
+
args: Args&{
|
|
2735
|
+
data: {
|
|
2736
|
+
frame: string,
|
|
2737
|
+
identifier: number,
|
|
2738
|
+
},
|
|
2739
|
+
};
|
|
2740
|
+
}
|
|
2741
|
+
export function isWebSocketSendHandshakeRequest(event: Event): event is WebSocketSendHandshakeRequest {
|
|
2742
|
+
return event.name === Name.WEB_SOCKET_SEND_HANDSHAKE_REQUEST;
|
|
2743
|
+
}
|
|
2744
|
+
|
|
2745
|
+
export interface WebSocketReceiveHandshakeResponse extends Instant {
|
|
2746
|
+
name: Name.WEB_SOCKET_RECEIVE_HANDSHAKE_REQUEST;
|
|
2747
|
+
args: Args&{
|
|
2748
|
+
data: {
|
|
2749
|
+
frame: string,
|
|
2750
|
+
identifier: number,
|
|
2751
|
+
},
|
|
2752
|
+
};
|
|
2753
|
+
}
|
|
2754
|
+
export function isWebSocketReceiveHandshakeResponse(event: Event): event is WebSocketReceiveHandshakeResponse {
|
|
2755
|
+
return event.name === Name.WEB_SOCKET_RECEIVE_HANDSHAKE_REQUEST;
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2758
|
+
export interface WebSocketDestroy extends Instant {
|
|
2759
|
+
name: Name.WEB_SOCKET_DESTROY;
|
|
2760
|
+
args: Args&{
|
|
2761
|
+
data: {
|
|
2762
|
+
frame: string,
|
|
2763
|
+
identifier: number,
|
|
2764
|
+
},
|
|
2765
|
+
};
|
|
2766
|
+
}
|
|
2767
|
+
export function isWebSocketDestroy(event: Event): event is WebSocketDestroy {
|
|
2768
|
+
return event.name === Name.WEB_SOCKET_DESTROY;
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2771
|
+
export type WebSocketTraceEvent = WebSocketCreate|WebSocketInfo|WebSocketTransfer;
|
|
2772
|
+
export function isWebSocketTraceEvent(event: Event): event is WebSocketTraceEvent {
|
|
2773
|
+
return isWebSocketCreate(event) || isWebSocketInfo(event) || isWebSocketTransfer(event);
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2776
|
+
export type WebSocketEvent = WebSocketTraceEvent|SyntheticWebSocketConnection;
|
|
2777
|
+
export function isWebSocketEvent(event: Event): event is WebSocketTraceEvent|SyntheticWebSocketConnection {
|
|
2778
|
+
return isWebSocketTraceEvent(event) || isSyntheticWebSocketConnection(event);
|
|
2779
|
+
}
|
|
2780
|
+
|
|
2781
|
+
export interface V8Compile extends Complete {
|
|
2782
|
+
name: Name.COMPILE;
|
|
2783
|
+
args: Args&{
|
|
2784
|
+
data?: {
|
|
2785
|
+
url?: string,
|
|
2786
|
+
columnNumber?: number,
|
|
2787
|
+
consumedCacheSize?: number,
|
|
2788
|
+
cacheRejected?: boolean,
|
|
2789
|
+
cacheKind?: 'full'|'normal',
|
|
2790
|
+
lineNumber?: number,
|
|
2791
|
+
notStreamedReason?: string,
|
|
2792
|
+
streamed?: boolean,
|
|
2793
|
+
eager?: boolean,
|
|
2794
|
+
},
|
|
2795
|
+
fileName?: string,
|
|
2796
|
+
};
|
|
2797
|
+
}
|
|
2798
|
+
export function isV8Compile(event: Event): event is V8Compile {
|
|
2799
|
+
return event.name === Name.COMPILE && event.ph === Phase.COMPLETE;
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2802
|
+
export interface FunctionCall extends Complete {
|
|
2803
|
+
name: Name.FUNCTION_CALL;
|
|
2804
|
+
args: Args&{
|
|
2805
|
+
data?: Partial<CallFrame>& {
|
|
2806
|
+
frame?: string,
|
|
2807
|
+
isolate?: number,
|
|
2808
|
+
},
|
|
2809
|
+
};
|
|
2810
|
+
}
|
|
2811
|
+
export function isFunctionCall(event: Event): event is FunctionCall {
|
|
2812
|
+
return event.name === Name.FUNCTION_CALL && event.ph === Phase.COMPLETE;
|
|
2813
|
+
}
|
|
2814
|
+
|
|
2815
|
+
export interface SchedulePostTaskCallback extends Instant {
|
|
2816
|
+
name: Name.SCHEDULE_POST_TASK_CALLBACK;
|
|
2817
|
+
args: Args&{
|
|
2818
|
+
data: {
|
|
2819
|
+
taskId: number,
|
|
2820
|
+
priority: 'user-blocking'|'user-visible'|'background',
|
|
2821
|
+
delay: Milli,
|
|
2822
|
+
frame?: string,
|
|
2823
|
+
stackTrace?: CallFrame,
|
|
2824
|
+
},
|
|
2825
|
+
};
|
|
2826
|
+
}
|
|
2827
|
+
export function isSchedulePostTaskCallback(event: Event): event is SchedulePostTaskCallback {
|
|
2828
|
+
return event.name === Name.SCHEDULE_POST_TASK_CALLBACK;
|
|
2829
|
+
}
|
|
2830
|
+
|
|
2831
|
+
export interface RunPostTaskCallback extends Complete {
|
|
2832
|
+
name: Name.RUN_POST_TASK_CALLBACK;
|
|
2833
|
+
args: Args&{
|
|
2834
|
+
data: {
|
|
2835
|
+
taskId: number,
|
|
2836
|
+
priority: 'user-blocking'|'user-visible'|'background',
|
|
2837
|
+
delay: Milli,
|
|
2838
|
+
frame?: string,
|
|
2839
|
+
},
|
|
2840
|
+
};
|
|
2841
|
+
}
|
|
2842
|
+
export function isRunPostTaskCallback(event: Event): event is RunPostTaskCallback {
|
|
2843
|
+
return event.name === Name.RUN_POST_TASK_CALLBACK && event.ph === Phase.COMPLETE;
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
export interface AbortPostTaskCallback extends Complete {
|
|
2847
|
+
name: Name.ABORT_POST_TASK_CALLBACK;
|
|
2848
|
+
args: Args&{
|
|
2849
|
+
data: {
|
|
2850
|
+
taskId: number,
|
|
2851
|
+
frame?: string,
|
|
2852
|
+
stackTrace?: CallFrame,
|
|
2853
|
+
},
|
|
2854
|
+
};
|
|
2855
|
+
}
|
|
2856
|
+
export function isAbortPostTaskCallback(event: Event): event is RunPostTaskCallback {
|
|
2857
|
+
return event.name === Name.ABORT_POST_TASK_CALLBACK && event.ph === Phase.COMPLETE;
|
|
2858
|
+
}
|
|
2859
|
+
|
|
2860
|
+
/**
|
|
2861
|
+
* Generally, before JS is executed, a trace event is dispatched that
|
|
2862
|
+
* parents the JS calls. These we call "invocation" events. This
|
|
2863
|
+
* function determines if an event is one of such. Note: these are also
|
|
2864
|
+
* commonly referred to as "JS entry points".
|
|
2865
|
+
*/
|
|
2866
|
+
export function isJSInvocationEvent(event: Event): boolean {
|
|
2867
|
+
switch (event.name) {
|
|
2868
|
+
case Name.RUN_MICROTASKS:
|
|
2869
|
+
case Name.FUNCTION_CALL:
|
|
2870
|
+
// TODO(paulirish): Define types for these Evaluate* events
|
|
2871
|
+
case Name.EVALUATE_SCRIPT:
|
|
2872
|
+
case Name.EVALUATE_MODULE:
|
|
2873
|
+
case Name.EVENT_DISPATCH:
|
|
2874
|
+
case Name.V8_EXECUTE:
|
|
2875
|
+
case Name.V8_CONSOLE_RUN_TASK:
|
|
2876
|
+
return true;
|
|
2877
|
+
}
|
|
2878
|
+
// Also consider any new v8 trace events. (eg 'V8.RunMicrotasks' and 'v8.run')
|
|
2879
|
+
if (event.name.startsWith('v8') || event.name.startsWith('V8')) {
|
|
2880
|
+
return true;
|
|
2881
|
+
}
|
|
2882
|
+
if (isConsoleRunTask(event)) {
|
|
2883
|
+
return true;
|
|
2884
|
+
}
|
|
2885
|
+
return false;
|
|
2886
|
+
}
|
|
2887
|
+
export interface ConsoleRunTask extends Event {
|
|
2888
|
+
args: Args&{
|
|
2889
|
+
data: ArgsData & {
|
|
2890
|
+
sampleTraceId?: number,
|
|
2891
|
+
},
|
|
2892
|
+
};
|
|
2893
|
+
name: Name.V8_CONSOLE_RUN_TASK;
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
export function isConsoleRunTask(event: Event): event is ConsoleRunTask {
|
|
2897
|
+
return event.name === Name.V8_CONSOLE_RUN_TASK;
|
|
2898
|
+
}
|
|
2899
|
+
|
|
2900
|
+
export interface FlowEvent extends Event {
|
|
2901
|
+
// Contains a flow id created by perfetto for the flow this phase
|
|
2902
|
+
// event belongs to.
|
|
2903
|
+
id: number;
|
|
2904
|
+
ph: Phase.FLOW_START|Phase.FLOW_END|Phase.FLOW_STEP;
|
|
2905
|
+
}
|
|
2906
|
+
|
|
2907
|
+
export function isFlowPhaseEvent(event: Event): event is FlowEvent {
|
|
2908
|
+
return event.ph === Phase.FLOW_START || event.ph === Phase.FLOW_STEP || event.ph === Phase.FLOW_END;
|
|
2909
|
+
}
|
|
2910
|
+
|
|
2911
|
+
export interface ParseAuthorStyleSheet extends Complete {
|
|
2912
|
+
name: Name.PARSE_AUTHOR_STYLE_SHEET;
|
|
2913
|
+
args?: Args&{
|
|
2914
|
+
data: {
|
|
2915
|
+
stylesheetUrl: string,
|
|
2916
|
+
},
|
|
2917
|
+
};
|
|
2918
|
+
}
|
|
2919
|
+
|
|
2920
|
+
export function isParseAuthorStyleSheetEvent(event: Event): event is ParseAuthorStyleSheet {
|
|
2921
|
+
return event.name === Name.PARSE_AUTHOR_STYLE_SHEET && event.ph === Phase.COMPLETE;
|
|
2922
|
+
}
|
|
2923
|
+
|
|
2924
|
+
/**
|
|
2925
|
+
* This is an exhaustive list of events we track in the Performance
|
|
2926
|
+
* panel. Note not all of them are necessarliry shown in the flame
|
|
2927
|
+
* chart, some of them we only use for parsing.
|
|
2928
|
+
* TODO(crbug.com/1428024): Complete this enum.
|
|
2929
|
+
*/
|
|
2930
|
+
export const enum Name {
|
|
2931
|
+
/* Metadata */
|
|
2932
|
+
THREAD_NAME = 'thread_name',
|
|
2933
|
+
|
|
2934
|
+
/* Task */
|
|
2935
|
+
PROGRAM = 'Program',
|
|
2936
|
+
RUN_TASK = 'RunTask',
|
|
2937
|
+
ASYNC_TASK = 'AsyncTask',
|
|
2938
|
+
RUN_MICROTASKS = 'RunMicrotasks',
|
|
2939
|
+
|
|
2940
|
+
/* Load */
|
|
2941
|
+
XHR_LOAD = 'XHRLoad',
|
|
2942
|
+
XHR_READY_STATE_CHANGED = 'XHRReadyStateChange',
|
|
2943
|
+
/* Parse */
|
|
2944
|
+
PARSE_HTML = 'ParseHTML',
|
|
2945
|
+
PARSE_CSS = 'ParseAuthorStyleSheet',
|
|
2946
|
+
/* V8 */
|
|
2947
|
+
COMPILE_CODE = 'V8.CompileCode',
|
|
2948
|
+
COMPILE_MODULE = 'V8.CompileModule',
|
|
2949
|
+
// Although V8 emits the V8.CompileScript event, the event that actually
|
|
2950
|
+
// contains the useful information about the script (URL, etc), is contained
|
|
2951
|
+
// in the v8.compile event.
|
|
2952
|
+
// Yes, it is all lowercase compared to all the rest of the V8... events,
|
|
2953
|
+
// that is not a typo :)
|
|
2954
|
+
COMPILE = 'v8.compile',
|
|
2955
|
+
COMPILE_SCRIPT = 'V8.CompileScript',
|
|
2956
|
+
OPTIMIZE = 'V8.OptimizeCode',
|
|
2957
|
+
WASM_STREAM_FROM_RESPONSE_CALLBACK = 'v8.wasm.streamFromResponseCallback',
|
|
2958
|
+
WASM_COMPILED_MODULE = 'v8.wasm.compiledModule',
|
|
2959
|
+
WASM_CACHED_MODULE = 'v8.wasm.cachedModule',
|
|
2960
|
+
WASM_MODULE_CACHE_HIT = 'v8.wasm.moduleCacheHit',
|
|
2961
|
+
WASM_MODULE_CACHE_INVALID = 'v8.wasm.moduleCacheInvalid',
|
|
2962
|
+
/* Js */
|
|
2963
|
+
PROFILE_CALL = 'ProfileCall',
|
|
2964
|
+
EVALUATE_SCRIPT = 'EvaluateScript',
|
|
2965
|
+
FUNCTION_CALL = 'FunctionCall',
|
|
2966
|
+
EVENT_DISPATCH = 'EventDispatch',
|
|
2967
|
+
EVALUATE_MODULE = 'v8.evaluateModule',
|
|
2968
|
+
REQUEST_MAIN_THREAD_FRAME = 'RequestMainThreadFrame',
|
|
2969
|
+
REQUEST_ANIMATION_FRAME = 'RequestAnimationFrame',
|
|
2970
|
+
CANCEL_ANIMATION_FRAME = 'CancelAnimationFrame',
|
|
2971
|
+
FIRE_ANIMATION_FRAME = 'FireAnimationFrame',
|
|
2972
|
+
REQUEST_IDLE_CALLBACK = 'RequestIdleCallback',
|
|
2973
|
+
CANCEL_IDLE_CALLBACK = 'CancelIdleCallback',
|
|
2974
|
+
FIRE_IDLE_CALLBACK = 'FireIdleCallback',
|
|
2975
|
+
TIMER_INSTALL = 'TimerInstall',
|
|
2976
|
+
TIMER_REMOVE = 'TimerRemove',
|
|
2977
|
+
TIMER_FIRE = 'TimerFire',
|
|
2978
|
+
WEB_SOCKET_CREATE = 'WebSocketCreate',
|
|
2979
|
+
WEB_SOCKET_SEND_HANDSHAKE = 'WebSocketSendHandshakeRequest',
|
|
2980
|
+
WEB_SOCKET_RECEIVE_HANDSHAKE = 'WebSocketReceiveHandshakeResponse',
|
|
2981
|
+
WEB_SOCKET_DESTROY = 'WebSocketDestroy',
|
|
2982
|
+
WEB_SOCKET_SEND = 'WebSocketSend',
|
|
2983
|
+
WEB_SOCKET_RECEIVE = 'WebSocketReceive',
|
|
2984
|
+
CRYPTO_DO_ENCRYPT = 'DoEncrypt',
|
|
2985
|
+
CRYPTO_DO_ENCRYPT_REPLY = 'DoEncryptReply',
|
|
2986
|
+
CRYPTO_DO_DECRYPT = 'DoDecrypt',
|
|
2987
|
+
CRYPTO_DO_DECRYPT_REPLY = 'DoDecryptReply',
|
|
2988
|
+
CRYPTO_DO_DIGEST = 'DoDigest',
|
|
2989
|
+
CRYPTO_DO_DIGEST_REPLY = 'DoDigestReply',
|
|
2990
|
+
CRYPTO_DO_SIGN = 'DoSign',
|
|
2991
|
+
CRYPTO_DO_SIGN_REPLY = 'DoSignReply',
|
|
2992
|
+
CRYPTO_DO_VERIFY = 'DoVerify',
|
|
2993
|
+
CRYPTO_DO_VERIFY_REPLY = 'DoVerifyReply',
|
|
2994
|
+
V8_EXECUTE = 'V8.Execute',
|
|
2995
|
+
V8_CONSOLE_RUN_TASK = 'V8Console::runTask',
|
|
2996
|
+
SCHEDULE_POST_TASK_CALLBACK = 'SchedulePostTaskCallback',
|
|
2997
|
+
RUN_POST_TASK_CALLBACK = 'RunPostTaskCallback',
|
|
2998
|
+
ABORT_POST_TASK_CALLBACK = 'AbortPostTaskCallback',
|
|
2999
|
+
DEBUGGER_ASYNC_TASK_RUN = 'v8::Debugger::AsyncTaskRun',
|
|
3000
|
+
DEBUGGER_ASYNC_TASK_SCHEDULED = 'v8::Debugger::AsyncTaskScheduled',
|
|
3001
|
+
|
|
3002
|
+
/* Gc */
|
|
3003
|
+
GC = 'GCEvent',
|
|
3004
|
+
DOMGC = 'BlinkGC.AtomicPhase',
|
|
3005
|
+
MAJOR_GC = 'MajorGC',
|
|
3006
|
+
MINOR_GC = 'MinorGC',
|
|
3007
|
+
GC_COLLECT_GARBARGE = 'BlinkGC.AtomicPhase',
|
|
3008
|
+
CPPGC_SWEEP = 'CppGC.IncrementalSweep',
|
|
3009
|
+
|
|
3010
|
+
/* Layout */
|
|
3011
|
+
SCHEDULE_STYLE_RECALCULATION = 'ScheduleStyleRecalculation',
|
|
3012
|
+
LAYOUT = 'Layout',
|
|
3013
|
+
/** The real trace event is called 'UpdateLayoutTree' but we've aliased it for convenience. */
|
|
3014
|
+
RECALC_STYLE = 'UpdateLayoutTree',
|
|
3015
|
+
INVALIDATE_LAYOUT = 'InvalidateLayout',
|
|
3016
|
+
LAYOUT_INVALIDATION_TRACKING = 'LayoutInvalidationTracking',
|
|
3017
|
+
COMPUTE_INTERSECTION = 'ComputeIntersections',
|
|
3018
|
+
HIT_TEST = 'HitTest',
|
|
3019
|
+
PRE_PAINT = 'PrePaint',
|
|
3020
|
+
LAYERIZE = 'Layerize',
|
|
3021
|
+
LAYOUT_SHIFT = 'LayoutShift',
|
|
3022
|
+
SYNTHETIC_LAYOUT_SHIFT = 'SyntheticLayoutShift',
|
|
3023
|
+
SYNTHETIC_LAYOUT_SHIFT_CLUSTER = 'SyntheticLayoutShiftCluster',
|
|
3024
|
+
UPDATE_LAYER_TREE = 'UpdateLayerTree',
|
|
3025
|
+
SCHEDULE_STYLE_INVALIDATION_TRACKING = 'ScheduleStyleInvalidationTracking',
|
|
3026
|
+
STYLE_RECALC_INVALIDATION_TRACKING = 'StyleRecalcInvalidationTracking',
|
|
3027
|
+
STYLE_INVALIDATOR_INVALIDATION_TRACKING = 'StyleInvalidatorInvalidationTracking',
|
|
3028
|
+
SELECTOR_STATS = 'SelectorStats',
|
|
3029
|
+
BEGIN_COMMIT_COMPOSITOR_FRAME = 'BeginCommitCompositorFrame',
|
|
3030
|
+
PARSE_META_VIEWPORT = 'ParseMetaViewport',
|
|
3031
|
+
|
|
3032
|
+
/* Paint */
|
|
3033
|
+
SCROLL_LAYER = 'ScrollLayer',
|
|
3034
|
+
UPDATE_LAYER = 'UpdateLayer',
|
|
3035
|
+
PAINT_SETUP = 'PaintSetup',
|
|
3036
|
+
PAINT = 'Paint',
|
|
3037
|
+
PAINT_IMAGE = 'PaintImage',
|
|
3038
|
+
COMMIT = 'Commit',
|
|
3039
|
+
COMPOSITE_LAYERS = 'CompositeLayers',
|
|
3040
|
+
RASTER_TASK = 'RasterTask',
|
|
3041
|
+
IMAGE_DECODE_TASK = 'ImageDecodeTask',
|
|
3042
|
+
IMAGE_UPLOAD_TASK = 'ImageUploadTask',
|
|
3043
|
+
DECODE_IMAGE = 'Decode Image',
|
|
3044
|
+
DRAW_LAZY_PIXEL_REF = 'Draw LazyPixelRef',
|
|
3045
|
+
DECODE_LAZY_PIXEL_REF = 'Decode LazyPixelRef',
|
|
3046
|
+
GPU_TASK = 'GPUTask',
|
|
3047
|
+
RASTERIZE = 'Rasterize',
|
|
3048
|
+
EVENT_TIMING = 'EventTiming',
|
|
3049
|
+
|
|
3050
|
+
/* Compile */
|
|
3051
|
+
OPTIMIZE_CODE = 'V8.OptimizeCode',
|
|
3052
|
+
CACHE_SCRIPT = 'v8.produceCache',
|
|
3053
|
+
CACHE_MODULE = 'v8.produceModuleCache',
|
|
3054
|
+
// V8Sample events are coming from tracing and contain raw stacks with function addresses.
|
|
3055
|
+
// After being processed with help of JitCodeAdded and JitCodeMoved events they
|
|
3056
|
+
// get translated into function infos and stored as stacks in JSSample events.
|
|
3057
|
+
V8_SAMPLE = 'V8Sample',
|
|
3058
|
+
JIT_CODE_ADDED = 'JitCodeAdded',
|
|
3059
|
+
JIT_CODE_MOVED = 'JitCodeMoved',
|
|
3060
|
+
STREAMING_COMPILE_SCRIPT = 'v8.parseOnBackground',
|
|
3061
|
+
STREAMING_COMPILE_SCRIPT_WAITING = 'v8.parseOnBackgroundWaiting',
|
|
3062
|
+
STREAMING_COMPILE_SCRIPT_PARSING = 'v8.parseOnBackgroundParsing',
|
|
3063
|
+
BACKGROUND_DESERIALIZE = 'v8.deserializeOnBackground',
|
|
3064
|
+
FINALIZE_DESERIALIZATION = 'V8.FinalizeDeserialization',
|
|
3065
|
+
|
|
3066
|
+
/* Markers */
|
|
3067
|
+
COMMIT_LOAD = 'CommitLoad',
|
|
3068
|
+
MARK_LOAD = 'MarkLoad',
|
|
3069
|
+
MARK_DOM_CONTENT = 'MarkDOMContent',
|
|
3070
|
+
MARK_FIRST_PAINT = 'firstPaint',
|
|
3071
|
+
MARK_FCP = 'firstContentfulPaint',
|
|
3072
|
+
MARK_LCP_CANDIDATE = 'largestContentfulPaint::Candidate',
|
|
3073
|
+
MARK_LCP_INVALIDATE = 'largestContentfulPaint::Invalidate',
|
|
3074
|
+
NAVIGATION_START = 'navigationStart',
|
|
3075
|
+
CONSOLE_TIME = 'ConsoleTime',
|
|
3076
|
+
USER_TIMING = 'UserTiming',
|
|
3077
|
+
INTERACTIVE_TIME = 'InteractiveTime',
|
|
3078
|
+
TIME_STAMP = 'TimeStamp',
|
|
3079
|
+
|
|
3080
|
+
/* Frames */
|
|
3081
|
+
BEGIN_FRAME = 'BeginFrame',
|
|
3082
|
+
NEEDS_BEGIN_FRAME_CHANGED = 'NeedsBeginFrameChanged',
|
|
3083
|
+
BEGIN_MAIN_THREAD_FRAME = 'BeginMainThreadFrame',
|
|
3084
|
+
ACTIVATE_LAYER_TREE = 'ActivateLayerTree',
|
|
3085
|
+
DRAW_FRAME = 'DrawFrame',
|
|
3086
|
+
DROPPED_FRAME = 'DroppedFrame',
|
|
3087
|
+
FRAME_STARTED_LOADING = 'FrameStartedLoading',
|
|
3088
|
+
PIPELINE_REPORTER = 'PipelineReporter',
|
|
3089
|
+
SCREENSHOT = 'Screenshot',
|
|
3090
|
+
|
|
3091
|
+
/* Network request events */
|
|
3092
|
+
RESOURCE_WILL_SEND_REQUEST = 'ResourceWillSendRequest',
|
|
3093
|
+
RESOURCE_SEND_REQUEST = 'ResourceSendRequest',
|
|
3094
|
+
RESOURCE_RECEIVE_RESPONSE = 'ResourceReceiveResponse',
|
|
3095
|
+
RESOURCE_RECEIVE_DATA = 'ResourceReceivedData',
|
|
3096
|
+
RESOURCE_FINISH = 'ResourceFinish',
|
|
3097
|
+
RESOURCE_MARK_AS_CACHED = 'ResourceMarkAsCached',
|
|
3098
|
+
|
|
3099
|
+
/* Web sockets */
|
|
3100
|
+
WEB_SOCKET_SEND_HANDSHAKE_REQUEST = 'WebSocketSendHandshakeRequest',
|
|
3101
|
+
WEB_SOCKET_RECEIVE_HANDSHAKE_REQUEST = 'WebSocketReceiveHandshakeResponse',
|
|
3102
|
+
|
|
3103
|
+
/* CPU Profiling */
|
|
3104
|
+
CPU_PROFILE = 'CpuProfile',
|
|
3105
|
+
PROFILE = 'Profile',
|
|
3106
|
+
START_PROFILING = 'CpuProfiler::StartProfiling',
|
|
3107
|
+
PROFILE_CHUNK = 'ProfileChunk',
|
|
3108
|
+
UPDATE_COUNTERS = 'UpdateCounters',
|
|
3109
|
+
|
|
3110
|
+
JS_SAMPLE = 'JSSample',
|
|
3111
|
+
|
|
3112
|
+
/* Other */
|
|
3113
|
+
ANIMATION = 'Animation',
|
|
3114
|
+
PARSE_AUTHOR_STYLE_SHEET = 'ParseAuthorStyleSheet',
|
|
3115
|
+
EMBEDDER_CALLBACK = 'EmbedderCallback',
|
|
3116
|
+
SET_LAYER_TREE_ID = 'SetLayerTreeId',
|
|
3117
|
+
TRACING_STARTED_IN_PAGE = 'TracingStartedInPage',
|
|
3118
|
+
TRACING_STARTED_IN_BROWSER = 'TracingStartedInBrowser',
|
|
3119
|
+
TRACING_SESSION_ID_FOR_WORKER = 'TracingSessionIdForWorker',
|
|
3120
|
+
LAZY_PIXEL_REF = 'LazyPixelRef',
|
|
3121
|
+
LAYER_TREE_HOST_IMPL_SNAPSHOT = 'cc::LayerTreeHostImpl',
|
|
3122
|
+
PICTURE_SNAPSHOT = 'cc::Picture',
|
|
3123
|
+
DISPLAY_ITEM_LIST_SNAPSHOT = 'cc::DisplayItemList',
|
|
3124
|
+
INPUT_LATENCY_MOUSE_MOVE = 'InputLatency::MouseMove',
|
|
3125
|
+
INPUT_LATENCY_MOUSE_WHEEL = 'InputLatency::MouseWheel',
|
|
3126
|
+
IMPL_SIDE_FLING = 'InputHandlerProxy::HandleGestureFling::started',
|
|
3127
|
+
|
|
3128
|
+
SCHEDULE_POST_MESSAGE = 'SchedulePostMessage',
|
|
3129
|
+
HANDLE_POST_MESSAGE = 'HandlePostMessage',
|
|
3130
|
+
|
|
3131
|
+
RENDER_FRAME_IMPL_CREATE_CHILD_FRAME = 'RenderFrameImpl::createChildFrame',
|
|
3132
|
+
LAYOUT_IMAGE_UNSIZED = 'LayoutImageUnsized',
|
|
3133
|
+
|
|
3134
|
+
DOM_LOADING = 'domLoading',
|
|
3135
|
+
BEGIN_REMOTE_FONT_LOAD = 'BeginRemoteFontLoad',
|
|
3136
|
+
REMOTE_FONT_LOADED = 'RemoteFontLoaded',
|
|
3137
|
+
|
|
3138
|
+
ANIMATION_FRAME = 'AnimationFrame',
|
|
3139
|
+
ANIMATION_FRAME_PRESENTATION = 'AnimationFrame::Presentation',
|
|
3140
|
+
|
|
3141
|
+
SYNTHETIC_NETWORK_REQUEST = 'SyntheticNetworkRequest',
|
|
3142
|
+
USER_TIMING_MEASURE = 'UserTiming::Measure',
|
|
3143
|
+
|
|
3144
|
+
LINK_PRECONNECT = 'LinkPreconnect',
|
|
3145
|
+
}
|
|
3146
|
+
|
|
3147
|
+
/**
|
|
3148
|
+
* NOT AN EXHAUSTIVE LIST: just some categories we use and refer
|
|
3149
|
+
* to in multiple places.
|
|
3150
|
+
**/
|
|
3151
|
+
export const Categories = {
|
|
3152
|
+
Console: 'blink.console',
|
|
3153
|
+
UserTiming: 'blink.user_timing',
|
|
3154
|
+
Loading: 'loading',
|
|
3155
|
+
} as const;
|
|
3156
|
+
|
|
3157
|
+
/**
|
|
3158
|
+
* The frames implementation in handlers/FramesHandler is considered "legacy"
|
|
3159
|
+
* in that it is based on the old TimelineModel implementation rather than
|
|
3160
|
+
* following the pattern of the other handlers. This will change in time as we
|
|
3161
|
+
* migrate the frames track to use AnimationFrame events, but for now we
|
|
3162
|
+
* maintain it because the effort required to migrate was large.
|
|
3163
|
+
* Consequently, the types we use through the codebase to refer to these frames
|
|
3164
|
+
* usually use ModelHandlers.FramesHandler.TimelineFrame, but in
|
|
3165
|
+
* trace/types/*.ts we cannot refer to types defined in the Handlers. To avoid a
|
|
3166
|
+
* circular dependency, we define these interfaces here which are implemented by
|
|
3167
|
+
* the classes in FramesHandler.ts, but they can also be used to refer to
|
|
3168
|
+
* instances of frames in trace/types/*.ts which is unable to import from
|
|
3169
|
+
* handlers.
|
|
3170
|
+
*/
|
|
3171
|
+
export interface LegacyTimelineFrame extends Event {
|
|
3172
|
+
startTime: Micro;
|
|
3173
|
+
startTimeOffset: Micro;
|
|
3174
|
+
endTime: Micro;
|
|
3175
|
+
duration: Micro;
|
|
3176
|
+
idle: boolean;
|
|
3177
|
+
dropped: boolean;
|
|
3178
|
+
isPartial: boolean;
|
|
3179
|
+
layerTree: LegacyFrameLayerTreeData|null;
|
|
3180
|
+
paints: LegacyLayerPaintEvent[];
|
|
3181
|
+
mainFrameId?: number;
|
|
3182
|
+
readonly seqId: number;
|
|
3183
|
+
index: number;
|
|
3184
|
+
}
|
|
3185
|
+
|
|
3186
|
+
export function isLegacyTimelineFrame(data: Event): data is LegacyTimelineFrame {
|
|
3187
|
+
return 'idle' in data && typeof data.idle === 'boolean';
|
|
3188
|
+
}
|
|
3189
|
+
|
|
3190
|
+
export interface LegacyFrameLayerTreeData {
|
|
3191
|
+
entry: LayerTreeHostImplSnapshot;
|
|
3192
|
+
paints: LegacyLayerPaintEvent[];
|
|
3193
|
+
}
|
|
3194
|
+
|
|
3195
|
+
export interface LegacyLayerPaintEvent {
|
|
3196
|
+
layerId(): number;
|
|
3197
|
+
event(): Paint;
|
|
3198
|
+
picture(): LegacyLayerPaintEventPicture|null;
|
|
3199
|
+
}
|
|
3200
|
+
|
|
3201
|
+
export interface LegacyLayerPaintEventPicture {
|
|
3202
|
+
rect: number[];
|
|
3203
|
+
serializedPicture: string;
|
|
3204
|
+
}
|
|
3205
|
+
|
|
3206
|
+
/** Same as `TraceEventTargetRundown` in `EnhancedTracesParser` */
|
|
3207
|
+
export interface RundownScriptCompiled extends Event {
|
|
3208
|
+
cat: 'disabled-by-default-devtools.target-rundown';
|
|
3209
|
+
name: SDK.EnhancedTracesParser.RundownScriptCompiled['name'];
|
|
3210
|
+
args: Args&{
|
|
3211
|
+
data?: SDK.EnhancedTracesParser.RundownScriptCompiled['args']['data'],
|
|
3212
|
+
};
|
|
3213
|
+
}
|
|
3214
|
+
|
|
3215
|
+
export function isRundownScriptCompiled(event: Event): event is RundownScriptCompiled {
|
|
3216
|
+
return event.cat === 'disabled-by-default-devtools.target-rundown';
|
|
3217
|
+
}
|
|
3218
|
+
|
|
3219
|
+
/** Same as `TraceEventScriptRundown` in `EnhancedTracesParser` */
|
|
3220
|
+
export interface RundownScript extends Event {
|
|
3221
|
+
cat: 'disabled-by-default-devtools.v8-source-rundown';
|
|
3222
|
+
name: SDK.EnhancedTracesParser.RundownScript['name'];
|
|
3223
|
+
args: Args&{
|
|
3224
|
+
data: SDK.EnhancedTracesParser.RundownScript['args']['data'],
|
|
3225
|
+
};
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3228
|
+
export function isRundownScript(event: Event): event is RundownScript {
|
|
3229
|
+
return event.cat === 'disabled-by-default-devtools.v8-source-rundown' && event.name === 'ScriptCatchup';
|
|
3230
|
+
}
|
|
3231
|
+
|
|
3232
|
+
/** Same as `TraceEventScriptRundownSource` in `EnhancedTracesParser` */
|
|
3233
|
+
export interface RundownScriptSource extends Event {
|
|
3234
|
+
cat: 'disabled-by-default-devtools.v8-source-rundown-sources';
|
|
3235
|
+
name: 'ScriptCatchup';
|
|
3236
|
+
args: Args&{
|
|
3237
|
+
data: SDK.EnhancedTracesParser.RundownScriptSource['args']['data'],
|
|
3238
|
+
};
|
|
3239
|
+
}
|
|
3240
|
+
|
|
3241
|
+
export function isRundownScriptSource(event: Event): event is RundownScriptSource {
|
|
3242
|
+
return event.cat === 'disabled-by-default-devtools.v8-source-rundown-sources' && event.name === 'ScriptCatchup';
|
|
3243
|
+
}
|
|
3244
|
+
|
|
3245
|
+
export interface RundownScriptSourceLarge extends Event {
|
|
3246
|
+
cat: 'disabled-by-default-devtools.v8-source-rundown-sources';
|
|
3247
|
+
name: 'LargeScriptCatchup';
|
|
3248
|
+
args: Args&{
|
|
3249
|
+
data: {
|
|
3250
|
+
isolate: number,
|
|
3251
|
+
scriptId: number,
|
|
3252
|
+
splitIndex: number,
|
|
3253
|
+
splitCount: number,
|
|
3254
|
+
sourceText: string,
|
|
3255
|
+
},
|
|
3256
|
+
};
|
|
3257
|
+
}
|
|
3258
|
+
|
|
3259
|
+
export function isRundownScriptSourceLarge(event: Event): event is RundownScriptSourceLarge {
|
|
3260
|
+
return event.cat === 'disabled-by-default-devtools.v8-source-rundown-sources' && event.name === 'LargeScriptCatchup';
|
|
3261
|
+
}
|
|
3262
|
+
|
|
3263
|
+
export interface RundownScriptStub extends Event {
|
|
3264
|
+
cat: 'disabled-by-default-devtools.v8-source-rundown-sources';
|
|
3265
|
+
name: 'StubScriptCatchup';
|
|
3266
|
+
args: Args&{
|
|
3267
|
+
data: {
|
|
3268
|
+
isolate: number,
|
|
3269
|
+
scriptId: number,
|
|
3270
|
+
},
|
|
3271
|
+
};
|
|
3272
|
+
}
|
|
3273
|
+
|
|
3274
|
+
export function isAnyScriptSourceEvent(event: Event): event is RundownScriptSource|RundownScriptSourceLarge|
|
|
3275
|
+
RundownScriptStub {
|
|
3276
|
+
return event.cat === 'disabled-by-default-devtools.v8-source-rundown-sources';
|
|
3277
|
+
}
|