chrome-devtools-frontend 1.0.1512349 → 1.0.1513662
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/docs/cookbook/release_management.md +15 -13
- package/docs/get_the_code.md +114 -35
- package/front_end/core/common/Color.ts +40 -44
- package/front_end/core/common/Console.ts +4 -4
- package/front_end/core/common/ParsedURL.ts +14 -14
- package/front_end/core/common/ResourceType.ts +20 -20
- package/front_end/core/common/SegmentedRange.ts +13 -14
- package/front_end/core/common/Settings.ts +4 -4
- package/front_end/core/common/StringOutputStream.ts +4 -4
- package/front_end/core/host/GdpClient.ts +38 -0
- package/front_end/core/host/InspectorFrontendHost.ts +4 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -0
- package/front_end/core/host/ResourceLoader.ts +2 -2
- package/front_end/core/host/UserMetrics.ts +0 -2
- package/front_end/core/protocol_client/InspectorBackend.ts +9 -9
- package/front_end/core/root/Runtime.ts +5 -2
- package/front_end/core/sdk/AccessibilityModel.ts +48 -48
- package/front_end/core/sdk/AnimationModel.ts +78 -79
- package/front_end/core/sdk/CPUProfilerModel.ts +5 -5
- package/front_end/core/sdk/CPUThrottlingManager.ts +17 -17
- package/front_end/core/sdk/CSSMatchedStyles.ts +44 -44
- package/front_end/core/sdk/CSSMedia.ts +22 -22
- package/front_end/core/sdk/CSSModel.ts +4 -4
- package/front_end/core/sdk/CSSProperty.ts +9 -9
- package/front_end/core/sdk/CSSPropertyParser.ts +1 -2
- package/front_end/core/sdk/CSSRule.ts +3 -3
- package/front_end/core/sdk/CSSStyleDeclaration.ts +27 -28
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +13 -13
- package/front_end/core/sdk/CategorizedBreakpoint.ts +4 -4
- package/front_end/core/sdk/ChildTargetManager.ts +6 -6
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +4 -4
- package/front_end/core/sdk/ConsoleModel.ts +24 -24
- package/front_end/core/sdk/Cookie.ts +16 -16
- package/front_end/core/sdk/CookieParser.ts +6 -6
- package/front_end/core/sdk/DOMDebuggerModel.ts +88 -89
- package/front_end/core/sdk/DOMModel.ts +113 -113
- package/front_end/core/sdk/DebuggerModel.ts +102 -103
- package/front_end/core/sdk/EmulationModel.ts +6 -6
- package/front_end/core/sdk/EventBreakpointsModel.ts +5 -5
- package/front_end/core/sdk/HeapProfilerModel.ts +5 -5
- package/front_end/core/sdk/IsolateManager.ts +26 -26
- package/front_end/core/sdk/LayerTreeBase.ts +29 -30
- package/front_end/core/sdk/OverlayModel.ts +6 -6
- package/front_end/core/sdk/Resource.ts +43 -43
- package/front_end/core/sdk/ResourceTreeModel.ts +58 -61
- package/front_end/core/sdk/RuntimeModel.ts +12 -13
- package/front_end/core/sdk/SDKModel.ts +3 -3
- package/front_end/core/sdk/Script.ts +17 -17
- package/front_end/core/sdk/SecurityOriginManager.ts +14 -14
- package/front_end/core/sdk/ServerTiming.ts +2 -2
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +15 -15
- package/front_end/core/sdk/ServiceWorkerManager.ts +19 -24
- package/front_end/core/sdk/SourceMap.ts +10 -10
- package/front_end/core/sdk/StorageKeyManager.ts +12 -12
- package/front_end/core/sdk/Target.ts +33 -34
- package/front_end/core/sdk/TargetManager.ts +20 -20
- package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +8 -8
- package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +7 -7
- package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +7 -7
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +24 -24
- package/front_end/entrypoints/main/GlobalAiButton.ts +3 -3
- package/front_end/entrypoints/main/MainImpl.ts +16 -14
- package/front_end/entrypoints/main/main-meta.ts +1 -2
- package/front_end/generated/InspectorBackendCommands.js +3 -2
- package/front_end/generated/SupportedCSSProperties.js +20 -0
- package/front_end/generated/protocol-mapping.d.ts +4 -0
- package/front_end/generated/protocol-proxy-api.d.ts +5 -0
- package/front_end/generated/protocol.ts +20 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +15 -16
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +127 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +149 -26
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +6 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +9 -10
- package/front_end/models/badges/AiExplorerBadge.ts +21 -0
- package/front_end/models/badges/Badge.ts +3 -5
- package/front_end/models/badges/CodeWhispererBadge.ts +21 -0
- package/front_end/models/badges/DOMDetectiveBadge.ts +4 -3
- package/front_end/models/badges/SpeedsterBadge.ts +6 -4
- package/front_end/models/badges/StarterBadge.ts +4 -3
- package/front_end/models/badges/UserBadges.ts +29 -3
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +6 -6
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +18 -18
- package/front_end/models/bindings/FileUtils.ts +15 -15
- package/front_end/models/bindings/ResourceScriptMapping.ts +14 -14
- package/front_end/models/elements/ElementUpdateRecord.ts +11 -11
- package/front_end/models/emulation/DeviceModeModel.ts +123 -131
- package/front_end/models/emulation/EmulatedDevices.ts +22 -22
- package/front_end/models/extensions/ExtensionPanel.ts +24 -24
- package/front_end/models/extensions/ExtensionServer.ts +4 -4
- package/front_end/models/javascript_metadata/NativeFunctions.js +14 -2
- package/front_end/models/persistence/IsolatedFileSystem.ts +18 -19
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +13 -13
- package/front_end/models/trace/EventsSerializer.ts +5 -5
- package/front_end/models/trace/LanternComputationData.ts +10 -10
- package/front_end/models/trace/ModelImpl.ts +32 -41
- package/front_end/models/trace/Processor.ts +28 -30
- package/front_end/models/trace/extras/FilmStrip.ts +6 -6
- package/front_end/models/trace/extras/StackTraceForEvent.ts +22 -25
- package/front_end/models/trace/extras/ThirdParties.ts +16 -17
- package/front_end/models/trace/extras/TraceFilter.ts +1 -1
- package/front_end/models/trace/handlers/Threads.ts +10 -10
- package/front_end/models/trace/handlers/helpers.ts +9 -9
- package/front_end/models/trace/handlers/types.ts +3 -3
- package/front_end/models/trace/insights/CLSCulprits.ts +12 -14
- package/front_end/models/trace/insights/Cache.ts +8 -4
- package/front_end/models/trace/insights/DOMSize.ts +8 -5
- package/front_end/models/trace/insights/DocumentLatency.ts +2 -2
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +3 -3
- package/front_end/models/trace/insights/FontDisplay.ts +3 -4
- package/front_end/models/trace/insights/ForcedReflow.ts +3 -3
- package/front_end/models/trace/insights/INPBreakdown.ts +2 -2
- package/front_end/models/trace/insights/ImageDelivery.ts +11 -11
- package/front_end/models/trace/insights/LCPBreakdown.ts +4 -4
- package/front_end/models/trace/insights/LCPDiscovery.ts +4 -4
- package/front_end/models/trace/insights/LegacyJavaScript.ts +2 -2
- package/front_end/models/trace/insights/ModernHTTP.ts +4 -5
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +12 -12
- package/front_end/models/trace/insights/RenderBlocking.ts +9 -10
- package/front_end/models/trace/insights/SlowCSSSelector.ts +2 -2
- package/front_end/models/trace/insights/ThirdParties.ts +4 -5
- package/front_end/models/trace/insights/Viewport.ts +8 -5
- package/front_end/models/trace/insights/types.ts +1 -0
- package/front_end/models/trace/lantern/testing/MetricTestUtils.ts +10 -10
- package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +52 -52
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +8 -8
- package/front_end/panels/animation/AnimationTimeline.ts +5 -5
- package/front_end/panels/animation/AnimationUI.ts +22 -23
- package/front_end/panels/application/ApplicationPanelSidebar.ts +12 -12
- package/front_end/panels/application/DOMStorageModel.ts +23 -23
- package/front_end/panels/application/ExtensionStorageModel.ts +31 -31
- package/front_end/panels/application/IndexedDBModel.ts +1 -0
- package/front_end/panels/application/PreloadingTreeElement.ts +8 -8
- package/front_end/panels/application/ServiceWorkersView.ts +0 -53
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +2 -2
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +2 -2
- package/front_end/panels/common/BadgeNotification.ts +24 -4
- package/front_end/panels/common/GdpSignUpDialog.ts +5 -0
- package/front_end/panels/common/badgeNotification.css +26 -9
- package/front_end/panels/console/ConsoleContextSelector.ts +9 -9
- package/front_end/panels/console/ConsolePrompt.ts +8 -5
- package/front_end/panels/console/ConsoleView.ts +13 -13
- package/front_end/panels/console/ConsoleViewport.ts +29 -29
- package/front_end/panels/coverage/CoverageModel.ts +22 -22
- package/front_end/panels/elements/ClassesPaneWidget.ts +1 -1
- package/front_end/panels/elements/ComputedStyleModel.ts +17 -18
- package/front_end/panels/elements/DOMPath.ts +2 -2
- package/front_end/panels/elements/ElementsPanel.ts +13 -13
- package/front_end/panels/elements/ElementsTreeElement.ts +18 -18
- package/front_end/panels/elements/ElementsTreeOutline.ts +41 -48
- package/front_end/panels/elements/ShortcutTreeElement.ts +4 -4
- package/front_end/panels/elements/StylePropertiesSection.ts +4 -4
- package/front_end/panels/elements/StylePropertyTreeElement.ts +49 -50
- package/front_end/panels/elements/StylesSidebarPane.ts +19 -19
- package/front_end/panels/emulation/DeviceModeToolbar.ts +7 -7
- package/front_end/panels/emulation/DeviceModeView.ts +6 -6
- package/front_end/panels/emulation/MediaQueryInspector.ts +18 -18
- package/front_end/panels/event_listeners/EventListenersView.ts +13 -14
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +3 -3
- package/front_end/panels/layer_viewer/LayerViewHost.ts +13 -13
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +9 -10
- package/front_end/panels/layer_viewer/TransformController.ts +34 -36
- package/front_end/panels/layers/LayerTreeModel.ts +41 -40
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +13 -13
- package/front_end/panels/lighthouse/LighthouseStartView.ts +7 -7
- package/front_end/panels/media/PlayerMessagesView.ts +5 -5
- package/front_end/panels/media/TickingFlameChart.ts +24 -24
- package/front_end/panels/media/TickingFlameChartHelpers.ts +32 -32
- package/front_end/panels/network/NetworkItemView.ts +4 -4
- package/front_end/panels/network/NetworkLogViewColumns.ts +29 -29
- package/front_end/panels/network/NetworkPanel.ts +8 -5
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +10 -10
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +3 -3
- package/front_end/panels/profiler/HeapProfileView.ts +1 -1
- package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +3 -4
- package/front_end/panels/profiler/ProfileHeader.ts +25 -25
- package/front_end/panels/profiler/ProfileLauncherView.ts +5 -6
- package/front_end/panels/recorder/components/ReplaySection.ts +3 -1
- package/front_end/panels/security/OriginTreeElement.ts +8 -8
- package/front_end/panels/security/SecurityPanel.ts +5 -5
- package/front_end/panels/settings/SettingsScreen.ts +18 -12
- package/front_end/panels/settings/components/SyncSection.ts +20 -6
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +3 -0
- package/front_end/panels/sources/DebuggerPausedMessage.ts +8 -9
- package/front_end/panels/sources/NavigatorView.ts +43 -46
- package/front_end/panels/sources/SourcesPanel.ts +35 -35
- package/front_end/panels/sources/SourcesView.ts +13 -13
- package/front_end/panels/sources/TabbedEditorContainer.ts +19 -22
- package/front_end/panels/sources/UISourceCodeFrame.ts +4 -4
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +34 -36
- package/front_end/panels/timeline/AnimationsTrackAppender.ts +3 -3
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +8 -8
- package/front_end/panels/timeline/CountersGraph.ts +16 -16
- package/front_end/panels/timeline/EntriesFilter.ts +4 -3
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +3 -3
- package/front_end/panels/timeline/GPUTrackAppender.ts +3 -3
- package/front_end/panels/timeline/Initiators.ts +10 -10
- package/front_end/panels/timeline/InteractionsTrackAppender.ts +5 -5
- package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +7 -7
- package/front_end/panels/timeline/ModificationsManager.ts +8 -15
- package/front_end/panels/timeline/TargetForEvent.ts +2 -2
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -1
- package/front_end/panels/timeline/ThreadAppender.ts +13 -13
- package/front_end/panels/timeline/TimelineDetailsView.ts +6 -14
- package/front_end/panels/timeline/TimelineEventOverview.ts +27 -26
- package/front_end/panels/timeline/TimelineFilters.ts +5 -5
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +54 -53
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +34 -34
- package/front_end/panels/timeline/TimelineFlameChartView.ts +18 -31
- package/front_end/panels/timeline/TimelineHistoryManager.ts +17 -18
- package/front_end/panels/timeline/TimelineMiniMap.ts +6 -6
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +6 -6
- package/front_end/panels/timeline/TimelinePanel.ts +52 -59
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +7 -5
- package/front_end/panels/timeline/TimelineTreeView.ts +10 -10
- package/front_end/panels/timeline/TimelineUIUtils.ts +43 -43
- package/front_end/panels/timeline/TimingsTrackAppender.ts +12 -12
- package/front_end/panels/timeline/TracingLayerTree.ts +43 -43
- package/front_end/panels/timeline/TrackConfigBanner.ts +6 -6
- package/front_end/panels/timeline/TrackConfiguration.ts +1 -1
- package/front_end/panels/timeline/components/DetailsView.ts +4 -4
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +12 -21
- package/front_end/panels/timeline/components/LiveMetricsView.ts +2 -1
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +5 -5
- package/front_end/panels/timeline/components/Sidebar.ts +4 -14
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +13 -36
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +21 -19
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +1 -1
- package/front_end/panels/timeline/components/insights/Cache.ts +4 -0
- package/front_end/panels/timeline/components/insights/DOMSize.ts +5 -1
- package/front_end/panels/timeline/components/insights/Helpers.ts +19 -0
- package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +1 -1
- package/front_end/panels/timeline/components/insights/Viewport.ts +4 -0
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +1 -1
- package/front_end/panels/timeline/utils/AICallTree.ts +11 -11
- package/front_end/panels/timeline/utils/AIContext.ts +17 -19
- package/front_end/panels/timeline/utils/EntityMapper.ts +6 -5
- package/front_end/panels/timeline/utils/EntryName.ts +2 -2
- package/front_end/panels/timeline/utils/EntryNodes.ts +5 -5
- package/front_end/panels/timeline/utils/EntryStyles.ts +4 -4
- package/front_end/panels/timeline/utils/FreshRecording.ts +3 -3
- package/front_end/panels/timeline/utils/Helpers.ts +0 -18
- package/front_end/panels/timeline/utils/InsightAIContext.ts +6 -6
- package/front_end/panels/timeline/utils/SourceMapsResolver.ts +7 -7
- package/front_end/panels/webauthn/WebauthnPane.ts +1 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror.next/chunk/angular.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/angular.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/legacy.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/legacy.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/vue.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/vue.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js.map +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +1 -1
- package/front_end/third_party/codemirror.next/rebuild.sh +1 -1
- package/front_end/third_party/json5/rebuild.sh +1 -1
- package/front_end/third_party/legacy-javascript/{update.sh → rebuild.sh} +1 -1
- package/front_end/third_party/lit/lib/decorators.d.ts +26 -9
- package/front_end/third_party/lit/lib/decorators.js +5 -5
- package/front_end/third_party/lit/lib/decorators.js.map +1 -1
- package/front_end/third_party/lit/lib/directive.js.map +1 -1
- package/front_end/third_party/lit/lib/directives.js +8 -13
- package/front_end/third_party/lit/lib/directives.js.map +1 -1
- package/front_end/third_party/lit/lib/lit.d.ts +26 -9
- package/front_end/third_party/lit/lib/lit.js +5 -5
- package/front_end/third_party/lit/lib/lit.js.map +1 -1
- package/front_end/third_party/lit/lib/static-html.js +2 -2
- package/front_end/third_party/lit/lib/static-html.js.map +1 -1
- package/front_end/third_party/lit/rebuild.sh +1 -1
- package/front_end/third_party/third-party-web/rebuild.sh +1 -1
- package/front_end/ui/components/dialogs/Dialog.ts +6 -7
- package/front_end/ui/legacy/ActionRegistration.ts +9 -9
- package/front_end/ui/legacy/DockController.ts +18 -18
- package/front_end/ui/legacy/FilterBar.ts +7 -7
- package/front_end/ui/legacy/Fragment.ts +4 -4
- package/front_end/ui/legacy/GlassPane.ts +12 -12
- package/front_end/ui/legacy/InspectorView.ts +5 -15
- package/front_end/ui/legacy/ListControl.ts +27 -27
- package/front_end/ui/legacy/ListWidget.ts +4 -4
- package/front_end/ui/legacy/PopoverHelper.ts +4 -4
- package/front_end/ui/legacy/ShortcutRegistry.ts +17 -17
- package/front_end/ui/legacy/TabbedPane.ts +74 -75
- package/front_end/ui/legacy/TextPrompt.ts +31 -31
- package/front_end/ui/legacy/Toolbar.ts +13 -14
- package/front_end/ui/legacy/ViewManager.ts +30 -31
- package/front_end/ui/legacy/Widget.ts +6 -6
- package/front_end/ui/legacy/XLink.ts +9 -9
- package/front_end/ui/legacy/ZoomManager.ts +9 -9
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +27 -27
- package/front_end/ui/legacy/components/color_picker/ContrastInfo.ts +30 -32
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +15 -15
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +64 -64
- package/front_end/ui/legacy/components/data_grid/ShowMoreDataGridNode.ts +2 -2
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +10 -11
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +12 -12
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +3 -3
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +14 -14
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +8 -8
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +5 -5
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +4 -4
- package/front_end/ui/legacy/theme_support/ThemeSupport.ts +4 -4
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -2
- package/package.json +1 -1
@@ -7,7 +7,7 @@ import type * as Types from '../types/types.js';
|
|
7
7
|
|
8
8
|
import type {AuctionWorkletsData} from './AuctionWorkletsHandler.js';
|
9
9
|
import type * as Renderer from './RendererHandler.js';
|
10
|
-
import type {
|
10
|
+
import type {HandlerData} from './types.js';
|
11
11
|
|
12
12
|
export interface ThreadData {
|
13
13
|
pid: Types.Events.ProcessID;
|
@@ -82,7 +82,7 @@ export function threadsInRenderer(
|
|
82
82
|
return foundThreads;
|
83
83
|
}
|
84
84
|
|
85
|
-
const
|
85
|
+
const threadsInHandlerDataCache = new WeakMap<HandlerData, readonly ThreadData[]>();
|
86
86
|
|
87
87
|
/**
|
88
88
|
* Given trace parsed data, this helper will return a high level array of
|
@@ -92,24 +92,24 @@ const threadsInTraceCache = new WeakMap<ParsedTrace, readonly ThreadData[]>();
|
|
92
92
|
* for both trace types.
|
93
93
|
* The resulting data is cached per-trace, so you can safely call this multiple times.
|
94
94
|
*/
|
95
|
-
export function threadsInTrace(
|
96
|
-
const cached =
|
95
|
+
export function threadsInTrace(handlerData: HandlerData): readonly ThreadData[] {
|
96
|
+
const cached = threadsInHandlerDataCache.get(handlerData);
|
97
97
|
if (cached) {
|
98
98
|
return cached;
|
99
99
|
}
|
100
100
|
|
101
101
|
// If we have Renderer threads, we prefer to use those.
|
102
|
-
const threadsFromRenderer = threadsInRenderer(
|
102
|
+
const threadsFromRenderer = threadsInRenderer(handlerData.Renderer, handlerData.AuctionWorklets);
|
103
103
|
if (threadsFromRenderer.length) {
|
104
|
-
|
104
|
+
threadsInHandlerDataCache.set(handlerData, threadsFromRenderer);
|
105
105
|
return threadsFromRenderer;
|
106
106
|
}
|
107
107
|
|
108
108
|
// If it's a CPU Profile trace, there will be no Renderer threads.
|
109
109
|
// We can fallback to using the data from the SamplesHandler.
|
110
110
|
const foundThreads: ThreadData[] = [];
|
111
|
-
if (
|
112
|
-
for (const [pid, process] of
|
111
|
+
if (handlerData.Samples.profilesInProcess.size) {
|
112
|
+
for (const [pid, process] of handlerData.Samples.profilesInProcess) {
|
113
113
|
for (const [tid, thread] of process) {
|
114
114
|
if (!thread.profileTree) {
|
115
115
|
// Drop threads where we could not create the tree; this indicates
|
@@ -128,12 +128,12 @@ export function threadsInTrace(parsedTrace: ParsedTrace): readonly ThreadData[]
|
|
128
128
|
processIsOnMainFrame: false,
|
129
129
|
tree: thread.profileTree,
|
130
130
|
type: ThreadType.CPU_PROFILE,
|
131
|
-
entryToNode:
|
131
|
+
entryToNode: handlerData.Samples.entryToNode,
|
132
132
|
});
|
133
133
|
}
|
134
134
|
}
|
135
135
|
}
|
136
136
|
|
137
|
-
|
137
|
+
threadsInHandlerDataCache.set(handlerData, foundThreads);
|
138
138
|
return foundThreads;
|
139
139
|
}
|
@@ -7,7 +7,7 @@ import * as ThirdPartyWeb from '../../../third_party/third-party-web/third-party
|
|
7
7
|
import * as Types from '../types/types.js';
|
8
8
|
|
9
9
|
import type {TraceEventsForNetworkRequest} from './NetworkRequestsHandler.js';
|
10
|
-
import type {
|
10
|
+
import type {HandlerData} from './types.js';
|
11
11
|
|
12
12
|
export type Entity = typeof ThirdPartyWeb.ThirdPartyWeb.entities[number]&{
|
13
13
|
isUnrecognized?: boolean,
|
@@ -41,7 +41,7 @@ export function getEntityForUrl(url: string, entityMappings: EntityMappings): En
|
|
41
41
|
}
|
42
42
|
|
43
43
|
export function getNonResolvedURL(
|
44
|
-
entry: Types.Events.Event,
|
44
|
+
entry: Types.Events.Event, handlerData?: HandlerData): Platform.DevToolsPath.UrlString|null {
|
45
45
|
if (Types.Events.isProfileCall(entry)) {
|
46
46
|
return entry.callFrame.url as Platform.DevToolsPath.UrlString;
|
47
47
|
}
|
@@ -63,17 +63,17 @@ export function getNonResolvedURL(
|
|
63
63
|
return entry.args.beginData.url as Platform.DevToolsPath.UrlString;
|
64
64
|
}
|
65
65
|
|
66
|
-
if (
|
66
|
+
if (handlerData) {
|
67
67
|
// DecodeImage events use the URL from the relevant PaintImage event.
|
68
68
|
if (Types.Events.isDecodeImage(entry)) {
|
69
|
-
const paintEvent =
|
70
|
-
return paintEvent ? getNonResolvedURL(paintEvent,
|
69
|
+
const paintEvent = handlerData.ImagePainting.paintImageForEvent.get(entry);
|
70
|
+
return paintEvent ? getNonResolvedURL(paintEvent, handlerData) : null;
|
71
71
|
}
|
72
72
|
|
73
73
|
// DrawLazyPixelRef events use the URL from the relevant PaintImage event.
|
74
74
|
if (Types.Events.isDrawLazyPixelRef(entry) && entry.args?.LazyPixelRef) {
|
75
|
-
const paintEvent =
|
76
|
-
return paintEvent ? getNonResolvedURL(paintEvent,
|
75
|
+
const paintEvent = handlerData.ImagePainting.paintImageByDrawLazyPixelRef.get(entry.args.LazyPixelRef);
|
76
|
+
return paintEvent ? getNonResolvedURL(paintEvent, handlerData) : null;
|
77
77
|
}
|
78
78
|
}
|
79
79
|
|
@@ -85,8 +85,8 @@ export function getNonResolvedURL(
|
|
85
85
|
// Many events don't have a url, but are associated with a request. Use the
|
86
86
|
// request's url.
|
87
87
|
const requestId = (entry.args?.data as {requestId?: string})?.requestId;
|
88
|
-
if (
|
89
|
-
const url =
|
88
|
+
if (handlerData && requestId) {
|
89
|
+
const url = handlerData.NetworkRequests.byId.get(requestId)?.args.data.url;
|
90
90
|
if (url) {
|
91
91
|
return url as Platform.DevToolsPath.UrlString;
|
92
92
|
}
|
@@ -58,14 +58,14 @@ export type HandlersWithMeta<T extends Record<string, Handler>> = {
|
|
58
58
|
[K in keyof T]: T[K];
|
59
59
|
};
|
60
60
|
|
61
|
-
// Represents the final
|
61
|
+
// Represents the final data from all of the handlers. If you instantiate a
|
62
62
|
// TraceProcessor with a subset of handlers, you should instead use
|
63
63
|
// `EnabledHandlerDataWithMeta<>`.
|
64
|
-
export type
|
64
|
+
export type HandlerData = Readonly<EnabledHandlerDataWithMeta<typeof ModelHandlers>>;
|
65
65
|
|
66
66
|
type DeepWriteable<T> = {
|
67
67
|
-readonly[P in keyof T]: DeepWriteable<T[P]>
|
68
68
|
};
|
69
|
-
export type
|
69
|
+
export type HandlerDataMutable = DeepWriteable<HandlerData>;
|
70
70
|
|
71
71
|
export type Handlers = typeof ModelHandlers;
|
@@ -387,8 +387,7 @@ function getNextEvent(sourceEvents: Types.Events.Event[], targetEvent: Types.Eve
|
|
387
387
|
* and within this prePaint event a layout shift(s) occurs.
|
388
388
|
*/
|
389
389
|
function getIframeRootCauses(
|
390
|
-
|
391
|
-
iframeCreatedEvents: readonly Types.Events.RenderFrameImplCreateChildFrame[],
|
390
|
+
data: Handlers.Types.HandlerData, iframeCreatedEvents: readonly Types.Events.RenderFrameImplCreateChildFrame[],
|
392
391
|
prePaintEvents: Types.Events.PrePaint[],
|
393
392
|
shiftsByPrePaint: Map<Types.Events.PrePaint, Types.Events.SyntheticLayoutShift[]>,
|
394
393
|
rootCausesByShift: Map<Types.Events.SyntheticLayoutShift, LayoutShiftRootCausesData>,
|
@@ -421,7 +420,7 @@ function getIframeRootCauses(
|
|
421
420
|
const frame = domEvent.args.frame;
|
422
421
|
|
423
422
|
let url;
|
424
|
-
const processes =
|
423
|
+
const processes = data.Meta.rendererProcessesByFrame.get(frame);
|
425
424
|
if (processes && processes.size > 0) {
|
426
425
|
url = [...processes.values()][0]?.[0].frame.url;
|
427
426
|
}
|
@@ -590,23 +589,22 @@ function finalize(partialModel: PartialInsightModel<CLSCulpritsInsightModel>): C
|
|
590
589
|
};
|
591
590
|
}
|
592
591
|
|
593
|
-
export function generateInsight(
|
594
|
-
parsedTrace: Handlers.Types.ParsedTrace, context: InsightSetContext): CLSCulpritsInsightModel {
|
592
|
+
export function generateInsight(data: Handlers.Types.HandlerData, context: InsightSetContext): CLSCulpritsInsightModel {
|
595
593
|
const isWithinContext = (event: Types.Events.Event): boolean => Helpers.Timing.eventIsInBounds(event, context.bounds);
|
596
594
|
|
597
|
-
const compositeAnimationEvents =
|
598
|
-
const iframeEvents =
|
599
|
-
const networkRequests =
|
600
|
-
const domLoadingEvents =
|
601
|
-
const unsizedImageEvents =
|
595
|
+
const compositeAnimationEvents = data.Animations.animations.filter(isWithinContext);
|
596
|
+
const iframeEvents = data.LayoutShifts.renderFrameImplCreateChildFrameEvents.filter(isWithinContext);
|
597
|
+
const networkRequests = data.NetworkRequests.byTime.filter(isWithinContext);
|
598
|
+
const domLoadingEvents = data.LayoutShifts.domLoadingEvents.filter(isWithinContext);
|
599
|
+
const unsizedImageEvents = data.LayoutShifts.layoutImageUnsizedEvents.filter(isWithinContext);
|
602
600
|
|
603
601
|
const clusterKey = context.navigation ? context.navigationId : Types.Events.NO_NAVIGATION;
|
604
|
-
const clusters =
|
602
|
+
const clusters = data.LayoutShifts.clustersByNavigationId.get(clusterKey) ?? [];
|
605
603
|
const clustersByScore = clusters.toSorted((a, b) => b.clusterCumulativeScore - a.clusterCumulativeScore);
|
606
604
|
const worstCluster = clustersByScore.at(0);
|
607
605
|
const layoutShifts = clusters.flatMap(cluster => cluster.events);
|
608
|
-
const prePaintEvents =
|
609
|
-
const paintImageEvents =
|
606
|
+
const prePaintEvents = data.LayoutShifts.prePaintEvents.filter(isWithinContext);
|
607
|
+
const paintImageEvents = data.LayoutShifts.paintImageEvents.filter(isWithinContext);
|
610
608
|
|
611
609
|
// Get root causes.
|
612
610
|
const rootCausesByShift = new Map<Types.Events.SyntheticLayoutShift, LayoutShiftRootCausesData>();
|
@@ -617,7 +615,7 @@ export function generateInsight(
|
|
617
615
|
}
|
618
616
|
|
619
617
|
// Populate root causes for rootCausesByShift.
|
620
|
-
getIframeRootCauses(
|
618
|
+
getIframeRootCauses(data, iframeEvents, prePaintEvents, shiftsByPrePaint, rootCausesByShift, domLoadingEvents);
|
621
619
|
getFontRootCauses(networkRequests, prePaintEvents, shiftsByPrePaint, rootCausesByShift);
|
622
620
|
getUnsizedImageRootCauses(unsizedImageEvents, paintImageEvents, shiftsByPrePaint, rootCausesByShift);
|
623
621
|
const animationFailures =
|
@@ -12,6 +12,7 @@ import {metricSavingsForWastedBytes} from './Common.js';
|
|
12
12
|
import {linearInterpolation} from './Statistics.js';
|
13
13
|
import {
|
14
14
|
InsightCategory,
|
15
|
+
InsightKeys,
|
15
16
|
type InsightModel,
|
16
17
|
type InsightSetContext,
|
17
18
|
type PartialInsightModel,
|
@@ -62,7 +63,7 @@ const IGNORE_THRESHOLD_IN_PERCENT = 0.925;
|
|
62
63
|
|
63
64
|
function finalize(partialModel: PartialInsightModel<CacheInsightModel>): CacheInsightModel {
|
64
65
|
return {
|
65
|
-
insightKey:
|
66
|
+
insightKey: InsightKeys.CACHE,
|
66
67
|
strings: UIStrings,
|
67
68
|
title: i18nString(UIStrings.title),
|
68
69
|
description: i18nString(UIStrings.description),
|
@@ -188,10 +189,13 @@ export interface CacheableRequest {
|
|
188
189
|
wastedBytes: number;
|
189
190
|
}
|
190
191
|
|
191
|
-
export function
|
192
|
-
|
192
|
+
export function isCacheInsight(model: InsightModel): model is CacheInsightModel {
|
193
|
+
return model.insightKey === InsightKeys.CACHE;
|
194
|
+
}
|
195
|
+
|
196
|
+
export function generateInsight(data: Handlers.Types.HandlerData, context: InsightSetContext): CacheInsightModel {
|
193
197
|
const isWithinContext = (event: Types.Events.Event): boolean => Helpers.Timing.eventIsInBounds(event, context.bounds);
|
194
|
-
const contextRequests =
|
198
|
+
const contextRequests = data.NetworkRequests.byTime.filter(isWithinContext);
|
195
199
|
|
196
200
|
const results: CacheableRequest[] = [];
|
197
201
|
let totalWastedBytes = 0;
|
@@ -104,8 +104,11 @@ function finalize(partialModel: PartialInsightModel<DOMSizeInsightModel>): DOMSi
|
|
104
104
|
};
|
105
105
|
}
|
106
106
|
|
107
|
-
export function
|
108
|
-
|
107
|
+
export function isDomSizeInsight(model: InsightModel): model is DOMSizeInsightModel {
|
108
|
+
return model.insightKey === InsightKeys.DOM_SIZE;
|
109
|
+
}
|
110
|
+
|
111
|
+
export function generateInsight(data: Handlers.Types.HandlerData, context: InsightSetContext): DOMSizeInsightModel {
|
109
112
|
const isWithinContext = (event: Types.Events.Event): boolean => Helpers.Timing.eventIsInBounds(event, context.bounds);
|
110
113
|
|
111
114
|
const mainTid = context.navigation?.tid;
|
@@ -113,7 +116,7 @@ export function generateInsight(
|
|
113
116
|
const largeLayoutUpdates: Types.Events.Layout[] = [];
|
114
117
|
const largeStyleRecalcs: Types.Events.UpdateLayoutTree[] = [];
|
115
118
|
|
116
|
-
const threads = Handlers.Threads.threadsInRenderer(
|
119
|
+
const threads = Handlers.Threads.threadsInRenderer(data.Renderer, data.AuctionWorklets);
|
117
120
|
for (const thread of threads) {
|
118
121
|
if (thread.type !== Handlers.Threads.ThreadType.MAIN_THREAD) {
|
119
122
|
continue;
|
@@ -129,7 +132,7 @@ export function generateInsight(
|
|
129
132
|
continue;
|
130
133
|
}
|
131
134
|
|
132
|
-
const rendererThread =
|
135
|
+
const rendererThread = data.Renderer.processes.get(thread.pid)?.threads.get(thread.tid);
|
133
136
|
if (!rendererThread) {
|
134
137
|
continue;
|
135
138
|
}
|
@@ -185,7 +188,7 @@ export function generateInsight(
|
|
185
188
|
}),
|
186
189
|
].sort((a, b) => b.duration - a.duration).slice(0, 5);
|
187
190
|
|
188
|
-
const domStatsEvents =
|
191
|
+
const domStatsEvents = data.DOMStats.domStatsByFrameId.get(context.frameId)?.filter(isWithinContext) ?? [];
|
189
192
|
let maxDOMStats: Types.Events.DOMStats|undefined;
|
190
193
|
for (const domStats of domStatsEvents) {
|
191
194
|
// While recording a cross-origin navigation, there can be overlapping dom stats from before & after
|
@@ -190,12 +190,12 @@ function finalize(partialModel: PartialInsightModel<DocumentLatencyInsightModel>
|
|
190
190
|
}
|
191
191
|
|
192
192
|
export function generateInsight(
|
193
|
-
|
193
|
+
data: Handlers.Types.HandlerData, context: InsightSetContext): DocumentLatencyInsightModel {
|
194
194
|
if (!context.navigation) {
|
195
195
|
return finalize({});
|
196
196
|
}
|
197
197
|
|
198
|
-
const documentRequest =
|
198
|
+
const documentRequest = data.NetworkRequests.byId.get(context.navigationId);
|
199
199
|
if (!documentRequest) {
|
200
200
|
return finalize({warnings: [InsightWarning.NO_DOCUMENT_REQUEST]});
|
201
201
|
}
|
@@ -65,8 +65,8 @@ export function isDuplicatedJavaScript(model: InsightModel): model is Duplicated
|
|
65
65
|
}
|
66
66
|
|
67
67
|
export function generateInsight(
|
68
|
-
|
69
|
-
const scripts =
|
68
|
+
data: Handlers.Types.HandlerData, context: InsightSetContext): DuplicatedJavaScriptInsightModel {
|
69
|
+
const scripts = data.Scripts.scripts.filter(script => {
|
70
70
|
if (script.frame !== context.frameId) {
|
71
71
|
return false;
|
72
72
|
}
|
@@ -108,7 +108,7 @@ export function generateInsight(
|
|
108
108
|
duplicationGroupedByNodeModules,
|
109
109
|
scriptsWithDuplication: [...new Set(scriptsWithDuplication)],
|
110
110
|
scripts,
|
111
|
-
mainDocumentUrl: context.navigation?.args.data?.url ??
|
111
|
+
mainDocumentUrl: context.navigation?.args.data?.url ?? data.Meta.mainFrameURL,
|
112
112
|
metricSavings: metricSavingsForWastedBytes(wastedBytesByRequestId, context),
|
113
113
|
wastedBytes: wastedBytesByRequestId.values().reduce((acc, cur) => acc + cur, 0),
|
114
114
|
});
|
@@ -60,17 +60,16 @@ export function isFontDisplayInsight(model: InsightModel): model is FontDisplayI
|
|
60
60
|
return model.insightKey === InsightKeys.FONT_DISPLAY;
|
61
61
|
}
|
62
62
|
|
63
|
-
export function generateInsight(
|
64
|
-
parsedTrace: Handlers.Types.ParsedTrace, context: InsightSetContext): FontDisplayInsightModel {
|
63
|
+
export function generateInsight(data: Handlers.Types.HandlerData, context: InsightSetContext): FontDisplayInsightModel {
|
65
64
|
const fonts: RemoteFont[] = [];
|
66
|
-
for (const remoteFont of
|
65
|
+
for (const remoteFont of data.LayoutShifts.remoteFonts) {
|
67
66
|
const event = remoteFont.beginRemoteFontLoadEvent;
|
68
67
|
if (!Helpers.Timing.eventIsInBounds(event, context.bounds)) {
|
69
68
|
continue;
|
70
69
|
}
|
71
70
|
|
72
71
|
const requestId = `${event.pid}.${event.args.id}`;
|
73
|
-
const request =
|
72
|
+
const request = data.NetworkRequests.byId.get(requestId);
|
74
73
|
if (!request) {
|
75
74
|
continue;
|
76
75
|
}
|
@@ -78,7 +78,7 @@ function getCallFrameId(callFrame: Types.Events.CallFrame|Protocol.Runtime.CallF
|
|
78
78
|
}
|
79
79
|
|
80
80
|
function getLargestTopLevelFunctionData(
|
81
|
-
forcedReflowEvents: Types.Events.Event[], traceParsedData: Handlers.Types.
|
81
|
+
forcedReflowEvents: Types.Events.Event[], traceParsedData: Handlers.Types.HandlerData): ForcedReflowAggregatedData|
|
82
82
|
undefined {
|
83
83
|
const entryToNodeMap = traceParsedData.Renderer.entryToNode;
|
84
84
|
const dataByTopLevelFunction = new Map<string, ForcedReflowAggregatedData>();
|
@@ -150,7 +150,7 @@ function finalize(partialModel: PartialInsightModel<ForcedReflowInsightModel>):
|
|
150
150
|
};
|
151
151
|
}
|
152
152
|
|
153
|
-
function getBottomCallFrameForEvent(event: Types.Events.Event, traceParsedData: Handlers.Types.
|
153
|
+
function getBottomCallFrameForEvent(event: Types.Events.Event, traceParsedData: Handlers.Types.HandlerData):
|
154
154
|
Types.Events.CallFrame|Protocol.Runtime.CallFrame|null {
|
155
155
|
const profileStackTrace = Extras.StackTraceForEvent.get(event, traceParsedData);
|
156
156
|
const eventStackTrace = Helpers.Trace.getZeroIndexedStackTraceInEventPayload(event);
|
@@ -163,7 +163,7 @@ export function isForcedReflowInsight(model: InsightModel): model is ForcedReflo
|
|
163
163
|
}
|
164
164
|
|
165
165
|
export function generateInsight(
|
166
|
-
traceParsedData: Handlers.Types.
|
166
|
+
traceParsedData: Handlers.Types.HandlerData, context: InsightSetContext): ForcedReflowInsightModel {
|
167
167
|
const isWithinContext = (event: Types.Events.Event): boolean => {
|
168
168
|
const frameId = Helpers.Trace.frameIDForEvent(event);
|
169
169
|
if (frameId !== context.frameId) {
|
@@ -79,8 +79,8 @@ function finalize(partialModel: PartialInsightModel<INPBreakdownInsightModel>):
|
|
79
79
|
}
|
80
80
|
|
81
81
|
export function generateInsight(
|
82
|
-
|
83
|
-
const interactionEvents =
|
82
|
+
data: Handlers.Types.HandlerData, context: InsightSetContext): INPBreakdownInsightModel {
|
83
|
+
const interactionEvents = data.UserInteractions.interactionEventsWithNoNesting.filter(event => {
|
84
84
|
return Helpers.Timing.eventIsInBounds(event, context.bounds);
|
85
85
|
});
|
86
86
|
|
@@ -183,19 +183,19 @@ function estimateGIFPercentSavings(request: Types.Events.SyntheticNetworkRequest
|
|
183
183
|
}
|
184
184
|
|
185
185
|
function getDisplayedSize(
|
186
|
-
|
186
|
+
data: Handlers.Types.HandlerData, paintImage: Types.Events.PaintImage): {width: number, height: number} {
|
187
187
|
// Note: for traces made prior to metadata.hostDPR (which means no data in
|
188
188
|
// paintEventToCorrectedDisplaySize), the displayed size unexpectedly ignores any
|
189
189
|
// emulated DPR and so the results may be very misleading.
|
190
|
-
return
|
190
|
+
return data.ImagePainting.paintEventToCorrectedDisplaySize.get(paintImage) ?? {
|
191
191
|
width: paintImage.args.data.width,
|
192
192
|
height: paintImage.args.data.height,
|
193
193
|
};
|
194
194
|
}
|
195
195
|
|
196
|
-
function getPixelCounts(
|
196
|
+
function getPixelCounts(data: Handlers.Types.HandlerData, paintImage: Types.Events.PaintImage):
|
197
197
|
{displayedPixels: number, filePixels: number} {
|
198
|
-
const {width, height} = getDisplayedSize(
|
198
|
+
const {width, height} = getDisplayedSize(data, paintImage);
|
199
199
|
return {
|
200
200
|
filePixels: paintImage.args.data.srcWidth * paintImage.args.data.srcHeight,
|
201
201
|
displayedPixels: width * height,
|
@@ -203,10 +203,10 @@ function getPixelCounts(parsedTrace: Handlers.Types.ParsedTrace, paintImage: Typ
|
|
203
203
|
}
|
204
204
|
|
205
205
|
export function generateInsight(
|
206
|
-
|
206
|
+
data: Handlers.Types.HandlerData, context: InsightSetContext): ImageDeliveryInsightModel {
|
207
207
|
const isWithinContext = (event: Types.Events.Event): boolean => Helpers.Timing.eventIsInBounds(event, context.bounds);
|
208
208
|
|
209
|
-
const contextRequests =
|
209
|
+
const contextRequests = data.NetworkRequests.byTime.filter(isWithinContext);
|
210
210
|
|
211
211
|
const optimizableImages: OptimizableImage[] = [];
|
212
212
|
for (const request of contextRequests) {
|
@@ -220,7 +220,7 @@ export function generateInsight(
|
|
220
220
|
|
221
221
|
// If the request was redirected, the image paints will have the pre-redirect URL.
|
222
222
|
const url = request.args.data.redirects[0]?.url ?? request.args.data.url;
|
223
|
-
const imagePaints =
|
223
|
+
const imagePaints = data.ImagePainting.paintImageEventForUrl.get(url)?.filter(isWithinContext);
|
224
224
|
|
225
225
|
// This will filter out things like preloaded image requests where an image file is downloaded
|
226
226
|
// but never rendered on the page.
|
@@ -229,15 +229,15 @@ export function generateInsight(
|
|
229
229
|
}
|
230
230
|
|
231
231
|
const largestImagePaint = imagePaints.reduce((prev, curr) => {
|
232
|
-
const prevPixels = getPixelCounts(
|
233
|
-
const currPixels = getPixelCounts(
|
232
|
+
const prevPixels = getPixelCounts(data, prev).displayedPixels;
|
233
|
+
const currPixels = getPixelCounts(data, curr).displayedPixels;
|
234
234
|
return prevPixels > currPixels ? prev : curr;
|
235
235
|
});
|
236
236
|
|
237
237
|
const {
|
238
238
|
filePixels: imageFilePixels,
|
239
239
|
displayedPixels: largestImageDisplayPixels,
|
240
|
-
} = getPixelCounts(
|
240
|
+
} = getPixelCounts(data, largestImagePaint);
|
241
241
|
|
242
242
|
// Decoded body length is almost always the right one to be using because of the below:
|
243
243
|
// `encodedDataLength = decodedBodyLength + headers`.
|
@@ -284,7 +284,7 @@ export function generateInsight(
|
|
284
284
|
// optimization added here.
|
285
285
|
imageByteSavings += Math.round(wastedPixelRatio * (imageBytes - imageByteSavingsFromFormat));
|
286
286
|
|
287
|
-
const {width, height} = getDisplayedSize(
|
287
|
+
const {width, height} = getDisplayedSize(data, largestImagePaint);
|
288
288
|
|
289
289
|
optimizations.push({
|
290
290
|
type: ImageOptimizationType.RESPONSIVE_SIZE,
|
@@ -193,14 +193,14 @@ function finalize(partialModel: PartialInsightModel<LCPBreakdownInsightModel>):
|
|
193
193
|
}
|
194
194
|
|
195
195
|
export function generateInsight(
|
196
|
-
|
196
|
+
data: Handlers.Types.HandlerData, context: InsightSetContext): LCPBreakdownInsightModel {
|
197
197
|
if (!context.navigation) {
|
198
198
|
return finalize({});
|
199
199
|
}
|
200
200
|
|
201
|
-
const networkRequests =
|
201
|
+
const networkRequests = data.NetworkRequests;
|
202
202
|
|
203
|
-
const frameMetrics =
|
203
|
+
const frameMetrics = data.PageLoadMetrics.metricScoresByFrameId.get(context.frameId);
|
204
204
|
if (!frameMetrics) {
|
205
205
|
throw new Error('no frame metrics');
|
206
206
|
}
|
@@ -219,7 +219,7 @@ export function generateInsight(
|
|
219
219
|
const lcpMs = Helpers.Timing.microToMilli(metricScore.timing);
|
220
220
|
// This helps position things on the timeline's UI accurately for a trace.
|
221
221
|
const lcpTs = metricScore.event?.ts ? Helpers.Timing.microToMilli(metricScore.event?.ts) : undefined;
|
222
|
-
const lcpRequest =
|
222
|
+
const lcpRequest = data.LargestImagePaint.lcpRequestByNavigationId.get(context.navigationId);
|
223
223
|
|
224
224
|
const docRequest = networkRequests.byId.get(context.navigationId);
|
225
225
|
if (!docRequest) {
|
@@ -95,14 +95,14 @@ function finalize(partialModel: PartialInsightModel<LCPDiscoveryInsightModel>):
|
|
95
95
|
}
|
96
96
|
|
97
97
|
export function generateInsight(
|
98
|
-
|
98
|
+
data: Handlers.Types.HandlerData, context: InsightSetContext): LCPDiscoveryInsightModel {
|
99
99
|
if (!context.navigation) {
|
100
100
|
return finalize({});
|
101
101
|
}
|
102
102
|
|
103
|
-
const networkRequests =
|
103
|
+
const networkRequests = data.NetworkRequests;
|
104
104
|
|
105
|
-
const frameMetrics =
|
105
|
+
const frameMetrics = data.PageLoadMetrics.metricScoresByFrameId.get(context.frameId);
|
106
106
|
if (!frameMetrics) {
|
107
107
|
throw new Error('no frame metrics');
|
108
108
|
}
|
@@ -122,7 +122,7 @@ export function generateInsight(
|
|
122
122
|
return finalize({warnings: [InsightWarning.NO_DOCUMENT_REQUEST]});
|
123
123
|
}
|
124
124
|
|
125
|
-
const lcpRequest =
|
125
|
+
const lcpRequest = data.LargestImagePaint.lcpRequestByNavigationId.get(context.navigationId);
|
126
126
|
if (!lcpRequest) {
|
127
127
|
return finalize({lcpEvent});
|
128
128
|
}
|
@@ -77,8 +77,8 @@ export function isLegacyJavaScript(model: InsightModel): model is LegacyJavaScri
|
|
77
77
|
}
|
78
78
|
|
79
79
|
export function generateInsight(
|
80
|
-
|
81
|
-
const scripts =
|
80
|
+
data: Handlers.Types.HandlerData, context: InsightSetContext): LegacyJavaScriptInsightModel {
|
81
|
+
const scripts = data.Scripts.scripts.filter(script => {
|
82
82
|
if (script.frame !== context.frameId) {
|
83
83
|
return false;
|
84
84
|
}
|
@@ -227,14 +227,13 @@ function finalize(partialModel: PartialInsightModel<ModernHTTPInsightModel>): Mo
|
|
227
227
|
};
|
228
228
|
}
|
229
229
|
|
230
|
-
export function generateInsight(
|
231
|
-
parsedTrace: Handlers.Types.ParsedTrace, context: InsightSetContext): ModernHTTPInsightModel {
|
230
|
+
export function generateInsight(data: Handlers.Types.HandlerData, context: InsightSetContext): ModernHTTPInsightModel {
|
232
231
|
const isWithinContext = (event: Types.Events.Event): boolean => Helpers.Timing.eventIsInBounds(event, context.bounds);
|
233
232
|
|
234
|
-
const contextRequests =
|
233
|
+
const contextRequests = data.NetworkRequests.byTime.filter(isWithinContext);
|
235
234
|
|
236
|
-
const entityMappings =
|
237
|
-
const firstPartyUrl = context.navigation?.args.data?.documentLoaderURL ??
|
235
|
+
const entityMappings = data.NetworkRequests.entityMappings;
|
236
|
+
const firstPartyUrl = context.navigation?.args.data?.documentLoaderURL ?? data.Meta.mainFrameURL;
|
238
237
|
const firstPartyEntity = Handlers.Helpers.getEntityForUrl(firstPartyUrl, entityMappings);
|
239
238
|
const http1Requests = determineHttp1Requests(contextRequests, entityMappings, firstPartyEntity ?? null);
|
240
239
|
|
@@ -460,11 +460,11 @@ export function handleLinkResponseHeader(linkHeaderValue: string): Array<{url: s
|
|
460
460
|
|
461
461
|
// Export the function for test purpose.
|
462
462
|
export function generatePreconnectedOrigins(
|
463
|
-
|
463
|
+
data: Handlers.Types.HandlerData, context: InsightSetContextWithNavigation,
|
464
464
|
contextRequests: Types.Events.SyntheticNetworkRequest[],
|
465
465
|
preconnectCandidates: PreconnectCandidate[]): PreconnectedOrigin[] {
|
466
466
|
const preconnectedOrigins: PreconnectedOrigin[] = [];
|
467
|
-
for (const event of
|
467
|
+
for (const event of data.NetworkRequests.linkPreconnectEvents) {
|
468
468
|
preconnectedOrigins.push({
|
469
469
|
node_id: event.args.data.node_id,
|
470
470
|
frame: event.args.data.frame,
|
@@ -480,7 +480,7 @@ export function generatePreconnectedOrigins(
|
|
480
480
|
});
|
481
481
|
}
|
482
482
|
|
483
|
-
const documentRequest =
|
483
|
+
const documentRequest = data.NetworkRequests.byId.get(context.navigationId);
|
484
484
|
documentRequest?.args.data.responseHeaders?.forEach(header => {
|
485
485
|
if (header.name.toLowerCase() === 'link') {
|
486
486
|
const preconnectedOriginsFromResponseHeader = handleLinkResponseHeader(header.value); // , documentRequest);
|
@@ -538,7 +538,7 @@ function socketStartTimeIsBelowThreshold(
|
|
538
538
|
}
|
539
539
|
|
540
540
|
function candidateRequestsByOrigin(
|
541
|
-
|
541
|
+
data: Handlers.Types.HandlerData, mainResource: Types.Events.SyntheticNetworkRequest,
|
542
542
|
contextRequests: Types.Events.SyntheticNetworkRequest[],
|
543
543
|
lcpGraphURLs: Set<string>): Map<string, Types.Events.SyntheticNetworkRequest[]> {
|
544
544
|
const origins = new Map<string, Types.Events.SyntheticNetworkRequest[]>();
|
@@ -549,7 +549,7 @@ function candidateRequestsByOrigin(
|
|
549
549
|
}
|
550
550
|
|
551
551
|
// Filter out all resources that are loaded by the document. Connections are already early.
|
552
|
-
if (
|
552
|
+
if (data.NetworkRequests.eventToInitiator.get(request) === mainResource) {
|
553
553
|
return;
|
554
554
|
}
|
555
555
|
|
@@ -586,13 +586,13 @@ function candidateRequestsByOrigin(
|
|
586
586
|
|
587
587
|
// Export the function for test purpose.
|
588
588
|
export function generatePreconnectCandidates(
|
589
|
-
|
589
|
+
data: Handlers.Types.HandlerData, context: InsightSetContextWithNavigation,
|
590
590
|
contextRequests: Types.Events.SyntheticNetworkRequest[]): PreconnectCandidate[] {
|
591
591
|
if (!context.lantern) {
|
592
592
|
return [];
|
593
593
|
}
|
594
594
|
|
595
|
-
const documentRequest =
|
595
|
+
const documentRequest = data.NetworkRequests.byId.get(context.navigationId);
|
596
596
|
if (!documentRequest) {
|
597
597
|
return [];
|
598
598
|
}
|
@@ -613,7 +613,7 @@ export function generatePreconnectCandidates(
|
|
613
613
|
}
|
614
614
|
});
|
615
615
|
|
616
|
-
const groupedOrigins = candidateRequestsByOrigin(
|
616
|
+
const groupedOrigins = candidateRequestsByOrigin(data, documentRequest, contextRequests, lcpGraphURLs);
|
617
617
|
|
618
618
|
let maxWastedLcp = Types.Timing.Milli(0);
|
619
619
|
let maxWastedFcp = Types.Timing.Milli(0);
|
@@ -671,7 +671,7 @@ export function isNetworkDependencyTree(model: InsightModel): model is NetworkDe
|
|
671
671
|
}
|
672
672
|
|
673
673
|
export function generateInsight(
|
674
|
-
|
674
|
+
data: Handlers.Types.HandlerData, context: InsightSetContext): NetworkDependencyTreeInsightModel {
|
675
675
|
if (!context.navigation) {
|
676
676
|
return finalize({
|
677
677
|
rootNodes: [],
|
@@ -690,11 +690,11 @@ export function generateInsight(
|
|
690
690
|
} = generateNetworkDependencyTree(context);
|
691
691
|
|
692
692
|
const isWithinContext = (event: Types.Events.Event): boolean => Helpers.Timing.eventIsInBounds(event, context.bounds);
|
693
|
-
const contextRequests =
|
693
|
+
const contextRequests = data.NetworkRequests.byTime.filter(isWithinContext);
|
694
694
|
|
695
|
-
const preconnectCandidates = generatePreconnectCandidates(
|
695
|
+
const preconnectCandidates = generatePreconnectCandidates(data, context, contextRequests);
|
696
696
|
|
697
|
-
const preconnectedOrigins = generatePreconnectedOrigins(
|
697
|
+
const preconnectedOrigins = generatePreconnectedOrigins(data, context, contextRequests, preconnectCandidates);
|
698
698
|
|
699
699
|
return finalize({
|
700
700
|
rootNodes,
|