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,515 @@
|
|
|
1
|
+
// Copyright 2024 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import type * as Protocol from '../../generated/protocol.js';
|
|
6
|
+
import * as Common from '../common/common.js';
|
|
7
|
+
import type * as Platform from '../platform/platform.js';
|
|
8
|
+
import {UserVisibleError} from '../platform/platform.js';
|
|
9
|
+
|
|
10
|
+
import type {
|
|
11
|
+
HydratingDataPerTarget, RehydratingExecutionContext, RehydratingScript, RehydratingTarget} from
|
|
12
|
+
'./RehydratingObject.js';
|
|
13
|
+
import type {SourceMapV3} from './SourceMap.js';
|
|
14
|
+
import type {TraceObject} from './TraceObject.js';
|
|
15
|
+
|
|
16
|
+
interface EventBase {
|
|
17
|
+
cat: string;
|
|
18
|
+
pid: number;
|
|
19
|
+
args: {data: object};
|
|
20
|
+
name: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* While called 'TargetRundown', this event is emitted for each script that is compiled or evaluated.
|
|
25
|
+
* Within EnhancedTraceParser, this event is used to construct targets and execution contexts (and to associate scripts to frames).
|
|
26
|
+
*
|
|
27
|
+
* See `inspector_target_rundown_event::Data` https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/inspector/inspector_trace_events.cc;l=1189-1232;drc=48d6f7175422b2c969c14258f9f8d5b196c28d18
|
|
28
|
+
*/
|
|
29
|
+
export interface RundownScriptCompiled extends EventBase {
|
|
30
|
+
cat: 'disabled-by-default-devtools.target-rundown';
|
|
31
|
+
name: 'ScriptCompiled'|'ModuleEvaluated';
|
|
32
|
+
args: {
|
|
33
|
+
data: {
|
|
34
|
+
frame: Protocol.Page.FrameId,
|
|
35
|
+
frameType: 'page'|'iframe',
|
|
36
|
+
url: string,
|
|
37
|
+
/**
|
|
38
|
+
* Older traces were a number, but this is an unsigned 64 bit value, so that was a bug.
|
|
39
|
+
* New traces use string instead. See https://crbug.com/447654178.
|
|
40
|
+
*/
|
|
41
|
+
isolate: string|number,
|
|
42
|
+
/** AKA V8ContextToken. https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/inspector/inspector_trace_events.cc;l=1229;drc=3c88f61e18b043e70c225d8d57c77832a85e7f58 */
|
|
43
|
+
v8context: string,
|
|
44
|
+
origin: string,
|
|
45
|
+
scriptId: number,
|
|
46
|
+
/** script->World().isMainWorld() */
|
|
47
|
+
isDefault?: boolean,
|
|
48
|
+
contextType?: 'default'|'isolated'|'worker',
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* When profiling starts, all currently loaded scripts are emitted via this event.
|
|
54
|
+
*
|
|
55
|
+
* See `Script::TraceScriptRundown()` https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/script.cc;l=184-220;drc=328f6c467b940f322544567740c9c871064d045c
|
|
56
|
+
*/
|
|
57
|
+
export interface RundownScript extends EventBase {
|
|
58
|
+
cat: 'disabled-by-default-devtools.v8-source-rundown';
|
|
59
|
+
name: 'ScriptCatchup';
|
|
60
|
+
args: {
|
|
61
|
+
data: {
|
|
62
|
+
/**
|
|
63
|
+
* Older traces were a number, but this is an unsigned 64 bit value, so that was a bug.
|
|
64
|
+
* New traces use string instead. See https://crbug.com/447654178.
|
|
65
|
+
*/
|
|
66
|
+
isolate: string|number,
|
|
67
|
+
executionContextId: Protocol.Runtime.ExecutionContextId,
|
|
68
|
+
scriptId: number,
|
|
69
|
+
isModule: boolean,
|
|
70
|
+
/** aka HasSourceURLComment */
|
|
71
|
+
hasSourceUrl: boolean,
|
|
72
|
+
// These don't actually get set in v8.
|
|
73
|
+
url?: string,
|
|
74
|
+
hash?: string,
|
|
75
|
+
/** value of the sourceURL comment. */
|
|
76
|
+
sourceUrl?: string,
|
|
77
|
+
/* value of the sourceMappingURL comment */
|
|
78
|
+
sourceMapUrl?: string,
|
|
79
|
+
/** If true, the source map url was a data URL, so the `sourceMapUrl` was removed. */
|
|
80
|
+
sourceMapUrlElided?: boolean,
|
|
81
|
+
startLine?: number,
|
|
82
|
+
startColumn?: number,
|
|
83
|
+
endLine?: number,
|
|
84
|
+
endColumn?: number,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface RundownScriptSource extends EventBase {
|
|
90
|
+
cat: 'disabled-by-default-devtools.v8-source-rundown-sources';
|
|
91
|
+
name: 'ScriptCatchup'|'LargeScriptCatchup'|'TooLargeScriptCatchup';
|
|
92
|
+
args: {
|
|
93
|
+
data: {
|
|
94
|
+
isolate: number,
|
|
95
|
+
scriptId: number,
|
|
96
|
+
length?: number,
|
|
97
|
+
sourceText?: string,
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
interface TracingStartedInBrowser extends EventBase {
|
|
103
|
+
cat: 'disabled-by-default-devtools.timeline';
|
|
104
|
+
args: {
|
|
105
|
+
data: {
|
|
106
|
+
frames: [{
|
|
107
|
+
frame: Protocol.Page.FrameId,
|
|
108
|
+
isInPrimaryMainFrame: boolean,
|
|
109
|
+
isOutermostMainFrame: boolean,
|
|
110
|
+
parent: Protocol.Page.FrameId,
|
|
111
|
+
processId: number,
|
|
112
|
+
url: string,
|
|
113
|
+
pid: number,
|
|
114
|
+
}],
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
interface FunctionCall extends EventBase {
|
|
120
|
+
cat: 'devtools.timeline';
|
|
121
|
+
args: {
|
|
122
|
+
data: {
|
|
123
|
+
frame: Protocol.Page.FrameId,
|
|
124
|
+
scriptId: Protocol.Runtime.ScriptId,
|
|
125
|
+
/**
|
|
126
|
+
* Older traces were a number, but this is an unsigned 64 bit value, so that was a bug.
|
|
127
|
+
* New traces use string instead. See https://crbug.com/447654178.
|
|
128
|
+
*/
|
|
129
|
+
isolate?: string|number,
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export class EnhancedTracesParser {
|
|
135
|
+
#trace: TraceObject;
|
|
136
|
+
#scriptRundownEvents: RundownScript[] = [];
|
|
137
|
+
#scriptToV8Context: Map<string, string> = new Map<string, string>();
|
|
138
|
+
#scriptToFrame: Map<string, Protocol.Page.FrameId> = new Map<string, Protocol.Page.FrameId>();
|
|
139
|
+
#scriptToScriptSource: Map<string, string> = new Map<string, string>();
|
|
140
|
+
#largeScriptToScriptSource: Map<string, string[]> = new Map<string, string[]>();
|
|
141
|
+
#scriptToSourceLength: Map<string, number> = new Map<string, number>();
|
|
142
|
+
#targets: RehydratingTarget[] = [];
|
|
143
|
+
#executionContexts: RehydratingExecutionContext[] = [];
|
|
144
|
+
#scripts: RehydratingScript[] = [];
|
|
145
|
+
static readonly enhancedTraceVersion: number = 1;
|
|
146
|
+
|
|
147
|
+
constructor(trace: TraceObject) {
|
|
148
|
+
this.#trace = trace;
|
|
149
|
+
|
|
150
|
+
// Initialize with the trace provided.
|
|
151
|
+
try {
|
|
152
|
+
this.parseEnhancedTrace();
|
|
153
|
+
} catch (e) {
|
|
154
|
+
throw new UserVisibleError.UserVisibleError(e);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
parseEnhancedTrace(): void {
|
|
159
|
+
for (const event of this.#trace.traceEvents) {
|
|
160
|
+
if (this.isTracingStartedInBrowser(event)) {
|
|
161
|
+
// constructs all targets by devtools.timeline TracingStartedInBrowser
|
|
162
|
+
const data = event.args?.data;
|
|
163
|
+
for (const frame of data.frames) {
|
|
164
|
+
if (frame.url === 'about:blank') {
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
const frameId = frame.frame as string as Protocol.Target.TargetID;
|
|
168
|
+
if (!this.#targets.find(target => target.targetId === frameId)) {
|
|
169
|
+
const frameType = frame.isOutermostMainFrame ? 'page' : 'iframe';
|
|
170
|
+
this.#targets.push({
|
|
171
|
+
targetId: frameId,
|
|
172
|
+
type: frameType,
|
|
173
|
+
pid: frame.processId,
|
|
174
|
+
url: frame.url,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
} else if (this.isFunctionCallEvent(event)) {
|
|
179
|
+
// constructs all script to frame mapping with devtools.timeline FunctionCall
|
|
180
|
+
const data = event.args?.data;
|
|
181
|
+
if (data.isolate) {
|
|
182
|
+
this.#scriptToFrame.set(this.getScriptIsolateId(data.isolate, data.scriptId), data.frame);
|
|
183
|
+
}
|
|
184
|
+
} else if (this.isRundownScriptCompiled(event)) {
|
|
185
|
+
// Set up script to v8 context mapping
|
|
186
|
+
const data = event.args?.data;
|
|
187
|
+
this.#scriptToV8Context.set(this.getScriptIsolateId(data.isolate, data.scriptId), data.v8context);
|
|
188
|
+
this.#scriptToFrame.set(this.getScriptIsolateId(data.isolate, data.scriptId), data.frame);
|
|
189
|
+
// All the targets should've been added by the TracingStartedInBrowser event, but just in case we're missing some there
|
|
190
|
+
const frameId = data.frame as string as Protocol.Target.TargetID;
|
|
191
|
+
if (!this.#targets.find(target => target.targetId === frameId)) {
|
|
192
|
+
this.#targets.push({
|
|
193
|
+
targetId: frameId,
|
|
194
|
+
type: data.frameType,
|
|
195
|
+
isolate: String(data.isolate),
|
|
196
|
+
pid: event.pid,
|
|
197
|
+
url: data.url,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
// Add execution context, need to put back execution context id with info from other traces
|
|
201
|
+
if (!this.#executionContexts.find(executionContext => executionContext.v8Context === data.v8context)) {
|
|
202
|
+
this.#executionContexts.push({
|
|
203
|
+
id: -1 as Protocol.Runtime.ExecutionContextId,
|
|
204
|
+
origin: data.origin,
|
|
205
|
+
v8Context: data.v8context,
|
|
206
|
+
auxData: {
|
|
207
|
+
frameId: data.frame,
|
|
208
|
+
isDefault: data.isDefault,
|
|
209
|
+
type: data.contextType,
|
|
210
|
+
},
|
|
211
|
+
isolate: String(data.isolate),
|
|
212
|
+
name: data.origin,
|
|
213
|
+
uniqueId: `${data.v8context}-${data.isolate}`,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
} else if (this.isRundownScript(event)) {
|
|
217
|
+
this.#scriptRundownEvents.push(event);
|
|
218
|
+
const data = event.args.data;
|
|
219
|
+
// Add script
|
|
220
|
+
if (!this.#scripts.find(
|
|
221
|
+
script => script.scriptId === String(data.scriptId) && script.isolate === String(data.isolate))) {
|
|
222
|
+
this.#scripts.push({
|
|
223
|
+
scriptId: String(data.scriptId) as Protocol.Runtime.ScriptId,
|
|
224
|
+
isolate: String(data.isolate),
|
|
225
|
+
buildId: '',
|
|
226
|
+
executionContextId: data.executionContextId,
|
|
227
|
+
startLine: data.startLine ?? 0,
|
|
228
|
+
startColumn: data.startColumn ?? 0,
|
|
229
|
+
endLine: data.endLine ?? 0,
|
|
230
|
+
endColumn: data.endColumn ?? 0,
|
|
231
|
+
hash: data.hash ?? '',
|
|
232
|
+
isModule: data.isModule,
|
|
233
|
+
url: data.url ?? '',
|
|
234
|
+
hasSourceURL: data.hasSourceUrl,
|
|
235
|
+
sourceURL: data.sourceUrl ?? '',
|
|
236
|
+
sourceMapURL: data.sourceMapUrl,
|
|
237
|
+
pid: event.pid,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
} else if (this.isRundownScriptSource(event)) {
|
|
241
|
+
// Set up script to source text and length mapping
|
|
242
|
+
const data = event.args.data;
|
|
243
|
+
const scriptIsolateId = this.getScriptIsolateId(data.isolate, data.scriptId);
|
|
244
|
+
if ('splitIndex' in data && 'splitCount' in data) {
|
|
245
|
+
if (!this.#largeScriptToScriptSource.has(scriptIsolateId)) {
|
|
246
|
+
this.#largeScriptToScriptSource.set(scriptIsolateId, new Array(data.splitCount).fill('') as string[]);
|
|
247
|
+
}
|
|
248
|
+
const splittedSource = this.#largeScriptToScriptSource.get(scriptIsolateId);
|
|
249
|
+
if (splittedSource && data.sourceText) {
|
|
250
|
+
splittedSource[data.splitIndex as number] = data.sourceText;
|
|
251
|
+
}
|
|
252
|
+
} else {
|
|
253
|
+
if (data.sourceText) {
|
|
254
|
+
this.#scriptToScriptSource.set(scriptIsolateId, data.sourceText);
|
|
255
|
+
}
|
|
256
|
+
if (data.length) {
|
|
257
|
+
this.#scriptToSourceLength.set(scriptIsolateId, data.length);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
data(): HydratingDataPerTarget[] {
|
|
265
|
+
// Put back execution context id
|
|
266
|
+
const v8ContextToExecutionContextId: Map<string, Protocol.Runtime.ExecutionContextId> =
|
|
267
|
+
new Map<string, Protocol.Runtime.ExecutionContextId>();
|
|
268
|
+
this.#scriptRundownEvents.forEach(scriptRundownEvent => {
|
|
269
|
+
const data = scriptRundownEvent.args.data;
|
|
270
|
+
const v8Context = this.#scriptToV8Context.get(this.getScriptIsolateId(data.isolate, data.scriptId));
|
|
271
|
+
if (v8Context) {
|
|
272
|
+
v8ContextToExecutionContextId.set(v8Context, data.executionContextId);
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
this.#executionContexts.forEach(executionContext => {
|
|
276
|
+
if (executionContext.v8Context) {
|
|
277
|
+
const id = v8ContextToExecutionContextId.get(executionContext.v8Context);
|
|
278
|
+
if (id) {
|
|
279
|
+
executionContext.id = id;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
// Put back script source text and length
|
|
285
|
+
this.#scripts.forEach(script => {
|
|
286
|
+
const scriptIsolateId = this.getScriptIsolateId(script.isolate, script.scriptId);
|
|
287
|
+
if (this.#scriptToScriptSource.has(scriptIsolateId)) {
|
|
288
|
+
script.sourceText = this.#scriptToScriptSource.get(scriptIsolateId);
|
|
289
|
+
script.length = this.#scriptToSourceLength.get(scriptIsolateId);
|
|
290
|
+
} else if (this.#largeScriptToScriptSource.has(scriptIsolateId)) {
|
|
291
|
+
const splittedSources = this.#largeScriptToScriptSource.get(scriptIsolateId);
|
|
292
|
+
if (splittedSources) {
|
|
293
|
+
script.sourceText = splittedSources.join('');
|
|
294
|
+
script.length = script.sourceText.length;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
// put in the aux data
|
|
298
|
+
const linkedExecutionContext = this.#executionContexts.find(
|
|
299
|
+
context => context.id === script.executionContextId && context.isolate === script.isolate);
|
|
300
|
+
if (linkedExecutionContext) {
|
|
301
|
+
script.executionContextAuxData = linkedExecutionContext.auxData;
|
|
302
|
+
// If a script successfully mapped to an execution context and aux data, link script to frame
|
|
303
|
+
if (script.executionContextAuxData?.frameId) {
|
|
304
|
+
this.#scriptToFrame.set(scriptIsolateId, script.executionContextAuxData?.frameId);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
for (const script of this.#scripts) {
|
|
310
|
+
// Resolve the source map from the provided metadata.
|
|
311
|
+
// If no map is found for a given source map url, no source map is passed to the debugger model.
|
|
312
|
+
// Encoded as a data url so that the debugger model makes no network request.
|
|
313
|
+
// NOTE: consider passing directly as object and hacking `parsedScriptSource` in DebuggerModel.ts to handle
|
|
314
|
+
// this fake event. Would avoid a lot of wasteful (de)serialization. Maybe add SDK.Script.hydratedSourceMap.
|
|
315
|
+
this.resolveSourceMap(script);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
return this.groupContextsAndScriptsUnderTarget(this.#targets, this.#executionContexts, this.#scripts);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
private resolveSourceMap(script: RehydratingScript): void {
|
|
322
|
+
if (script.sourceMapURL?.startsWith('data:')) {
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const sourceMap = this.getSourceMapFromMetadata(script);
|
|
327
|
+
if (!sourceMap) {
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// Note: this encoding + re-parsing overhead cost ~10ms per 1MB of JSON on my
|
|
332
|
+
// Mac M1 Pro.
|
|
333
|
+
// See https://crrev.com/c/6490409/comments/f294c12a_69781e24
|
|
334
|
+
const payload = encodeURIComponent(JSON.stringify(sourceMap));
|
|
335
|
+
script.sourceMapURL = `data:application/json;charset=utf-8,${payload}`;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
private getSourceMapFromMetadata(script: RehydratingScript): SourceMapV3|undefined {
|
|
339
|
+
const {hasSourceURL, sourceURL, url, sourceMapURL, isolate, scriptId} = script;
|
|
340
|
+
|
|
341
|
+
if (!sourceMapURL || !this.#trace.metadata.sourceMaps) {
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const frame =
|
|
346
|
+
this.#scriptToFrame.get(this.getScriptIsolateId(isolate, scriptId)) as string as Protocol.Target.TargetID;
|
|
347
|
+
if (!frame) {
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
const target = this.#targets.find(t => t.targetId === frame);
|
|
352
|
+
if (!target) {
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
let resolvedSourceUrl = url;
|
|
357
|
+
if (hasSourceURL && sourceURL) {
|
|
358
|
+
const targetUrl = target.url as Platform.DevToolsPath.UrlString;
|
|
359
|
+
resolvedSourceUrl = Common.ParsedURL.ParsedURL.completeURL(targetUrl, sourceURL) ?? sourceURL;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// Resolve the source map url. The value given by v8 may be relative, so resolve it here.
|
|
363
|
+
// This process should match the one in `SourceMapManager.attachSourceMap`.
|
|
364
|
+
const resolvedSourceMapUrl =
|
|
365
|
+
Common.ParsedURL.ParsedURL.completeURL(resolvedSourceUrl as Platform.DevToolsPath.UrlString, sourceMapURL);
|
|
366
|
+
if (!resolvedSourceMapUrl) {
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
const {sourceMap} = this.#trace.metadata.sourceMaps.find(m => m.sourceMapUrl === resolvedSourceMapUrl) ?? {};
|
|
371
|
+
return sourceMap;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
private getScriptIsolateId(isolate: number|string, scriptId: Protocol.Runtime.ScriptId|number): string {
|
|
375
|
+
return `${scriptId}@${isolate}`;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
private getExecutionContextIsolateId(isolate: number|string, executionContextId: Protocol.Runtime.ExecutionContextId):
|
|
379
|
+
string {
|
|
380
|
+
return `${executionContextId}@${isolate}`;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
private isTraceEvent(event: unknown): event is EventBase {
|
|
384
|
+
return 'cat' in (event as EventBase) && 'pid' in (event as EventBase) && 'args' in (event as EventBase) &&
|
|
385
|
+
'data' in (event as EventBase).args;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
private isRundownScriptCompiled(event: unknown): event is RundownScriptCompiled {
|
|
389
|
+
return this.isTraceEvent(event) && event.cat === 'disabled-by-default-devtools.target-rundown';
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
private isRundownScript(event: unknown): event is RundownScript {
|
|
393
|
+
return this.isTraceEvent(event) && event.cat === 'disabled-by-default-devtools.v8-source-rundown';
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
private isRundownScriptSource(event: unknown): event is RundownScriptSource {
|
|
397
|
+
return this.isTraceEvent(event) && event.cat === 'disabled-by-default-devtools.v8-source-rundown-sources';
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
private isTracingStartedInBrowser(event: unknown): event is TracingStartedInBrowser {
|
|
401
|
+
return this.isTraceEvent(event) && event.cat === 'disabled-by-default-devtools.timeline' &&
|
|
402
|
+
event.name === 'TracingStartedInBrowser';
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
private isFunctionCallEvent(event: unknown): event is FunctionCall {
|
|
406
|
+
return this.isTraceEvent(event) && event.cat === 'devtools.timeline' && event.name === 'FunctionCall';
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
private groupContextsAndScriptsUnderTarget(
|
|
410
|
+
targets: RehydratingTarget[], executionContexts: RehydratingExecutionContext[],
|
|
411
|
+
scripts: RehydratingScript[]): HydratingDataPerTarget[] {
|
|
412
|
+
const data: HydratingDataPerTarget[] = [];
|
|
413
|
+
const targetIds = new Set<Protocol.Target.TargetID>();
|
|
414
|
+
const targetToExecutionContexts: Map<string, RehydratingExecutionContext[]> =
|
|
415
|
+
new Map<Protocol.Target.TargetID, RehydratingExecutionContext[]>();
|
|
416
|
+
// We want to keep track of how each execution context is linked to targets so we may use this
|
|
417
|
+
// information to link scripts with no target to a target
|
|
418
|
+
const executionContextIsolateToTarget: Map<string, Protocol.Target.TargetID> =
|
|
419
|
+
new Map<string, Protocol.Target.TargetID>();
|
|
420
|
+
const targetToScripts: Map<Protocol.Target.TargetID, RehydratingScript[]> =
|
|
421
|
+
new Map<Protocol.Target.TargetID, RehydratingScript[]>();
|
|
422
|
+
const orphanScripts: RehydratingScript[] = [];
|
|
423
|
+
|
|
424
|
+
// Initialize all the mapping needed
|
|
425
|
+
for (const target of targets) {
|
|
426
|
+
targetIds.add(target.targetId);
|
|
427
|
+
targetToExecutionContexts.set(target.targetId, []);
|
|
428
|
+
targetToScripts.set(target.targetId, []);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
// Put all of the known execution contexts under respective targets
|
|
432
|
+
for (const executionContext of executionContexts) {
|
|
433
|
+
const frameId = executionContext.auxData?.frameId as string as Protocol.Target.TargetID;
|
|
434
|
+
if (frameId && targetIds.has(frameId)) {
|
|
435
|
+
targetToExecutionContexts.get(frameId)?.push(executionContext);
|
|
436
|
+
executionContextIsolateToTarget.set(
|
|
437
|
+
this.getExecutionContextIsolateId(executionContext.isolate, executionContext.id), frameId);
|
|
438
|
+
} else {
|
|
439
|
+
console.error('Execution context can\'t be linked to a target', executionContext);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// Put all of the scripts under respective targets with collected information
|
|
444
|
+
for (const script of scripts) {
|
|
445
|
+
const scriptExecutionContextIsolateId =
|
|
446
|
+
this.getExecutionContextIsolateId(script.isolate, script.executionContextId);
|
|
447
|
+
const scriptFrameId = script.executionContextAuxData?.frameId as string as Protocol.Target.TargetID;
|
|
448
|
+
if (script.executionContextAuxData?.frameId && targetIds.has(scriptFrameId)) {
|
|
449
|
+
targetToScripts.get(scriptFrameId)?.push(script);
|
|
450
|
+
executionContextIsolateToTarget.set(scriptExecutionContextIsolateId, scriptFrameId);
|
|
451
|
+
} else if (this.#scriptToFrame.has(this.getScriptIsolateId(script.isolate, script.scriptId))) {
|
|
452
|
+
const targetId = this.#scriptToFrame.get(this.getScriptIsolateId(script.isolate, script.scriptId)) as string as
|
|
453
|
+
Protocol.Target.TargetID;
|
|
454
|
+
if (targetId) {
|
|
455
|
+
targetToScripts.get(targetId)?.push(script);
|
|
456
|
+
executionContextIsolateToTarget.set(scriptExecutionContextIsolateId, targetId);
|
|
457
|
+
}
|
|
458
|
+
} else {
|
|
459
|
+
// These scripts are not linked to any target
|
|
460
|
+
orphanScripts.push(script);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// If a script is not linked to a target, use executionContext@isolate to link to a target
|
|
465
|
+
// Using PID is the last resort
|
|
466
|
+
for (const orphanScript of orphanScripts) {
|
|
467
|
+
const orphanScriptExecutionContextIsolateId =
|
|
468
|
+
this.getExecutionContextIsolateId(orphanScript.isolate, orphanScript.executionContextId);
|
|
469
|
+
const frameId = executionContextIsolateToTarget.get(orphanScriptExecutionContextIsolateId);
|
|
470
|
+
|
|
471
|
+
if (frameId) {
|
|
472
|
+
// Found a link via execution context, use it.
|
|
473
|
+
targetToScripts.get(frameId)?.push(orphanScript);
|
|
474
|
+
} else if (orphanScript.pid) {
|
|
475
|
+
const target = targets.find(target => target.pid === orphanScript.pid);
|
|
476
|
+
if (target) {
|
|
477
|
+
targetToScripts.get(target.targetId)?.push(orphanScript);
|
|
478
|
+
}
|
|
479
|
+
} else {
|
|
480
|
+
console.error('Script can\'t be linked to any target', orphanScript);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
// Now all the scripts are linked to a target, we want to make sure all the scripts are pointing to a valid
|
|
485
|
+
// execution context. If not, we will create an artificial execution context for the script
|
|
486
|
+
for (const target of targets) {
|
|
487
|
+
const targetId = target.targetId;
|
|
488
|
+
const executionContexts = targetToExecutionContexts.get(targetId) || [];
|
|
489
|
+
const scripts = targetToScripts.get(targetId) || [];
|
|
490
|
+
for (const script of scripts) {
|
|
491
|
+
if (!executionContexts.find(context => context.id === script.executionContextId)) {
|
|
492
|
+
const artificialContext: RehydratingExecutionContext = {
|
|
493
|
+
id: script.executionContextId,
|
|
494
|
+
origin: '',
|
|
495
|
+
v8Context: '',
|
|
496
|
+
name: '',
|
|
497
|
+
auxData: {
|
|
498
|
+
frameId: targetId as string as Protocol.Page.FrameId,
|
|
499
|
+
isDefault: false,
|
|
500
|
+
type: 'type',
|
|
501
|
+
},
|
|
502
|
+
isolate: script.isolate,
|
|
503
|
+
uniqueId: `${targetId}-${script.isolate}`,
|
|
504
|
+
};
|
|
505
|
+
executionContexts.push(artificialContext);
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
// Finally, we put all the information into the data structure we want to return as.
|
|
510
|
+
data.push({target, executionContexts, scripts});
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
return data;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// Copyright 2021 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 ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
|
|
6
|
+
|
|
7
|
+
import {CategorizedBreakpoint, Category} from './CategorizedBreakpoint.js';
|
|
8
|
+
import type {EventListenerPausedDetailsAuxData} from './DebuggerModel.js';
|
|
9
|
+
import {SDKModel} from './SDKModel.js';
|
|
10
|
+
import {Capability, type Target} from './Target.js';
|
|
11
|
+
import {type SDKModelObserver, TargetManager} from './TargetManager.js';
|
|
12
|
+
|
|
13
|
+
export const enum InstrumentationNames {
|
|
14
|
+
BEFORE_BIDDER_WORKLET_BIDDING_START = 'beforeBidderWorkletBiddingStart',
|
|
15
|
+
BEFORE_BIDDER_WORKLET_REPORTING_START = 'beforeBidderWorkletReportingStart',
|
|
16
|
+
BEFORE_SELLER_WORKLET_SCORING_START = 'beforeSellerWorkletScoringStart',
|
|
17
|
+
BEFORE_SELLER_WORKLET_REPORTING_START = 'beforeSellerWorkletReportingStart',
|
|
18
|
+
SET_TIMEOUT = 'setTimeout',
|
|
19
|
+
CLEAR_TIMEOUT = 'clearTimeout',
|
|
20
|
+
SET_TIMEOUT_CALLBACK = 'setTimeout.callback',
|
|
21
|
+
SET_INTERVAL = 'setInterval',
|
|
22
|
+
CLEAR_INTERVAL = 'clearInterval',
|
|
23
|
+
SET_INTERVAL_CALLBACK = 'setInterval.callback',
|
|
24
|
+
SCRIPT_FIRST_STATEMENT = 'scriptFirstStatement',
|
|
25
|
+
SCRIPT_BLOCKED_BY_CSP = 'scriptBlockedByCSP',
|
|
26
|
+
SHARED_STORAGE_WORKLET_SCRIPT_FIRST_STATEMENT = 'sharedStorageWorkletScriptFirstStatement',
|
|
27
|
+
REQUEST_ANIMATION_FRAME = 'requestAnimationFrame',
|
|
28
|
+
CANCEL_ANIMATION_FRAME = 'cancelAnimationFrame',
|
|
29
|
+
REQUEST_ANIMATION_FRAME_CALLBACK = 'requestAnimationFrame.callback',
|
|
30
|
+
WEBGL_ERROR_FIRED = 'webglErrorFired',
|
|
31
|
+
WEBGL_WARNING_FIRED = 'webglWarningFired',
|
|
32
|
+
ELEMENT_SET_INNER_HTML = 'Element.setInnerHTML',
|
|
33
|
+
CANVAS_CONTEXT_CREATED = 'canvasContextCreated',
|
|
34
|
+
GEOLOCATION_GET_CURRENT_POSITION = 'Geolocation.getCurrentPosition',
|
|
35
|
+
GEOLOCATION_WATCH_POSITION = 'Geolocation.watchPosition',
|
|
36
|
+
NOTIFICATION_REQUEST_PERMISSION = 'Notification.requestPermission',
|
|
37
|
+
DOM_WINDOW_CLOSE = 'DOMWindow.close',
|
|
38
|
+
DOCUMENT_WRITE = 'Document.write',
|
|
39
|
+
AUDIO_CONTEXT_CREATED = 'audioContextCreated',
|
|
40
|
+
AUDIO_CONTEXT_CLOSED = 'audioContextClosed',
|
|
41
|
+
AUDIO_CONTEXT_RESUMED = 'audioContextResumed',
|
|
42
|
+
AUDIO_CONTEXT_SUSPENDED = 'audioContextSuspended',
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export class EventBreakpointsModel extends SDKModel<void> {
|
|
46
|
+
readonly agent: ProtocolProxyApi.EventBreakpointsApi;
|
|
47
|
+
|
|
48
|
+
constructor(target: Target) {
|
|
49
|
+
super(target);
|
|
50
|
+
this.agent = target.eventBreakpointsAgent();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* This implementation (as opposed to similar class in DOMDebuggerModel) is for
|
|
56
|
+
* instrumentation breakpoints in targets that run JS but do not have a DOM.
|
|
57
|
+
**/
|
|
58
|
+
class EventListenerBreakpoint extends CategorizedBreakpoint {
|
|
59
|
+
override setEnabled(enabled: boolean): void {
|
|
60
|
+
if (this.enabled() === enabled) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
super.setEnabled(enabled);
|
|
64
|
+
for (const model of TargetManager.instance().models(EventBreakpointsModel)) {
|
|
65
|
+
this.updateOnModel(model);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
updateOnModel(model: EventBreakpointsModel): void {
|
|
70
|
+
if (this.enabled()) {
|
|
71
|
+
void model.agent.invoke_setInstrumentationBreakpoint({eventName: this.name});
|
|
72
|
+
} else {
|
|
73
|
+
void model.agent.invoke_removeInstrumentationBreakpoint({eventName: this.name});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
static readonly instrumentationPrefix = 'instrumentation:';
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
let eventBreakpointManagerInstance: EventBreakpointsManager;
|
|
81
|
+
|
|
82
|
+
export class EventBreakpointsManager implements SDKModelObserver<EventBreakpointsModel> {
|
|
83
|
+
readonly #eventListenerBreakpoints: EventListenerBreakpoint[] = [];
|
|
84
|
+
|
|
85
|
+
constructor() {
|
|
86
|
+
this.createInstrumentationBreakpoints(Category.AUCTION_WORKLET, [
|
|
87
|
+
InstrumentationNames.BEFORE_BIDDER_WORKLET_BIDDING_START,
|
|
88
|
+
InstrumentationNames.BEFORE_BIDDER_WORKLET_REPORTING_START,
|
|
89
|
+
InstrumentationNames.BEFORE_SELLER_WORKLET_SCORING_START,
|
|
90
|
+
InstrumentationNames.BEFORE_SELLER_WORKLET_REPORTING_START,
|
|
91
|
+
]);
|
|
92
|
+
this.createInstrumentationBreakpoints(Category.ANIMATION, [
|
|
93
|
+
InstrumentationNames.REQUEST_ANIMATION_FRAME,
|
|
94
|
+
InstrumentationNames.CANCEL_ANIMATION_FRAME,
|
|
95
|
+
InstrumentationNames.REQUEST_ANIMATION_FRAME_CALLBACK,
|
|
96
|
+
]);
|
|
97
|
+
this.createInstrumentationBreakpoints(Category.CANVAS, [
|
|
98
|
+
InstrumentationNames.CANVAS_CONTEXT_CREATED,
|
|
99
|
+
InstrumentationNames.WEBGL_ERROR_FIRED,
|
|
100
|
+
InstrumentationNames.WEBGL_WARNING_FIRED,
|
|
101
|
+
]);
|
|
102
|
+
this.createInstrumentationBreakpoints(Category.GEOLOCATION, [
|
|
103
|
+
InstrumentationNames.GEOLOCATION_GET_CURRENT_POSITION,
|
|
104
|
+
InstrumentationNames.GEOLOCATION_WATCH_POSITION,
|
|
105
|
+
]);
|
|
106
|
+
this.createInstrumentationBreakpoints(Category.NOTIFICATION, [
|
|
107
|
+
InstrumentationNames.NOTIFICATION_REQUEST_PERMISSION,
|
|
108
|
+
]);
|
|
109
|
+
this.createInstrumentationBreakpoints(Category.PARSE, [
|
|
110
|
+
InstrumentationNames.ELEMENT_SET_INNER_HTML,
|
|
111
|
+
InstrumentationNames.DOCUMENT_WRITE,
|
|
112
|
+
]);
|
|
113
|
+
this.createInstrumentationBreakpoints(Category.SCRIPT, [
|
|
114
|
+
InstrumentationNames.SCRIPT_FIRST_STATEMENT,
|
|
115
|
+
InstrumentationNames.SCRIPT_BLOCKED_BY_CSP,
|
|
116
|
+
]);
|
|
117
|
+
this.createInstrumentationBreakpoints(Category.SHARED_STORAGE_WORKLET, [
|
|
118
|
+
InstrumentationNames.SHARED_STORAGE_WORKLET_SCRIPT_FIRST_STATEMENT,
|
|
119
|
+
]);
|
|
120
|
+
this.createInstrumentationBreakpoints(Category.TIMER, [
|
|
121
|
+
InstrumentationNames.SET_TIMEOUT,
|
|
122
|
+
InstrumentationNames.CLEAR_TIMEOUT,
|
|
123
|
+
InstrumentationNames.SET_TIMEOUT_CALLBACK,
|
|
124
|
+
InstrumentationNames.SET_INTERVAL,
|
|
125
|
+
InstrumentationNames.CLEAR_INTERVAL,
|
|
126
|
+
InstrumentationNames.SET_INTERVAL_CALLBACK,
|
|
127
|
+
]);
|
|
128
|
+
this.createInstrumentationBreakpoints(Category.WINDOW, [
|
|
129
|
+
InstrumentationNames.DOM_WINDOW_CLOSE,
|
|
130
|
+
]);
|
|
131
|
+
this.createInstrumentationBreakpoints(Category.WEB_AUDIO, [
|
|
132
|
+
InstrumentationNames.AUDIO_CONTEXT_CREATED,
|
|
133
|
+
InstrumentationNames.AUDIO_CONTEXT_CLOSED,
|
|
134
|
+
InstrumentationNames.AUDIO_CONTEXT_RESUMED,
|
|
135
|
+
InstrumentationNames.AUDIO_CONTEXT_SUSPENDED,
|
|
136
|
+
]);
|
|
137
|
+
|
|
138
|
+
TargetManager.instance().observeModels(EventBreakpointsModel, this);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
static instance(opts: {
|
|
142
|
+
forceNew: boolean|null,
|
|
143
|
+
} = {forceNew: null}): EventBreakpointsManager {
|
|
144
|
+
const {forceNew} = opts;
|
|
145
|
+
if (!eventBreakpointManagerInstance || forceNew) {
|
|
146
|
+
eventBreakpointManagerInstance = new EventBreakpointsManager();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return eventBreakpointManagerInstance;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
private createInstrumentationBreakpoints(category: Category, instrumentationNames: InstrumentationNames[]): void {
|
|
153
|
+
for (const instrumentationName of instrumentationNames) {
|
|
154
|
+
this.#eventListenerBreakpoints.push(new EventListenerBreakpoint(category, instrumentationName));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
eventListenerBreakpoints(): EventListenerBreakpoint[] {
|
|
159
|
+
return this.#eventListenerBreakpoints.slice();
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
resolveEventListenerBreakpoint({eventName}: EventListenerPausedDetailsAuxData): EventListenerBreakpoint|null {
|
|
163
|
+
if (!eventName.startsWith(EventListenerBreakpoint.instrumentationPrefix)) {
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const instrumentationName = eventName.substring(EventListenerBreakpoint.instrumentationPrefix.length);
|
|
168
|
+
return this.#eventListenerBreakpoints.find(b => b.name === instrumentationName) || null;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
modelAdded(eventBreakpointModel: EventBreakpointsModel): void {
|
|
172
|
+
for (const breakpoint of this.#eventListenerBreakpoints) {
|
|
173
|
+
if (breakpoint.enabled()) {
|
|
174
|
+
breakpoint.updateOnModel(eventBreakpointModel);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
modelRemoved(_eventBreakpointModel: EventBreakpointsModel): void {
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
SDKModel.register(EventBreakpointsModel, {capabilities: Capability.EVENT_BREAKPOINTS, autostart: false});
|