chrome-devtools-frontend 1.0.1738725 → 1.0.1739869
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/.stylelintrc.json +3 -1
- package/eslint.config.mjs +127 -0
- package/front_end/application_tokens.css +0 -30
- package/front_end/core/sdk/SourceMap.ts +30 -3
- package/front_end/core/sdk/SourceMapRangeMappings.ts +57 -0
- package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +5 -9
- package/front_end/generated/SupportedCSSProperties.ts +16 -0
- package/front_end/models/trace/extras/TraceFilter.ts +16 -8
- package/front_end/models/trace/extras/TraceTree.ts +104 -67
- package/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +0 -5
- package/front_end/models/trace/handlers/RendererHandler.ts +7 -6
- package/front_end/models/trace/handlers/SamplesHandler.ts +1 -1
- package/front_end/models/trace/helpers/Extensions.ts +1 -3
- package/front_end/models/trace/helpers/SamplesIntegrator.ts +155 -87
- package/front_end/models/trace/helpers/Trace.ts +15 -12
- package/front_end/models/trace/helpers/TreeHelpers.ts +38 -10
- package/front_end/models/trace/insights/SlowCSSSelector.ts +3 -3
- package/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +19 -4
- package/front_end/panels/ai_assistance/components/chatView.css +0 -180
- package/front_end/panels/application/ApplicationPanelTreeElement.ts +66 -3
- package/front_end/panels/application/components/backForwardCacheView.css +1 -1
- package/front_end/panels/application/resourcesPanel.css +0 -48
- package/front_end/panels/console/consoleView.css +1 -1
- package/front_end/panels/elements/StylePropertiesSection.ts +4 -9
- package/front_end/panels/elements/StylePropertyTreeElement.ts +52 -34
- package/front_end/panels/elements/classesPaneWidget.css +3 -7
- package/front_end/panels/elements/components/CSSQuery.ts +6 -5
- package/front_end/panels/elements/metricsSidebarPane.css +2 -2
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +0 -6
- package/front_end/panels/elements/stylesSidebarPane.css +0 -1
- package/front_end/panels/explain/components/consoleInsight.css +1 -6
- package/front_end/panels/issues/AffectedBlockedByResponseView.ts +88 -46
- package/front_end/panels/issues/AffectedHeavyAdView.ts +72 -43
- package/front_end/panels/issues/AffectedResourcesView.ts +81 -13
- package/front_end/panels/issues/GenericIssueDetailsView.ts +112 -32
- package/front_end/panels/issues/issues.ts +2 -0
- package/front_end/panels/issues/issuesTree.css +7 -0
- package/front_end/panels/layer_viewer/layerDetailsView.css +1 -1
- package/front_end/panels/lighthouse/lighthousePanel.css +0 -9
- package/front_end/panels/linear_memory_inspector/components/linearMemoryValueInterpreter.css +2 -2
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +2 -2
- package/front_end/panels/network/NetworkLogView.ts +9 -2
- package/front_end/panels/network/RequestTimingView.ts +16 -2
- package/front_end/panels/network/networkConfigView.css +2 -2
- package/front_end/panels/network/networkLogView.css +2 -15
- package/front_end/panels/network/networkPanel.css +0 -2
- package/front_end/panels/network/networkTimingTable.css +11 -26
- package/front_end/panels/profiler/profilesPanel.css +0 -11
- package/front_end/panels/recorder/ControlButton.ts +1 -1
- package/front_end/panels/recorder/RecordingView.ts +22 -1
- package/front_end/panels/recorder/StepView.ts +26 -1
- package/front_end/panels/recorder/TimelineSection.ts +22 -6
- package/front_end/panels/recorder/controlButton.css +2 -9
- package/front_end/panels/recorder/recorderPanel.css +0 -1
- package/front_end/panels/recorder/recordingView.css +32 -32
- package/front_end/panels/recorder/replaySection.css +2 -0
- package/front_end/panels/recorder/stepView.css +18 -14
- package/front_end/panels/recorder/timelineSection.css +60 -84
- package/front_end/panels/search/searchView.css +1 -1
- package/front_end/panels/sensors/SensorsView.ts +6 -21
- package/front_end/panels/sources/breakpointsView.css +3 -2
- package/front_end/panels/sources/sourcesView.css +2 -1
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +18 -5
- package/front_end/panels/timeline/TimelineController.ts +30 -26
- package/front_end/panels/timeline/TimelineDetailsView.ts +10 -9
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +4 -16
- package/front_end/panels/timeline/TimelineMiniMap.ts +132 -54
- package/front_end/panels/timeline/TimelineTreeView.ts +25 -9
- package/front_end/panels/timeline/components/DetailsView.ts +7 -14
- package/front_end/panels/timeline/components/NetworkTrackWidget.ts +5 -1
- package/front_end/panels/timeline/components/interactionBreakdown.css +1 -0
- package/front_end/panels/timeline/components/networkRequestDetails.css +1 -0
- package/front_end/panels/timeline/components/networkTrackWidget.css +1 -1
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +1 -0
- package/front_end/panels/timeline/docs/profile_calls.md +7 -9
- package/front_end/panels/timeline/timelineDetailsView.css +2 -2
- package/front_end/panels/webauthn/webauthnPane.css +1 -1
- package/front_end/third_party/axe-core/README.chromium +2 -3
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +328 -11
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +907 -588
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +119 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts +120 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.d.ts +16 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.js +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts +26 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +23 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js +21 -14
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.d.ts +5 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js +4 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.d.ts +6 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js +158 -67
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.js +28 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.js +19 -11
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js +17 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Input.js +62 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/NetworkEvents.d.ts +29 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/NetworkEvents.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/NetworkEvents.js +60 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/NetworkEvents.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts +9 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js +24 -9
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Realm.js +16 -7
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Browser.d.ts +6 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Browser.js +37 -20
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js +10 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Navigation.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Navigation.js +18 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Navigation.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Request.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Request.js +24 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Request.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Binding.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Binding.js +6 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Binding.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExtensionTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExtensionTransport.js +30 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExtensionTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.js +12 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.d.ts +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js +40 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.d.ts +23 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.js +37 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkEventManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js +74 -16
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js +34 -23
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ResponseBodyStream.d.ts +10 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ResponseBodyStream.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ResponseBodyStream.js +94 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ResponseBodyStream.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js +29 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/utils.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/utils.js +6 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/utils.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConsoleMessage.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.d.ts +4 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js +34 -15
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +11 -7
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js +10 -7
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/decorators.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +328 -11
- package/front_end/third_party/puppeteer/package/package.json +10 -8
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +118 -0
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +119 -0
- package/front_end/third_party/puppeteer/package/src/api/HTTPRequest.ts +25 -2
- package/front_end/third_party/puppeteer/package/src/api/HTTPResponse.ts +28 -0
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +65 -38
- package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +27 -7
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +43 -7
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserConnector.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +5 -1
- package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +38 -8
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +27 -12
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +19 -6
- package/front_end/third_party/puppeteer/package/src/bidi/Input.ts +72 -5
- package/front_end/third_party/puppeteer/package/src/bidi/NetworkEvents.ts +82 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +37 -13
- package/front_end/third_party/puppeteer/package/src/bidi/Realm.ts +26 -14
- package/front_end/third_party/puppeteer/package/src/bidi/core/Browser.ts +43 -22
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +13 -5
- package/front_end/third_party/puppeteer/package/src/bidi/core/Navigation.ts +21 -1
- package/front_end/third_party/puppeteer/package/src/bidi/core/Request.ts +27 -5
- package/front_end/third_party/puppeteer/package/src/cdp/Binding.ts +6 -4
- package/front_end/third_party/puppeteer/package/src/cdp/ExtensionTransport.ts +31 -6
- package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +5 -0
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +18 -1
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPResponse.ts +48 -0
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkEventManager.ts +58 -5
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +94 -14
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +50 -28
- package/front_end/third_party/puppeteer/package/src/cdp/ResponseBodyStream.ts +106 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +38 -3
- package/front_end/third_party/puppeteer/package/src/cdp/cdp.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/cdp/utils.ts +6 -5
- package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +5 -0
- package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +17 -8
- package/front_end/third_party/puppeteer/package/src/common/util.ts +32 -15
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +21 -13
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +10 -10
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/decorators.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +2 -0
- package/front_end/ui/components/diff_view/diffView.css +0 -2
- package/front_end/ui/components/tooltips/Tooltip.ts +29 -0
- package/front_end/ui/components/tree_outline/treeOutline.css +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +34 -20
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +41 -14
- package/front_end/ui/legacy/components/source_frame/imageView.css +2 -2
- package/front_end/ui/legacy/filter.css +6 -2
- package/front_end/ui/legacy/inspectorCommon.css +1 -53
- package/front_end/ui/legacy/listWidget.css +1 -1
- package/front_end/ui/legacy/tabbedPane.css +0 -8
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/inspector_overlay/tool_highlight.css +0 -7
- package/inspector_overlay/tool_highlight.ts +0 -1
- package/package.json +1 -1
|
@@ -7,7 +7,12 @@ import type * as CPUProfile from '../../cpu_profile/cpu_profile.js';
|
|
|
7
7
|
import * as Types from '../types/types.js';
|
|
8
8
|
|
|
9
9
|
import {milliToMicro} from './Timing.js';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
eventTimeComparator,
|
|
12
|
+
extractSampleTraceId,
|
|
13
|
+
makeProfileCall,
|
|
14
|
+
sortTraceEventsInPlace,
|
|
15
|
+
} from './Trace.js';
|
|
11
16
|
|
|
12
17
|
/**
|
|
13
18
|
* This is a helper that integrates CPU profiling data coming in the
|
|
@@ -22,14 +27,16 @@ import {extractSampleTraceId, makeProfileCall, mergeEventsInOrder, sortTraceEven
|
|
|
22
27
|
* the shape of a complete trace events and can be treated as flame
|
|
23
28
|
* chart entries in the timeline.
|
|
24
29
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
30
|
+
* `buildProfileCalls()` streams the two chronologically ordered inputs
|
|
31
|
+
* (sorted `traceEvents` and sorted `#profileModel.samples`) with two
|
|
32
|
+
* cursors and a single reusable scratch `SyntheticProfileCall`, avoiding
|
|
33
|
+
* per-sample event and merged-array allocations. As the cursors advance,
|
|
34
|
+
* the integrator tracks the active JS call stack across three transitions:
|
|
35
|
+
* 1. A trace event ended (its `ts + dur` precedes or equals the next item).
|
|
36
|
+
* 2. A CPU sample was taken.
|
|
37
|
+
* 3. A trace event started.
|
|
38
|
+
* Depending on the transition, the integrator opens, extends, or truncates
|
|
39
|
+
* JS calls on `#currentJSStack`.
|
|
33
40
|
*
|
|
34
41
|
* note: Although this approach has been implemented since long ago, and
|
|
35
42
|
* is relatively efficient (adds a complexity over the trace parsing of
|
|
@@ -87,15 +94,16 @@ export class SamplesIntegrator {
|
|
|
87
94
|
*/
|
|
88
95
|
#profileModel: CPUProfile.CPUProfileDataModel.CPUProfileDataModel;
|
|
89
96
|
/**
|
|
90
|
-
* Because GC nodes don't have a stack,
|
|
91
|
-
*
|
|
92
|
-
*
|
|
97
|
+
* Because GC nodes don't have a stack, the integrator attaches the stack
|
|
98
|
+
* of the preceding sample to them. This map records which node provides
|
|
99
|
+
* the stack for each GC sample, keyed by `sampleIndex` (all GC samples
|
|
100
|
+
* share one `gcNode` ID with different preceding stacks, and samples do
|
|
101
|
+
* not have distinct `ProfileCall` object identities during the merge).
|
|
93
102
|
* Note that GC samples are not shown in the flamechart, however they
|
|
94
|
-
* are used during the construction of
|
|
95
|
-
*
|
|
96
|
-
* GC node is sampled.
|
|
103
|
+
* are used during the construction of profile calls to infer the
|
|
104
|
+
* duration of the executed code when a GC node is sampled.
|
|
97
105
|
*/
|
|
98
|
-
#nodeForGC = new Map<
|
|
106
|
+
#nodeForGC = new Map<number, CPUProfile.ProfileTreeModel.ProfileNode>();
|
|
99
107
|
|
|
100
108
|
#engineConfig: Types.Configuration.Configuration;
|
|
101
109
|
#profileId: Types.Events.ProfileID;
|
|
@@ -116,49 +124,109 @@ export class SamplesIntegrator {
|
|
|
116
124
|
this.#profileId = profileId;
|
|
117
125
|
}
|
|
118
126
|
|
|
127
|
+
/**
|
|
128
|
+
* Approximates JS call durations by streaming sorted `traceEvents` and
|
|
129
|
+
* `#profileModel.samples` in chronological order with two cursors.
|
|
130
|
+
*
|
|
131
|
+
* `traceEvents` must already be sorted with `sortTraceEventsInPlace()`
|
|
132
|
+
* (`#profileModel.samples` and `timestamps` are sorted during
|
|
133
|
+
* `CPUProfileDataModel` construction).
|
|
134
|
+
*/
|
|
119
135
|
buildProfileCalls(traceEvents: Types.Events.Event[]): Types.Events.SyntheticProfileCall[] {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
136
|
+
// Pre-index GC substitute stacks (and debug-mode JSSample events) before streaming.
|
|
137
|
+
this.#prepareSamples();
|
|
138
|
+
const samples = this.#profileModel.samples;
|
|
139
|
+
const timestamps = this.#profileModel.timestamps;
|
|
140
|
+
const numSamples = samples ? samples.length : 0;
|
|
141
|
+
// Reused mutable scratch event representing the current CPU sample at
|
|
142
|
+
// `sampleCursor - 1`. Only `nodeId`, `callFrame`, `sampleIndex`, and `ts`
|
|
143
|
+
// vary per sample (`profileId`, `pid`, `tid`, `ph`, and `dur: 0` remain
|
|
144
|
+
// constant for this integrator instance).
|
|
145
|
+
//
|
|
146
|
+
// Invariant: `sampleEvent` must NEVER be pushed onto `stack`,
|
|
147
|
+
// `#currentJSStack`, `#constructedProfileCalls`, or retained by reference.
|
|
148
|
+
// `#onProfileCall()` -> `#extractStackTrace()` reads its scalar fields and
|
|
149
|
+
// allocates fresh `SyntheticProfileCall` objects for opened stack frames.
|
|
150
|
+
let sampleEvent: Types.Events.SyntheticProfileCall|null = null;
|
|
151
|
+
let sampleCursor = 0;
|
|
152
|
+
const advanceSample = (): Types.Events.SyntheticProfileCall|null => {
|
|
153
|
+
while (sampleCursor < numSamples) {
|
|
154
|
+
const index = sampleCursor++;
|
|
155
|
+
const node = this.#profileModel.nodeByIndex(index);
|
|
156
|
+
if (!node) {
|
|
133
157
|
continue;
|
|
134
158
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
159
|
+
const ts = milliToMicro(Types.Timing.Milli(timestamps[index]));
|
|
160
|
+
if (sampleEvent === null) {
|
|
161
|
+
sampleEvent = makeProfileCall(node, this.#profileId, index, ts, this.#processId, this.#threadId);
|
|
162
|
+
} else {
|
|
163
|
+
sampleEvent.nodeId = node.id;
|
|
164
|
+
sampleEvent.callFrame = node.callFrame;
|
|
165
|
+
sampleEvent.sampleIndex = index;
|
|
166
|
+
sampleEvent.ts = ts;
|
|
167
|
+
}
|
|
168
|
+
return sampleEvent;
|
|
138
169
|
}
|
|
170
|
+
return null;
|
|
171
|
+
};
|
|
139
172
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
173
|
+
let traceCursor = 0;
|
|
174
|
+
const numTraceEvents = traceEvents.length;
|
|
175
|
+
const advanceTrace = (): Types.Events.Event|null => {
|
|
176
|
+
while (traceCursor < numTraceEvents) {
|
|
177
|
+
const traceEvent = traceEvents[traceCursor++];
|
|
178
|
+
// Instant events have zero duration and cannot change JS call durations
|
|
179
|
+
// unless they carry a `sampleTraceId` stack snapshot.
|
|
180
|
+
if (traceEvent.ph === Types.Events.Phase.INSTANT && !extractSampleTraceId(traceEvent)) {
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
return traceEvent;
|
|
143
184
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const parentDuration = parentEvent.dur || 0;
|
|
147
|
-
const parentEnd = parentBegin + parentDuration;
|
|
185
|
+
return null;
|
|
186
|
+
};
|
|
148
187
|
|
|
149
|
-
|
|
150
|
-
|
|
188
|
+
const stack: Types.Events.Event[] = [];
|
|
189
|
+
const unwindExpiredTraceEvents = (ts: Types.Timing.Micro): Types.Events.Event|undefined => {
|
|
190
|
+
let parentEvent = stack.at(-1);
|
|
191
|
+
while (parentEvent !== undefined && ts >= parentEvent.ts + (parentEvent.dur || 0)) {
|
|
151
192
|
this.#onTraceEventEnd(parentEvent);
|
|
152
193
|
stack.pop();
|
|
153
|
-
|
|
154
|
-
|
|
194
|
+
parentEvent = stack.at(-1);
|
|
195
|
+
}
|
|
196
|
+
return parentEvent;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
let nextSample = advanceSample();
|
|
200
|
+
let nextTraceEvent = advanceTrace();
|
|
201
|
+
while (nextTraceEvent !== null || nextSample !== null) {
|
|
202
|
+
// Match `mergeEventsInOrder` tie-breaking at identical timestamps (`ts`):
|
|
203
|
+
// - Trace events with `dur > 0` end after a 0-duration sample, so
|
|
204
|
+
// `eventTimeComparator` returns `-1` and the trace event is pushed onto
|
|
205
|
+
// `stack` first as the sample's parent execution context.
|
|
206
|
+
// - Zero-duration trace events (`(dur ?? 0) === 0`, such as instant
|
|
207
|
+
// events with a `sampleTraceId`) tie on both start and end time, so
|
|
208
|
+
// `eventTimeComparator` prioritizes the `ProfileCall` (returns `1`) and
|
|
209
|
+
// the sample updates `#currentJSStack` first to parent the trace event.
|
|
210
|
+
const useSample =
|
|
211
|
+
nextSample !== null && (nextTraceEvent === null || eventTimeComparator(nextTraceEvent, nextSample) > 0);
|
|
212
|
+
const event = useSample ? nextSample : nextTraceEvent;
|
|
213
|
+
if (event === null) {
|
|
214
|
+
break;
|
|
155
215
|
}
|
|
216
|
+
|
|
217
|
+
const parentEvent = unwindExpiredTraceEvents(event.ts);
|
|
156
218
|
if (Types.Events.isProfileCall(event)) {
|
|
157
219
|
this.#onProfileCall(event, parentEvent);
|
|
158
|
-
|
|
220
|
+
} else {
|
|
221
|
+
this.#onTraceEventStart(event, parentEvent);
|
|
222
|
+
stack.push(event);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (useSample) {
|
|
226
|
+
nextSample = advanceSample();
|
|
227
|
+
} else {
|
|
228
|
+
nextTraceEvent = advanceTrace();
|
|
159
229
|
}
|
|
160
|
-
this.#onTraceEventStart(event, parentEvent);
|
|
161
|
-
stack.push(event);
|
|
162
230
|
}
|
|
163
231
|
while (stack.length) {
|
|
164
232
|
const last = stack.pop();
|
|
@@ -170,6 +238,40 @@ export class SamplesIntegrator {
|
|
|
170
238
|
return this.#constructedProfileCalls;
|
|
171
239
|
}
|
|
172
240
|
|
|
241
|
+
/**
|
|
242
|
+
* Pre-indexes the preceding non-GC node for each GC sample in `#nodeForGC`
|
|
243
|
+
* (keyed by `sampleIndex`) so `#stackNodesForProfileCall()` can resolve GC
|
|
244
|
+
* stacks during the streaming merge without per-sample `ProfileCall` objects.
|
|
245
|
+
*
|
|
246
|
+
* When `debugMode` is enabled, this pass also populates `jsSampleEvents`
|
|
247
|
+
* before `buildProfileCalls()` appends any `sampleTraceId` sample events.
|
|
248
|
+
*/
|
|
249
|
+
#prepareSamples(): void {
|
|
250
|
+
const samples = this.#profileModel.samples;
|
|
251
|
+
const timestamps = this.#profileModel.timestamps;
|
|
252
|
+
if (!samples) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
let prevNode: CPUProfile.ProfileTreeModel.ProfileNode|undefined;
|
|
256
|
+
for (let i = 0; i < samples.length; i++) {
|
|
257
|
+
const node = this.#profileModel.nodeByIndex(i);
|
|
258
|
+
if (!node) {
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
if (this.#engineConfig.debugMode) {
|
|
262
|
+
const timestamp = milliToMicro(Types.Timing.Milli(timestamps[i]));
|
|
263
|
+
const call = makeProfileCall(node, this.#profileId, i, timestamp, this.#processId, this.#threadId);
|
|
264
|
+
const traceId = this.#profileModel.traceIds?.[i];
|
|
265
|
+
this.jsSampleEvents.push(this.#makeJSSampleEvent(call, timestamp, traceId));
|
|
266
|
+
}
|
|
267
|
+
if (node.id === this.#profileModel.gcNode?.id && prevNode) {
|
|
268
|
+
this.#nodeForGC.set(i, prevNode);
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
prevNode = node;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
173
275
|
#onTraceEventStart(event: Types.Events.Event, parent?: Types.Events.Event): void {
|
|
174
276
|
// Top level events cannot be nested into JS frames so we reset
|
|
175
277
|
// the stack when we find one.
|
|
@@ -216,10 +318,15 @@ export class SamplesIntegrator {
|
|
|
216
318
|
this.#lockedJsStackDepth.push(this.#currentJSStack.length);
|
|
217
319
|
}
|
|
218
320
|
|
|
321
|
+
/**
|
|
322
|
+
* Integrates a CPU sample into `#currentJSStack`. During `buildProfileCalls()`,
|
|
323
|
+
* `event` is typically the mutable scratch `sampleEvent` and must never be
|
|
324
|
+
* retained by reference.
|
|
325
|
+
*/
|
|
219
326
|
#onProfileCall(event: Types.Events.SyntheticProfileCall, parent?: Types.Events.Event): void {
|
|
220
327
|
if ((parent && Types.Events.isJSInvocationEvent(parent)) || this.#fakeJSInvocation) {
|
|
221
328
|
this.#extractStackTrace(event);
|
|
222
|
-
} else if (
|
|
329
|
+
} else if (this.#currentJSStack.length === 0) {
|
|
223
330
|
// Force JS Samples to show up even if we are not inside a JS
|
|
224
331
|
// invocation event, because we can be missing the start of JS
|
|
225
332
|
// invocation events if we start tracing half-way through. Pretend
|
|
@@ -239,45 +346,6 @@ export class SamplesIntegrator {
|
|
|
239
346
|
this.#truncateJSStack(this.#lockedJsStackDepth.pop() || 0, endTime);
|
|
240
347
|
}
|
|
241
348
|
|
|
242
|
-
/**
|
|
243
|
-
* Builds the initial calls with no duration from samples. Their
|
|
244
|
-
* purpose is to be merged with the trace event array being parsed so
|
|
245
|
-
* that they can be traversed in order with them and their duration
|
|
246
|
-
* can be updated as the SampleIntegrator callbacks are invoked.
|
|
247
|
-
*/
|
|
248
|
-
callsFromProfileSamples(): Types.Events.SyntheticProfileCall[] {
|
|
249
|
-
const samples = this.#profileModel.samples;
|
|
250
|
-
const timestamps = this.#profileModel.timestamps;
|
|
251
|
-
if (!samples) {
|
|
252
|
-
return [];
|
|
253
|
-
}
|
|
254
|
-
const calls: Types.Events.SyntheticProfileCall[] = [];
|
|
255
|
-
let prevNode;
|
|
256
|
-
for (let i = 0; i < samples.length; i++) {
|
|
257
|
-
const node = this.#profileModel.nodeByIndex(i);
|
|
258
|
-
const timestamp = milliToMicro(Types.Timing.Milli(timestamps[i]));
|
|
259
|
-
if (!node) {
|
|
260
|
-
continue;
|
|
261
|
-
}
|
|
262
|
-
const call = makeProfileCall(node, this.#profileId, i, timestamp, this.#processId, this.#threadId);
|
|
263
|
-
calls.push(call);
|
|
264
|
-
|
|
265
|
-
if (this.#engineConfig.debugMode) {
|
|
266
|
-
const traceId = this.#profileModel.traceIds?.[i];
|
|
267
|
-
this.jsSampleEvents.push(this.#makeJSSampleEvent(call, timestamp, traceId));
|
|
268
|
-
}
|
|
269
|
-
if (node.id === this.#profileModel.gcNode?.id && prevNode) {
|
|
270
|
-
// GC samples have no stack, so we just put GC node on top of the
|
|
271
|
-
// last recorded sample. Cache the previous sample for future
|
|
272
|
-
// reference.
|
|
273
|
-
this.#nodeForGC.set(call, prevNode);
|
|
274
|
-
continue;
|
|
275
|
-
}
|
|
276
|
-
prevNode = node;
|
|
277
|
-
}
|
|
278
|
-
return calls;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
349
|
/**
|
|
282
350
|
* Given a synthetic profile call, returns the profile nodes of the
|
|
283
351
|
* stack trace that profile call belongs to based on its nodeId,
|
|
@@ -293,7 +361,7 @@ export class SamplesIntegrator {
|
|
|
293
361
|
if (isGarbageCollection) {
|
|
294
362
|
// Because GC don't have a stack, we use the stack of the previous
|
|
295
363
|
// sample.
|
|
296
|
-
node = this.#nodeForGC.get(profileCall) || null;
|
|
364
|
+
node = this.#nodeForGC.get(profileCall.sampleIndex) || null;
|
|
297
365
|
}
|
|
298
366
|
if (!sampledNode || !node) {
|
|
299
367
|
return [];
|
|
@@ -9,7 +9,6 @@ import type * as CPUProfile from '../../cpu_profile/cpu_profile.js';
|
|
|
9
9
|
import * as Types from '../types/types.js';
|
|
10
10
|
|
|
11
11
|
import {SyntheticEventsManager} from './SyntheticEvents.js';
|
|
12
|
-
import {eventTimingsMicroSeconds} from './Timing.js';
|
|
13
12
|
|
|
14
13
|
interface MatchingPairableAsyncEvents {
|
|
15
14
|
syntheticId: string;
|
|
@@ -769,28 +768,32 @@ export function forEachEvent(
|
|
|
769
768
|
const startEventIndex = topLevelEventIndexEndingAfter(events, globalStartTime);
|
|
770
769
|
for (let i = startEventIndex; i < events.length; i++) {
|
|
771
770
|
const currentEvent = events[i];
|
|
772
|
-
const
|
|
773
|
-
|
|
771
|
+
const startTime = currentEvent.ts;
|
|
772
|
+
const duration = currentEvent.dur || 0;
|
|
773
|
+
const endTime = startTime + duration;
|
|
774
|
+
if (endTime < globalStartTime) {
|
|
774
775
|
continue;
|
|
775
776
|
}
|
|
776
|
-
if (
|
|
777
|
+
if (startTime > globalEndTime) {
|
|
777
778
|
break;
|
|
778
779
|
}
|
|
779
780
|
|
|
780
|
-
|
|
781
|
-
|
|
781
|
+
if (currentEvent.ph !== Types.Events.Phase.COMPLETE &&
|
|
782
|
+
((ignoreAsyncEvents && Types.Events.isPhaseAsync(currentEvent.ph)) ||
|
|
783
|
+
Types.Events.isFlowPhase(currentEvent.ph))) {
|
|
782
784
|
continue;
|
|
783
785
|
}
|
|
784
786
|
|
|
785
787
|
// If we have now reached an event that is after a bunch of events, we need
|
|
786
788
|
// to call the onEndEvent callback for those events before moving on.
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
789
|
+
while (stack.length > 0) {
|
|
790
|
+
const lastEventOnStack = stack[stack.length - 1];
|
|
791
|
+
const lastEventEndTime = lastEventOnStack.ts + (lastEventOnStack.dur ?? 0);
|
|
792
|
+
if (lastEventEndTime > startTime) {
|
|
793
|
+
break;
|
|
794
|
+
}
|
|
790
795
|
stack.pop();
|
|
791
796
|
config.onEndEvent(lastEventOnStack);
|
|
792
|
-
lastEventOnStack = stack.at(-1);
|
|
793
|
-
lastEventEndTime = lastEventOnStack ? eventTimingsMicroSeconds(lastEventOnStack).endTime : null;
|
|
794
797
|
}
|
|
795
798
|
|
|
796
799
|
// Now we have dealt with all events prior to this one, see if we need to care about this one.
|
|
@@ -799,7 +802,7 @@ export function forEachEvent(
|
|
|
799
802
|
continue;
|
|
800
803
|
}
|
|
801
804
|
|
|
802
|
-
if (
|
|
805
|
+
if (duration) {
|
|
803
806
|
config.onStartEvent(currentEvent);
|
|
804
807
|
stack.push(currentEvent);
|
|
805
808
|
} else if (config.onInstantEvent) {
|
|
@@ -15,11 +15,34 @@ export const makeEmptyTraceEntryTree = (): TraceEntryTree => ({
|
|
|
15
15
|
maxDepth: 0,
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
+
// Most nodes in a trace tree are leaves, and most parent nodes have a single
|
|
19
|
+
// child. Sharing an empty array for leaves and creating a 1-element literal on
|
|
20
|
+
// the first append avoids allocating an empty JSArray per leaf and a 17-slot
|
|
21
|
+
// backing store for single-child parents. This array is kept unfrozen so V8
|
|
22
|
+
// uses the same PACKED_ELEMENTS map across leaf and parent children arrays.
|
|
23
|
+
const EMPTY_CHILDREN: TraceEntryNode[] = [];
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Appends a child to a `TraceEntryNode`.
|
|
27
|
+
*
|
|
28
|
+
* Call this helper instead of `parent.children.push(child)`. Nodes created by
|
|
29
|
+
* `makeEmptyTraceEntryNode` share a single empty array for their children to
|
|
30
|
+
* save memory; mutating `parent.children` directly on a leaf node corrupts all
|
|
31
|
+
* leaf nodes.
|
|
32
|
+
*/
|
|
33
|
+
export function appendChild(parent: TraceEntryNode, child: TraceEntryNode): void {
|
|
34
|
+
if (parent.children === EMPTY_CHILDREN) {
|
|
35
|
+
parent.children = [child];
|
|
36
|
+
} else {
|
|
37
|
+
parent.children.push(child);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
18
41
|
export const makeEmptyTraceEntryNode = (entry: Types.Events.Event, id: TraceEntryNodeId): TraceEntryNode => ({
|
|
19
42
|
entry,
|
|
20
43
|
id,
|
|
21
44
|
parent: null,
|
|
22
|
-
children:
|
|
45
|
+
children: EMPTY_CHILDREN,
|
|
23
46
|
depth: 0,
|
|
24
47
|
// selfTime is set on every node after creation. Declaring it here keeps it
|
|
25
48
|
// inside the object; adding it later makes V8 allocate a separate property
|
|
@@ -58,15 +81,22 @@ export type TraceEntryNodeId = Platform.Brand.Brand<number, 'traceEntryNodeIdTag
|
|
|
58
81
|
* The nodes are also assumed to be created empty, with no known parent
|
|
59
82
|
* or children.
|
|
60
83
|
*
|
|
84
|
+
* If `targetEntryToNode` is provided, it is populated in-place with each
|
|
85
|
+
* event's `TraceEntryNode` and returned as `entryToNode`.
|
|
86
|
+
*
|
|
61
87
|
* Complexity: O(n), where n = number of events
|
|
62
88
|
*/
|
|
63
|
-
export function treify(
|
|
64
|
-
|
|
65
|
-
|
|
89
|
+
export function treify(
|
|
90
|
+
entries: readonly Types.Events.Event[],
|
|
91
|
+
options?: {
|
|
92
|
+
filter: {has: (name: Types.Events.Name) => boolean},
|
|
93
|
+
},
|
|
94
|
+
targetEntryToNode?: Map<Types.Events.Event, TraceEntryNode>,
|
|
95
|
+
): {tree: TraceEntryTree, entryToNode: Map<Types.Events.Event, TraceEntryNode>} {
|
|
66
96
|
// As we construct the tree, store a map of each entry to its node. This
|
|
67
97
|
// means if you are iterating over a list of RendererEntry events you can
|
|
68
98
|
// easily look up that node in the tree.
|
|
69
|
-
const entryToNode = new Map<Types.Events.Event, TraceEntryNode>();
|
|
99
|
+
const entryToNode = targetEntryToNode ?? new Map<Types.Events.Event, TraceEntryNode>();
|
|
70
100
|
|
|
71
101
|
const stack = [];
|
|
72
102
|
// Reset the node id counter for every new renderer.
|
|
@@ -82,12 +112,11 @@ export function treify(entries: readonly Types.Events.Event[], options?: {
|
|
|
82
112
|
}
|
|
83
113
|
|
|
84
114
|
const duration = event.dur || 0;
|
|
85
|
-
const nodeId = makeTraceEntryNodeId();
|
|
86
|
-
const node = makeEmptyTraceEntryNode(event, nodeId);
|
|
87
115
|
|
|
88
116
|
// If the parent stack is empty, then the current event is a root. Create a
|
|
89
117
|
// node for it, mark it as a root, then proceed with the next event.
|
|
90
118
|
if (stack.length === 0) {
|
|
119
|
+
const node = makeEmptyTraceEntryNode(event, makeTraceEntryNodeId());
|
|
91
120
|
tree.roots.add(node);
|
|
92
121
|
node.selfTime = Types.Timing.Micro(duration);
|
|
93
122
|
stack.push(node);
|
|
@@ -129,8 +158,6 @@ export function treify(entries: readonly Types.Events.Event[], options?: {
|
|
|
129
158
|
if (startsAfterParent) {
|
|
130
159
|
stack.pop();
|
|
131
160
|
i--;
|
|
132
|
-
// The last created node has been discarded, so discard this id.
|
|
133
|
-
nodeIdCount--;
|
|
134
161
|
continue;
|
|
135
162
|
}
|
|
136
163
|
// 3. If the current event starts during the parent event, but ends
|
|
@@ -146,9 +173,10 @@ export function treify(entries: readonly Types.Events.Event[], options?: {
|
|
|
146
173
|
// contained within the parent event. Create a node for the current
|
|
147
174
|
// event, establish the parent/child relationship, then proceed with the
|
|
148
175
|
// next event.
|
|
176
|
+
const node = makeEmptyTraceEntryNode(event, makeTraceEntryNodeId());
|
|
149
177
|
node.depth = stack.length;
|
|
150
178
|
node.parent = parentNode;
|
|
151
|
-
parentNode
|
|
179
|
+
appendChild(parentNode, node);
|
|
152
180
|
node.selfTime = Types.Timing.Micro(duration);
|
|
153
181
|
if (parentNode.selfTime !== undefined) {
|
|
154
182
|
parentNode.selfTime = Types.Timing.Micro(parentNode.selfTime - (event.dur || 0));
|
|
@@ -75,7 +75,7 @@ export type SlowCSSSelectorInsightModel = InsightModel<typeof UIStrings, {
|
|
|
75
75
|
|
|
76
76
|
function aggregateSelectorStats(data: Handlers.ModelHandlers.SelectorStats.SelectorStatsData,
|
|
77
77
|
context: InsightSetContext): Types.Events.SelectorTiming[] {
|
|
78
|
-
const selectorMap = new Map<
|
|
78
|
+
const selectorMap = new Map<string, Types.Events.SelectorTiming>();
|
|
79
79
|
|
|
80
80
|
for (const [event, value] of data.dataForRecalcStyleEvent) {
|
|
81
81
|
if (event.args.beginData?.frame !== context.frameId) {
|
|
@@ -135,11 +135,11 @@ export function generateInsight(
|
|
|
135
135
|
let totalMatchAttempts = 0;
|
|
136
136
|
let totalMatchCount = 0;
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
for (const timing of selectorTimings) {
|
|
139
139
|
totalElapsedUs += timing[Types.Events.SelectorTimingsKey.Elapsed];
|
|
140
140
|
totalMatchAttempts += timing[Types.Events.SelectorTimingsKey.MatchAttempts];
|
|
141
141
|
totalMatchCount += timing[Types.Events.SelectorTimingsKey.MatchCount];
|
|
142
|
-
}
|
|
142
|
+
}
|
|
143
143
|
|
|
144
144
|
let topSelectorElapsedMs: Types.Events.SelectorTiming|null = null;
|
|
145
145
|
let topSelectorMatchAttempts: Types.Events.SelectorTiming|null = null;
|
|
@@ -16,6 +16,12 @@ import {
|
|
|
16
16
|
type MetricResult,
|
|
17
17
|
} from './Metric.js';
|
|
18
18
|
|
|
19
|
+
// Prior to https://crbug.com/583885865, Blink wrote largestContentfulPaint::Candidate
|
|
20
|
+
// with the exact base::TimeTicks presentation timestamp while firstContentfulPaint
|
|
21
|
+
// round-tripped through double seconds (InSecondsF -> base::Seconds), which could
|
|
22
|
+
// truncate the FCP trace timestamp by 1 µs for the exact same frame presentation.
|
|
23
|
+
const SAME_FRAME_TIMESTAMP_TOLERANCE_US = 10;
|
|
24
|
+
|
|
19
25
|
function stripUrlHash(urlStr: string): string {
|
|
20
26
|
if (!urlStr.includes('#')) {
|
|
21
27
|
return urlStr;
|
|
@@ -125,13 +131,22 @@ class LargestContentfulPaint extends Metric {
|
|
|
125
131
|
return urlMatches[0];
|
|
126
132
|
}
|
|
127
133
|
|
|
134
|
+
static isSameFrameTextLcp(processedNavigation: Types.Simulation.ProcessedNavigation): boolean {
|
|
135
|
+
const {firstContentfulPaint: fcp, largestContentfulPaint: lcp} = processedNavigation.timestamps;
|
|
136
|
+
if (!lcp) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
return Math.abs(lcp - fcp) <= SAME_FRAME_TIMESTAMP_TOLERANCE_US &&
|
|
140
|
+
processedNavigation.largestContentfulPaintEvt?.args?.data?.type === 'text';
|
|
141
|
+
}
|
|
142
|
+
|
|
128
143
|
static override getOptimisticGraph(
|
|
129
144
|
dependencyGraph: Graph.Node, processedNavigation: Types.Simulation.ProcessedNavigation): Graph.Node {
|
|
130
|
-
const
|
|
145
|
+
const lcp = processedNavigation.timestamps.largestContentfulPaint;
|
|
131
146
|
if (!lcp) {
|
|
132
147
|
throw new Core.LanternError('NO_LCP');
|
|
133
148
|
}
|
|
134
|
-
if (
|
|
149
|
+
if (LargestContentfulPaint.isSameFrameTextLcp(processedNavigation)) {
|
|
135
150
|
return FirstContentfulPaint.getOptimisticGraph(dependencyGraph, processedNavigation);
|
|
136
151
|
}
|
|
137
152
|
|
|
@@ -177,11 +192,11 @@ class LargestContentfulPaint extends Metric {
|
|
|
177
192
|
|
|
178
193
|
static override getPessimisticGraph(
|
|
179
194
|
dependencyGraph: Graph.Node, processedNavigation: Types.Simulation.ProcessedNavigation): Graph.Node {
|
|
180
|
-
const
|
|
195
|
+
const lcp = processedNavigation.timestamps.largestContentfulPaint;
|
|
181
196
|
if (!lcp) {
|
|
182
197
|
throw new Core.LanternError('NO_LCP');
|
|
183
198
|
}
|
|
184
|
-
if (
|
|
199
|
+
if (LargestContentfulPaint.isSameFrameTextLcp(processedNavigation)) {
|
|
185
200
|
return FirstContentfulPaint.getPessimisticGraph(dependencyGraph, processedNavigation);
|
|
186
201
|
}
|
|
187
202
|
|