chrome-devtools-frontend 1.0.950850 → 1.0.952284

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.
Files changed (379) hide show
  1. package/config/gni/devtools_grd_files.gni +3 -3
  2. package/extension-api/ExtensionAPI.d.ts +1 -1
  3. package/front_end/.eslintrc.js +6 -0
  4. package/front_end/Tests.js +10 -0
  5. package/front_end/core/common/App.ts +0 -3
  6. package/front_end/core/common/AppProvider.ts +0 -3
  7. package/front_end/core/common/JavaScriptMetaData.ts +0 -3
  8. package/front_end/core/common/QueryParamHandler.ts +0 -3
  9. package/front_end/core/common/Runnable.ts +0 -3
  10. package/front_end/core/common/SimpleHistoryManager.ts +0 -3
  11. package/front_end/core/i18n/locales/en-US.json +183 -183
  12. package/front_end/core/i18n/locales/en-XL.json +183 -183
  13. package/front_end/core/sdk/CSSRule.ts +1 -1
  14. package/front_end/core/sdk/DOMModel.ts +12 -37
  15. package/front_end/core/sdk/OverlayModel.ts +18 -34
  16. package/front_end/core/sdk/OverlayPersistentHighlighter.ts +0 -12
  17. package/front_end/core/sdk/RuntimeModel.ts +0 -1
  18. package/front_end/core/sdk/SourceMap.ts +1 -1
  19. package/front_end/core/sdk/TracingManager.ts +0 -3
  20. package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +36 -36
  21. package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +53 -53
  22. package/front_end/entrypoints/formatter_worker/ESTreeWalker.ts +11 -11
  23. package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +43 -43
  24. package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +106 -105
  25. package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +26 -26
  26. package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +51 -56
  27. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +201 -204
  28. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +84 -83
  29. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +16 -16
  30. package/front_end/entrypoints/inspector_main/InspectorMain.ts +21 -21
  31. package/front_end/entrypoints/main/ExecutionContextSelector.ts +30 -30
  32. package/front_end/entrypoints/main/MainImpl.ts +12 -12
  33. package/front_end/entrypoints/node_app/NodeConnectionsPanel.ts +33 -33
  34. package/front_end/entrypoints/node_app/NodeMain.ts +35 -35
  35. package/front_end/generated/InspectorBackendCommands.js +5 -1
  36. package/front_end/generated/protocol.d.ts +16 -0
  37. package/front_end/models/bindings/CSSWorkspaceBinding.ts +0 -3
  38. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +1 -2
  39. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +1 -4
  40. package/front_end/models/bindings/FileUtils.ts +0 -4
  41. package/front_end/models/bindings/IgnoreListManager.ts +1 -2
  42. package/front_end/models/bindings/NetworkProject.ts +1 -2
  43. package/front_end/models/extensions/ExtensionAPI.ts +2 -2
  44. package/front_end/models/extensions/ExtensionTraceProvider.ts +0 -3
  45. package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +6 -6
  46. package/front_end/models/issues_manager/ContrastCheckTrigger.ts +15 -15
  47. package/front_end/models/issues_manager/CorsIssue.ts +9 -9
  48. package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +5 -5
  49. package/front_end/models/issues_manager/DeprecationIssue.ts +7 -7
  50. package/front_end/models/issues_manager/GenericIssue.ts +5 -5
  51. package/front_end/models/issues_manager/HeavyAdIssue.ts +5 -5
  52. package/front_end/models/issues_manager/Issue.ts +10 -10
  53. package/front_end/models/issues_manager/IssueResolver.ts +11 -10
  54. package/front_end/models/issues_manager/IssuesManager.ts +56 -56
  55. package/front_end/models/issues_manager/LowTextContrastIssue.ts +4 -4
  56. package/front_end/models/issues_manager/MixedContentIssue.ts +7 -7
  57. package/front_end/models/issues_manager/NavigatorUserAgentIssue.ts +7 -7
  58. package/front_end/models/issues_manager/QuirksModeIssue.ts +4 -4
  59. package/front_end/models/issues_manager/SameSiteCookieIssue.ts +17 -18
  60. package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +5 -5
  61. package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +32 -31
  62. package/front_end/models/issues_manager/TrustedWebActivityIssue.ts +5 -5
  63. package/front_end/models/issues_manager/WasmCrossOriginModuleSharingIssue.ts +5 -5
  64. package/front_end/models/timeline_model/TimelineModel.ts +1 -1
  65. package/front_end/models/timeline_model/TracingLayerTree.ts +0 -1
  66. package/front_end/panels/accessibility/ARIAMetadata.ts +0 -1
  67. package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +2 -2
  68. package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -2
  69. package/front_end/panels/animation/AnimationTimeline.ts +0 -1
  70. package/front_end/panels/application/ApplicationPanelCacheSection.ts +3 -4
  71. package/front_end/panels/application/ServiceWorkerUpdateCycleView.ts +0 -2
  72. package/front_end/panels/application/StorageView.ts +2 -6
  73. package/front_end/panels/application/{BackForwardCacheStrings.ts → components/BackForwardCacheStrings.ts} +2 -2
  74. package/front_end/panels/application/{BackForwardCacheView.ts → components/BackForwardCacheView.ts} +96 -62
  75. package/front_end/panels/application/components/EndpointsGrid.ts +12 -12
  76. package/front_end/panels/application/components/FrameDetailsView.ts +108 -110
  77. package/front_end/panels/application/components/OriginTrialTreeView.ts +45 -45
  78. package/front_end/panels/application/components/PermissionsPolicySection.ts +19 -19
  79. package/front_end/panels/application/components/ReportsGrid.ts +30 -30
  80. package/front_end/panels/application/components/StackTrace.ts +48 -47
  81. package/front_end/panels/application/components/TrustTokensView.ts +31 -31
  82. package/front_end/panels/application/{backForwardCacheView.css → components/backForwardCacheView.css} +9 -0
  83. package/front_end/panels/application/components/components.ts +2 -0
  84. package/front_end/panels/console/ConsoleViewMessage.ts +1 -25
  85. package/front_end/panels/console/consoleView.css +5 -0
  86. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +41 -52
  87. package/front_end/panels/css_overview/CSSOverviewController.ts +2 -2
  88. package/front_end/panels/css_overview/CSSOverviewPanel.ts +18 -27
  89. package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +2 -2
  90. package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +6 -6
  91. package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +4 -4
  92. package/front_end/panels/elements/ComputedStyleModel.ts +2 -2
  93. package/front_end/panels/elements/ElementsPanel.ts +1 -5
  94. package/front_end/panels/elements/ElementsTreeElement.ts +2 -6
  95. package/front_end/panels/elements/ElementsTreeOutline.ts +2 -2
  96. package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
  97. package/front_end/panels/elements/components/AccessibilityTreeNode.ts +17 -17
  98. package/front_end/panels/elements/components/AdornerManager.ts +21 -21
  99. package/front_end/panels/elements/components/AdornerSettingsPane.ts +14 -14
  100. package/front_end/panels/elements/components/CSSQuery.ts +16 -16
  101. package/front_end/panels/elements/components/ComputedStyleProperty.ts +14 -14
  102. package/front_end/panels/elements/components/ComputedStyleTrace.ts +15 -15
  103. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +78 -78
  104. package/front_end/panels/elements/components/ElementsPanelLink.ts +16 -16
  105. package/front_end/panels/elements/components/LayoutPane.ts +47 -47
  106. package/front_end/panels/elements/components/NodeText.ts +18 -18
  107. package/front_end/panels/elements/components/QueryContainer.ts +40 -40
  108. package/front_end/panels/elements/components/StylePropertyEditor.ts +18 -18
  109. package/front_end/panels/emulation/components/DeviceSizeInputElement.ts +4 -4
  110. package/front_end/panels/event_listeners/EventListenersUtils.ts +2 -1
  111. package/front_end/panels/issues/AffectedBlockedByResponseView.ts +4 -4
  112. package/front_end/panels/issues/AffectedCookiesView.ts +4 -5
  113. package/front_end/panels/issues/AffectedDirectivesView.ts +19 -19
  114. package/front_end/panels/issues/AffectedDocumentsInQuirksModeView.ts +7 -8
  115. package/front_end/panels/issues/AffectedElementsView.ts +4 -4
  116. package/front_end/panels/issues/AffectedElementsWithLowContrastView.ts +7 -8
  117. package/front_end/panels/issues/AffectedHeavyAdView.ts +8 -8
  118. package/front_end/panels/issues/AffectedResourcesView.ts +25 -26
  119. package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +8 -8
  120. package/front_end/panels/issues/AffectedSourcesView.ts +4 -4
  121. package/front_end/panels/issues/AffectedTrustedWebActivityIssueDetailsView.ts +4 -4
  122. package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +17 -17
  123. package/front_end/panels/issues/CSPViolationsListView.ts +22 -23
  124. package/front_end/panels/issues/CSPViolationsView.ts +17 -17
  125. package/front_end/panels/issues/ComboBoxOfCheckBoxes.ts +13 -13
  126. package/front_end/panels/issues/CorsIssueDetailsView.ts +23 -23
  127. package/front_end/panels/issues/GenericIssueDetailsView.ts +4 -4
  128. package/front_end/panels/issues/HiddenIssuesRow.ts +7 -7
  129. package/front_end/panels/issues/IssueAggregator.ts +95 -95
  130. package/front_end/panels/issues/IssueKindView.ts +14 -14
  131. package/front_end/panels/issues/IssueView.ts +98 -98
  132. package/front_end/panels/issues/IssuesPane.ts +102 -102
  133. package/front_end/panels/issues/WasmCrossOriginModuleSharingAffectedResourcesView.ts +5 -5
  134. package/front_end/panels/issues/components/HideIssuesMenu.ts +10 -10
  135. package/front_end/panels/layer_viewer/Layers3DView.ts +3 -9
  136. package/front_end/panels/lighthouse/LighthouseController.ts +4 -5
  137. package/front_end/panels/media/PlayerListView.ts +160 -97
  138. package/front_end/panels/media/PlayerMessagesView.ts +1 -0
  139. package/front_end/panels/media/TickingFlameChart.ts +1 -2
  140. package/front_end/panels/media/playerListView.css +58 -0
  141. package/front_end/panels/network/NetworkLogView.ts +2 -6
  142. package/front_end/panels/network/NetworkLogViewColumns.ts +1 -1
  143. package/front_end/panels/network/NetworkWaterfallColumn.ts +2 -4
  144. package/front_end/panels/network/components/RequestTrustTokensView.ts +40 -40
  145. package/front_end/panels/network/components/WebBundleInfoView.ts +9 -9
  146. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +6 -12
  147. package/front_end/panels/profiler/HeapProfileView.ts +1 -1
  148. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +0 -1
  149. package/front_end/panels/profiler/HeapSnapshotView.ts +1 -2
  150. package/front_end/panels/profiler/heapProfiler.css +1 -1
  151. package/front_end/panels/search/SearchConfig.ts +0 -6
  152. package/front_end/panels/security/SecurityModel.ts +2 -4
  153. package/front_end/panels/security/SecurityPanel.ts +2 -2
  154. package/front_end/panels/settings/KeybindsSettingsTab.ts +4 -0
  155. package/front_end/panels/settings/components/SyncSection.ts +14 -14
  156. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +96 -96
  157. package/front_end/panels/settings/settingsScreen.css +8 -3
  158. package/front_end/panels/sources/BreakpointEditDialog.ts +4 -3
  159. package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +2 -2
  160. package/front_end/panels/sources/NavigatorView.ts +4 -10
  161. package/front_end/panels/sources/ScopeChainSidebarPane.ts +2 -3
  162. package/front_end/panels/sources/SourceMapNamesResolver.ts +3 -3
  163. package/front_end/panels/sources/SourcesPanel.ts +1 -3
  164. package/front_end/panels/sources/SourcesView.ts +0 -3
  165. package/front_end/panels/sources/TabbedEditorContainer.ts +1 -4
  166. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +2 -5
  167. package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +0 -1
  168. package/front_end/panels/timeline/TimelineFlameChartView.ts +0 -1
  169. package/front_end/panels/timeline/TimelineLoader.ts +0 -3
  170. package/front_end/panels/timeline/TimelinePanel.ts +2 -3
  171. package/front_end/panels/timeline/TimelineUIUtils.ts +1 -1
  172. package/front_end/panels/timeline/components/WebVitalsLane.ts +77 -76
  173. package/front_end/panels/timeline/components/WebVitalsTimeline.ts +133 -133
  174. package/front_end/panels/timeline/components/WebVitalsTooltip.ts +9 -9
  175. package/front_end/panels/webauthn/WebauthnPane.ts +203 -205
  176. package/front_end/third_party/codemirror.next/bundle.ts +3 -3
  177. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  178. package/front_end/third_party/codemirror.next/chunk/markdown.js +2 -1
  179. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +10 -1
  180. package/front_end/third_party/codemirror.next/codemirror.next.js +2 -1
  181. package/front_end/third_party/codemirror.next/package.json +3 -3
  182. package/front_end/third_party/puppeteer/package/README.md +11 -11
  183. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api-docs-entry.d.ts +4 -5
  184. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js +2 -2
  185. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js.map +1 -1
  186. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.d.ts +4 -6
  187. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.d.ts +1 -2
  188. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.d.ts +1 -4
  189. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.d.ts +1 -4
  190. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts +9 -7
  191. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts.map +1 -1
  192. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js +21 -12
  193. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js.map +1 -1
  194. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Dialog.d.ts +1 -3
  195. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EvalTypes.d.ts +1 -2
  196. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.d.ts +3 -5
  197. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FileChooser.d.ts +1 -3
  198. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts +8 -10
  199. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js +3 -3
  200. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js.map +1 -1
  201. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.d.ts +50 -11
  202. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.d.ts.map +1 -1
  203. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.js +70 -33
  204. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.js.map +1 -1
  205. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.d.ts +12 -5
  206. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.d.ts.map +1 -1
  207. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.js +25 -5
  208. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.js.map +1 -1
  209. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.d.ts +2 -4
  210. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts +39 -6
  211. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts.map +1 -1
  212. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js +36 -0
  213. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js.map +1 -1
  214. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.d.ts +3 -4
  215. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.d.ts.map +1 -1
  216. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.js +2 -1
  217. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.js.map +1 -1
  218. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.d.ts +46 -0
  219. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.d.ts.map +1 -0
  220. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.js +124 -0
  221. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.js.map +1 -0
  222. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts +27 -10
  223. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts.map +1 -1
  224. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js +144 -74
  225. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js.map +1 -1
  226. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.d.ts +5 -6
  227. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/QueryHandler.d.ts +1 -2
  228. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.d.ts +4 -6
  229. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.d.ts +3 -5
  230. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.d.ts +4 -5
  231. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.d.ts.map +1 -1
  232. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.js +43 -17
  233. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.js.map +1 -1
  234. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts +1 -1
  235. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.d.ts +1 -3
  236. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.d.ts.map +1 -1
  237. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.js +101 -34
  238. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.js.map +1 -1
  239. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.d.ts +1 -3
  240. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.d.ts +1 -2
  241. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.d.ts +5 -7
  242. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +1 -1
  243. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api-docs-entry.d.ts +4 -5
  244. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js +2 -2
  245. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js.map +1 -1
  246. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts +4 -6
  247. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js +2 -3
  248. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts +1 -2
  249. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +3 -5
  250. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts +1 -4
  251. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts +1 -4
  252. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.js +1 -2
  253. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts +9 -7
  254. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts.map +1 -1
  255. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js +24 -17
  256. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js.map +1 -1
  257. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.d.ts +1 -3
  258. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.d.ts +1 -2
  259. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts +3 -5
  260. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.d.ts +1 -3
  261. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts +8 -10
  262. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js +7 -8
  263. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js.map +1 -1
  264. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts +50 -11
  265. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts.map +1 -1
  266. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js +70 -34
  267. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js.map +1 -1
  268. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts +12 -5
  269. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts.map +1 -1
  270. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js +26 -7
  271. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js.map +1 -1
  272. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts +2 -4
  273. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts +39 -6
  274. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -1
  275. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +38 -4
  276. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js.map +1 -1
  277. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts +3 -4
  278. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts.map +1 -1
  279. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js +4 -4
  280. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js.map +1 -1
  281. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.d.ts +46 -0
  282. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.d.ts.map +1 -0
  283. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.js +120 -0
  284. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.js.map +1 -0
  285. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts +27 -10
  286. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts.map +1 -1
  287. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js +144 -75
  288. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js.map +1 -1
  289. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js +12 -14
  290. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts +5 -6
  291. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.js +3 -4
  292. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts +1 -2
  293. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts +4 -6
  294. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts +3 -5
  295. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.js +1 -2
  296. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.js +3 -5
  297. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.js +1 -3
  298. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js +10 -12
  299. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts +4 -5
  300. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts.map +1 -1
  301. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js +43 -20
  302. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js.map +1 -1
  303. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts +1 -1
  304. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts +1 -3
  305. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts.map +1 -1
  306. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js +104 -40
  307. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js.map +1 -1
  308. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts +1 -3
  309. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.d.ts +1 -2
  310. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js +1 -2
  311. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts +5 -7
  312. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js +1 -3
  313. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/install.js +3 -5
  314. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node-puppeteer-core.js +1 -2
  315. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node.js +1 -2
  316. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +1 -1
  317. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/web.js +1 -2
  318. package/front_end/third_party/puppeteer/package/lib/types.d.ts +173 -36
  319. package/front_end/third_party/puppeteer/package/package.json +3 -3
  320. package/front_end/ui/components/adorners/Adorner.ts +2 -2
  321. package/front_end/ui/components/buttons/Button.ts +9 -9
  322. package/front_end/ui/components/data_grid/DataGrid.ts +62 -62
  323. package/front_end/ui/components/data_grid/DataGridController.ts +22 -22
  324. package/front_end/ui/components/diff_view/DiffView.ts +6 -6
  325. package/front_end/ui/components/expandable_list/ExpandableList.ts +5 -5
  326. package/front_end/ui/components/icon_button/Icon.ts +4 -4
  327. package/front_end/ui/components/icon_button/IconButton.ts +4 -4
  328. package/front_end/ui/components/issue_counter/IssueCounter.ts +3 -3
  329. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +11 -11
  330. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +50 -50
  331. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +6 -6
  332. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +4 -4
  333. package/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator.ts +12 -12
  334. package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +11 -11
  335. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +40 -39
  336. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +18 -18
  337. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings.ts +6 -6
  338. package/front_end/ui/components/linkifier/LinkifierImpl.ts +4 -4
  339. package/front_end/ui/components/markdown_view/MarkdownImage.ts +5 -5
  340. package/front_end/ui/components/markdown_view/MarkdownLink.ts +2 -2
  341. package/front_end/ui/components/markdown_view/MarkdownView.ts +4 -5
  342. package/front_end/ui/components/panel_feedback/FeedbackButton.ts +2 -2
  343. package/front_end/ui/components/panel_feedback/PanelFeedback.ts +2 -2
  344. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +4 -4
  345. package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +22 -22
  346. package/front_end/ui/components/report_view/ReportView.ts +16 -16
  347. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +14 -14
  348. package/front_end/ui/components/settings/SettingCheckbox.ts +5 -5
  349. package/front_end/ui/components/survey_link/SurveyLink.ts +8 -8
  350. package/front_end/ui/components/text_editor/TextEditor.ts +9 -9
  351. package/front_end/ui/components/text_editor/cursor_tooltip.ts +7 -1
  352. package/front_end/ui/components/text_prompt/TextPrompt.ts +18 -18
  353. package/front_end/ui/components/tree_outline/TreeOutline.ts +69 -70
  354. package/front_end/ui/legacy/ContextFlavorListener.ts +0 -4
  355. package/front_end/ui/legacy/ContextMenu.ts +2 -3
  356. package/front_end/ui/legacy/InspectorView.ts +1 -1
  357. package/front_end/ui/legacy/ReportView.ts +3 -4
  358. package/front_end/ui/legacy/SearchableView.ts +1 -2
  359. package/front_end/ui/legacy/SplitWidget.ts +2 -3
  360. package/front_end/ui/legacy/SuggestBox.ts +0 -3
  361. package/front_end/ui/legacy/TextPrompt.ts +1 -1
  362. package/front_end/ui/legacy/UIUtils.ts +1 -1
  363. package/front_end/ui/legacy/XLink.ts +1 -1
  364. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +2 -2
  365. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +9 -9
  366. package/front_end/ui/legacy/components/data_grid/dataGrid.css +7 -7
  367. package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +1 -1
  368. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +1 -5
  369. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +0 -1
  370. package/front_end/ui/legacy/components/utils/Linkifier.ts +2 -2
  371. package/front_end/ui/legacy/themeColors.css +2 -0
  372. package/front_end/ui/legacy/theme_support/theme_support_impl.ts +24 -1
  373. package/inspector_overlay/main.ts +16 -2
  374. package/package.json +1 -1
  375. package/scripts/eslint_rules/lib/use_private_class_members.js +41 -0
  376. package/scripts/eslint_rules/tests/use_private_class_members_test.js +62 -0
  377. package/scripts/migration/class-fields/migrate.js +2 -3
  378. package/scripts/migration/class-fields/migrate.sh +1 -3
  379. package/scripts/migration/class-fields/package.json +1 -1
@@ -81,7 +81,8 @@ class LifecycleWatcher {
81
81
  }
82
82
  this._checkLifecycleComplete();
83
83
  }
84
- navigationResponse() {
84
+ async navigationResponse() {
85
+ // We may need to wait for ExtraInfo events before the request is complete.
85
86
  return this._navigationRequest ? this._navigationRequest.response() : null;
86
87
  }
87
88
  _terminate(error) {
@@ -1 +1 @@
1
- {"version":3,"file":"LifecycleWatcher.js","sourceRoot":"","sources":["../../../../src/common/LifecycleWatcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2CAAqC;AACrC,2CAA6D;AAC7D,2CAA2C;AAC3C,uDAI2B;AAG3B,2DAAkE;AAClE,mDAA0D;AAmB1D,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAG1C;IACA,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IACxC,CAAC,cAAc,EAAE,aAAa,CAAC;IAC/B,CAAC,cAAc,EAAE,mBAAmB,CAAC;CACtC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAa,gBAAgB;IA0B3B,YACE,YAA0B,EAC1B,KAAY,EACZ,SAA8D,EAC9D,OAAe;QAEf,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;YAAE,SAAS,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC;aACvD,IAAI,OAAO,SAAS,KAAK,QAAQ;YAAE,SAAS,GAAG,CAAC,SAAS,CAAC,CAAC;QAChE,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YAChD,MAAM,aAAa,GAAG,4BAA4B,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAC9D,IAAA,kBAAM,EAAC,aAAa,EAAE,uCAAuC,GAAG,KA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AAO;QAClC,IAAI,CAAC,0BAA0B,GAAG,IAAI,CAAC;QACvC,IAAI,CAAC,uBAAuB,EAAE,CAAC;IACjC,CAAC;IAED,uBAAuB;QACrB,kCAAkC;QAClC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,CAAC;YAAE,OAAO;QAClE,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,IACE,IAAI,CAAC,MAAM,CAAC,SAAS,KAAK,IAAI,CAAC,gBAAgB;YAC/C,CAAC,IAAI,CAAC,0BAA0B;YAEhC,OAAO;QACT,IAAI,IAAI,CAAC,0BAA0B;YACjC,IAAI,CAAC,uCAAuC,EAAE,CAAC;QACjD,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,KAAK,IAAI,CAAC,gBAAgB;YACjD,IAAI,CAAC,sCAAsC,EAAE,CAAC;QAEhD;;;;WAIG;QACH,SAAS,cAAc,CACrB,KAAY,EACZ,iBAA2C;YAE3C,KAAK,MAAM,KAAK,IAAI,iBAAiB,EAAE;gBACrC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC;oBAAE,OAAO,KAAK,CAAC;aACtD;YACD,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE;gBACvC,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,iBAAiB,CAAC;oBAAE,OAAO,KAAK,CAAC;aAC7D;YACD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO;QACL,kBAAM,CAAC,oBAAoB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAClD,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACnC,CAAC;CACF;AA/LD,4CA+LC"}
@@ -0,0 +1,46 @@
1
+ import { Protocol } from 'devtools-protocol';
2
+ import { HTTPRequest } from './HTTPRequest.js';
3
+ export declare type QueuedEventGroup = {
4
+ responseReceivedEvent: Protocol.Network.ResponseReceivedEvent;
5
+ loadingFinishedEvent?: Protocol.Network.LoadingFinishedEvent;
6
+ loadingFailedEvent?: Protocol.Network.LoadingFailedEvent;
7
+ };
8
+ export declare type FetchRequestId = string;
9
+ export declare type NetworkRequestId = string;
10
+ declare type RedirectInfo = {
11
+ event: Protocol.Network.RequestWillBeSentEvent;
12
+ fetchRequestId?: FetchRequestId;
13
+ };
14
+ export declare type RedirectInfoList = RedirectInfo[];
15
+ /**
16
+ * @internal
17
+ *
18
+ * Helper class to track network events by request ID
19
+ */
20
+ export declare class NetworkEventManager {
21
+ private _requestWillBeSentMap;
22
+ private _requestPausedMap;
23
+ private _httpRequestsMap;
24
+ private _responseReceivedExtraInfoMap;
25
+ private _queuedRedirectInfoMap;
26
+ private _queuedEventGroupMap;
27
+ forget(networkRequestId: NetworkRequestId): void;
28
+ responseExtraInfo(networkRequestId: NetworkRequestId): Protocol.Network.ResponseReceivedExtraInfoEvent[];
29
+ private queuedRedirectInfo;
30
+ queueRedirectInfo(fetchRequestId: FetchRequestId, redirectInfo: RedirectInfo): void;
31
+ takeQueuedRedirectInfo(fetchRequestId: FetchRequestId): RedirectInfo | undefined;
32
+ numRequestsInProgress(): number;
33
+ storeRequestWillBeSent(networkRequestId: NetworkRequestId, event: Protocol.Network.RequestWillBeSentEvent): void;
34
+ getRequestWillBeSent(networkRequestId: NetworkRequestId): Protocol.Network.RequestWillBeSentEvent | undefined;
35
+ forgetRequestWillBeSent(networkRequestId: NetworkRequestId): void;
36
+ getRequestPaused(networkRequestId: NetworkRequestId): Protocol.Fetch.RequestPausedEvent | undefined;
37
+ forgetRequestPaused(networkRequestId: NetworkRequestId): void;
38
+ storeRequestPaused(networkRequestId: NetworkRequestId, event: Protocol.Fetch.RequestPausedEvent): void;
39
+ getRequest(networkRequestId: NetworkRequestId): HTTPRequest | undefined;
40
+ storeRequest(networkRequestId: NetworkRequestId, request: HTTPRequest): void;
41
+ forgetRequest(networkRequestId: NetworkRequestId): void;
42
+ getQueuedEventGroup(networkRequestId: NetworkRequestId): QueuedEventGroup | undefined;
43
+ queueEventGroup(networkRequestId: NetworkRequestId, event: QueuedEventGroup): void;
44
+ }
45
+ export {};
46
+ //# sourceMappingURL=NetworkEventManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NetworkEventManager.d.ts","sourceRoot":"","sources":["../../../../src/common/NetworkEventManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,oBAAY,gBAAgB,GAAG;IAC7B,qBAAqB,EAAE,QAAQ,CAAC,OAAO,CAAC,qBAAqB,CAAC;IAC9D,oBAAoB,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC7D,kBAAkB,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC;CAC1D,CAAC;AAEF,oBAAY,cAAc,GAAG,MAAM,CAAC;AACpC,oBAAY,gBAAgB,GAAG,MAAM,CAAC;AAEtC,aAAK,YAAY,GAAG;IAClB,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,sBAAsB,CAAC;IAC/C,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AACF,oBAAY,gBAAgB,GAAG,YAAY,EAAE,CAAC;AAE9C;;;;GAIG;AACH,qBAAa,mBAAmB;IAiC9B,OAAO,CAAC,qBAAqB,CAGzB;IACJ,OAAO,CAAC,iBAAiB,CAGrB;IACJ,OAAO,CAAC,gBAAgB,CAA4C;IAWpE,OAAO,CAAC,6BAA6B,CAGjC;IACJ,OAAO,CAAC,sBAAsB,CAG1B;IACJ,OAAO,CAAC,oBAAoB,CAAiD;IAE7E,MAAM,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI;IAQhD,iBAAiB,CACf,gBAAgB,EAAE,gBAAgB,GACjC,QAAQ,CAAC,OAAO,CAAC,8BAA8B,EAAE;IAOpD,OAAO,CAAC,kBAAkB;IAO1B,iBAAiB,CACf,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY,GACzB,IAAI;IAIP,sBAAsB,CACpB,cAAc,EAAE,cAAc,GAC7B,YAAY,GAAG,SAAS;IAI3B,qBAAqB,IAAI,MAAM;IAM/B,sBAAsB,CACpB,gBAAgB,EAAE,gBAAgB,EAClC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,sBAAsB,GAC7C,IAAI;IAIP,oBAAoB,CAClB,gBAAgB,EAAE,gBAAgB,GACjC,QAAQ,CAAC,OAAO,CAAC,sBAAsB,GAAG,SAAS;IAItD,uBAAuB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI;IAIjE,gBAAgB,CACd,gBAAgB,EAAE,gBAAgB,GACjC,QAAQ,CAAC,KAAK,CAAC,kBAAkB,GAAG,SAAS;IAIhD,mBAAmB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI;IAI7D,kBAAkB,CAChB,gBAAgB,EAAE,gBAAgB,EAClC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,kBAAkB,GACvC,IAAI;IAIP,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,WAAW,GAAG,SAAS;IAIvE,YAAY,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI;IAI5E,aAAa,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI;IAIvD,mBAAmB,CACjB,gBAAgB,EAAE,gBAAgB,GACjC,gBAAgB,GAAG,SAAS;IAI/B,eAAe,CACb,gBAAgB,EAAE,gBAAgB,EAClC,KAAK,EAAE,gBAAgB,GACtB,IAAI;CAGR"}
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NetworkEventManager = void 0;
4
+ /**
5
+ * @internal
6
+ *
7
+ * Helper class to track network events by request ID
8
+ */
9
+ class NetworkEventManager {
10
+ constructor() {
11
+ /*
12
+ * There are four possible orders of events:
13
+ * A. `_onRequestWillBeSent`
14
+ * B. `_onRequestWillBeSent`, `_onRequestPaused`
15
+ * C. `_onRequestPaused`, `_onRequestWillBeSent`
16
+ * D. `_onRequestPaused`, `_onRequestWillBeSent`, `_onRequestPaused`,
17
+ * `_onRequestWillBeSent`, `_onRequestPaused`, `_onRequestPaused`
18
+ * (see crbug.com/1196004)
19
+ *
20
+ * For `_onRequest` we need the event from `_onRequestWillBeSent` and
21
+ * optionally the `interceptionId` from `_onRequestPaused`.
22
+ *
23
+ * If request interception is disabled, call `_onRequest` once per call to
24
+ * `_onRequestWillBeSent`.
25
+ * If request interception is enabled, call `_onRequest` once per call to
26
+ * `_onRequestPaused` (once per `interceptionId`).
27
+ *
28
+ * Events are stored to allow for subsequent events to call `_onRequest`.
29
+ *
30
+ * Note that (chains of) redirect requests have the same `requestId` (!) as
31
+ * the original request. We have to anticipate series of events like these:
32
+ * A. `_onRequestWillBeSent`,
33
+ * `_onRequestWillBeSent`, ...
34
+ * B. `_onRequestWillBeSent`, `_onRequestPaused`,
35
+ * `_onRequestWillBeSent`, `_onRequestPaused`, ...
36
+ * C. `_onRequestWillBeSent`, `_onRequestPaused`,
37
+ * `_onRequestPaused`, `_onRequestWillBeSent`, ...
38
+ * D. `_onRequestPaused`, `_onRequestWillBeSent`,
39
+ * `_onRequestPaused`, `_onRequestWillBeSent`, `_onRequestPaused`,
40
+ * `_onRequestWillBeSent`, `_onRequestPaused`, `_onRequestPaused`, ...
41
+ * (see crbug.com/1196004)
42
+ */
43
+ this._requestWillBeSentMap = new Map();
44
+ this._requestPausedMap = new Map();
45
+ this._httpRequestsMap = new Map();
46
+ /*
47
+ * The below maps are used to reconcile Network.responseReceivedExtraInfo
48
+ * events with their corresponding request. Each response and redirect
49
+ * response gets an ExtraInfo event, and we don't know which will come first.
50
+ * This means that we have to store a Response or an ExtraInfo for each
51
+ * response, and emit the event when we get both of them. In addition, to
52
+ * handle redirects, we have to make them Arrays to represent the chain of
53
+ * events.
54
+ */
55
+ this._responseReceivedExtraInfoMap = new Map();
56
+ this._queuedRedirectInfoMap = new Map();
57
+ this._queuedEventGroupMap = new Map();
58
+ }
59
+ forget(networkRequestId) {
60
+ this._requestWillBeSentMap.delete(networkRequestId);
61
+ this._requestPausedMap.delete(networkRequestId);
62
+ this._queuedEventGroupMap.delete(networkRequestId);
63
+ this._queuedRedirectInfoMap.delete(networkRequestId);
64
+ this._responseReceivedExtraInfoMap.delete(networkRequestId);
65
+ }
66
+ responseExtraInfo(networkRequestId) {
67
+ if (!this._responseReceivedExtraInfoMap.has(networkRequestId)) {
68
+ this._responseReceivedExtraInfoMap.set(networkRequestId, []);
69
+ }
70
+ return this._responseReceivedExtraInfoMap.get(networkRequestId);
71
+ }
72
+ queuedRedirectInfo(fetchRequestId) {
73
+ if (!this._queuedRedirectInfoMap.has(fetchRequestId)) {
74
+ this._queuedRedirectInfoMap.set(fetchRequestId, []);
75
+ }
76
+ return this._queuedRedirectInfoMap.get(fetchRequestId);
77
+ }
78
+ queueRedirectInfo(fetchRequestId, redirectInfo) {
79
+ this.queuedRedirectInfo(fetchRequestId).push(redirectInfo);
80
+ }
81
+ takeQueuedRedirectInfo(fetchRequestId) {
82
+ return this.queuedRedirectInfo(fetchRequestId).shift();
83
+ }
84
+ numRequestsInProgress() {
85
+ return [...this._httpRequestsMap].filter(([, request]) => {
86
+ return !request.response();
87
+ }).length;
88
+ }
89
+ storeRequestWillBeSent(networkRequestId, event) {
90
+ this._requestWillBeSentMap.set(networkRequestId, event);
91
+ }
92
+ getRequestWillBeSent(networkRequestId) {
93
+ return this._requestWillBeSentMap.get(networkRequestId);
94
+ }
95
+ forgetRequestWillBeSent(networkRequestId) {
96
+ this._requestPausedMap.delete(networkRequestId);
97
+ }
98
+ getRequestPaused(networkRequestId) {
99
+ return this._requestPausedMap.get(networkRequestId);
100
+ }
101
+ forgetRequestPaused(networkRequestId) {
102
+ this._requestPausedMap.delete(networkRequestId);
103
+ }
104
+ storeRequestPaused(networkRequestId, event) {
105
+ this._requestPausedMap.set(networkRequestId, event);
106
+ }
107
+ getRequest(networkRequestId) {
108
+ return this._httpRequestsMap.get(networkRequestId);
109
+ }
110
+ storeRequest(networkRequestId, request) {
111
+ this._httpRequestsMap.set(networkRequestId, request);
112
+ }
113
+ forgetRequest(networkRequestId) {
114
+ this._httpRequestsMap.delete(networkRequestId);
115
+ }
116
+ getQueuedEventGroup(networkRequestId) {
117
+ return this._queuedEventGroupMap.get(networkRequestId);
118
+ }
119
+ queueEventGroup(networkRequestId, event) {
120
+ this._queuedEventGroupMap.set(networkRequestId, event);
121
+ }
122
+ }
123
+ exports.NetworkEventManager = NetworkEventManager;
124
+ //# sourceMappingURL=NetworkEventManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NetworkEventManager.js","sourceRoot":"","sources":["../../../../src/common/NetworkEventManager.ts"],"names":[],"mappings":";;;AAkBA;;;;GAIG;AACH,MAAa,mBAAmB;IAAhC;QACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA+BG;QACK,0BAAqB,GAAG,IAAI,GAAG,EAGpC,CAAC;QACI,sBAAiB,GAAG,IAAI,GAAG,EAGhC,CAAC;QACI,qBAAgB,GAAG,IAAI,GAAG,EAAiC,CAAC;QAEpE;;;;;;;;WAQG;QACK,kCAA6B,GAAG,IAAI,GAAG,EAG5C,CAAC;QACI,2BAAsB,GAAG,IAAI,GAAG,EAGrC,CAAC;QACI,yBAAoB,GAAG,IAAI,GAAG,EAAsC,CAAC;IAuG/E,CAAC;IArGC,MAAM,CAAC,gBAAkC;QACvC,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;QACpD,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;QAChD,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;QACnD,IAAI,CAAC,sB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and
14
14
  * limitations under the License.
15
15
  */
16
- import { Protocol } from 'devtools-protocol';
17
-
18
- import { CDPSession } from './Connection.js';
16
+ import { ProtocolMapping } from 'devtools-protocol/types/protocol-mapping.js';
19
17
  import { EventEmitter } from './EventEmitter.js';
20
- import { FrameManager } from './FrameManager.js';
18
+ import { Frame } from './FrameManager.js';
19
+ import { Protocol } from 'devtools-protocol';
21
20
  import { HTTPRequest } from './HTTPRequest.js';
22
-
21
+ import { FetchRequestId, NetworkEventManager } from './NetworkEventManager.js';
23
22
  /**
24
23
  * @public
25
24
  */
@@ -54,6 +53,12 @@ export declare const NetworkManagerEmittedEvents: {
54
53
  readonly RequestFailed: symbol;
55
54
  readonly RequestFinished: symbol;
56
55
  };
56
+ interface CDPSession extends EventEmitter {
57
+ send<T extends keyof ProtocolMapping.Commands>(method: T, ...paramArgs: ProtocolMapping.Commands[T]['paramsType']): Promise<ProtocolMapping.Commands[T]['returnType']>;
58
+ }
59
+ interface FrameManager {
60
+ frame(frameId: string): Frame | null;
61
+ }
57
62
  /**
58
63
  * @internal
59
64
  */
@@ -61,9 +66,7 @@ export declare class NetworkManager extends EventEmitter {
61
66
  _client: CDPSession;
62
67
  _ignoreHTTPSErrors: boolean;
63
68
  _frameManager: FrameManager;
64
- _requestIdToRequestWillBeSentEvent: Map<string, Protocol.Network.RequestWillBeSentEvent>;
65
- _requestIdToRequestPausedEvent: Map<string, Protocol.Fetch.RequestPausedEvent>;
66
- _requestIdToRequest: Map<string, HTTPRequest>;
69
+ _networkEventManager: NetworkEventManager;
67
70
  _extraHTTPHeaders: Record<string, string>;
68
71
  _credentials?: Credentials;
69
72
  _attemptedAuthentications: Set<string>;
@@ -88,13 +91,27 @@ export declare class NetworkManager extends EventEmitter {
88
91
  _updateProtocolCacheDisabled(): Promise<void>;
89
92
  _onRequestWillBeSent(event: Protocol.Network.RequestWillBeSentEvent): void;
90
93
  _onAuthRequired(event: Protocol.Fetch.AuthRequiredEvent): void;
94
+ /**
95
+ * CDP may send a Fetch.requestPaused without or before a
96
+ * Network.requestWillBeSent
97
+ *
98
+ * CDP may send multiple Fetch.requestPaused
99
+ * for the same Network.requestWillBeSent.
100
+ *
101
+ *
102
+ */
91
103
  _onRequestPaused(event: Protocol.Fetch.RequestPausedEvent): void;
92
- _onRequest(event: Protocol.Network.RequestWillBeSentEvent, interceptionId?: string): void;
104
+ _onRequest(event: Protocol.Network.RequestWillBeSentEvent, fetchRequestId?: FetchRequestId): void;
93
105
  _onRequestServedFromCache(event: Protocol.Network.RequestServedFromCacheEvent): void;
94
- _handleRequestRedirect(request: HTTPRequest, responsePayload: Protocol.Network.Response): void;
106
+ _handleRequestRedirect(request: HTTPRequest, responsePayload: Protocol.Network.Response, extraInfo: Protocol.Network.ResponseReceivedExtraInfoEvent): void;
107
+ _emitResponseEvent(responseReceived: Protocol.Network.ResponseReceivedEvent, extraInfo: Protocol.Network.ResponseReceivedExtraInfoEvent | null): void;
95
108
  _onResponseReceived(event: Protocol.Network.ResponseReceivedEvent): void;
109
+ _onResponseReceivedExtraInfo(event: Protocol.Network.ResponseReceivedExtraInfoEvent): void;
96
110
  _forgetRequest(request: HTTPRequest, events: boolean): void;
97
111
  _onLoadingFinished(event: Protocol.Network.LoadingFinishedEvent): void;
112
+ _emitLoadingFinished(event: Protocol.Network.LoadingFinishedEvent): void;
98
113
  _onLoadingFailed(event: Protocol.Network.LoadingFailedEvent): void;
114
+ _emitLoadingFailed(event: Protocol.Network.LoadingFailedEvent): void;
99
115
  }
116
+ export {};
100
117
  //# sourceMappingURL=NetworkManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkManager.d.ts","sourceRoot":"","sources":["../../../../src/common/NetworkManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM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QAAQ,CAAC,OAAO,CAAC,8BAA8B,GACrD,IAAI;IAiCP,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAY3D,kBAAkB,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,oBAAoB,GAAG,IAAI;IAatE,oBAAoB,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,oBAAoB,GAAG,IAAI;IAaxE,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,kBAAkB,GAAG,IAAI;IAalE,kBAAkB,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,kBAAkB,GAAG,IAAI;CAWrE"}
@@ -1,6 +1,4 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NetworkManager = exports.NetworkManagerEmittedEvents = void 0;
4
2
  /**
5
3
  * Copyright 2017 Google Inc. All rights reserved.
6
4
  *
@@ -16,11 +14,14 @@ exports.NetworkManager = exports.NetworkManagerEmittedEvents = void 0;
16
14
  * See the License for the specific language governing permissions and
17
15
  * limitations under the License.
18
16
  */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.NetworkManager = exports.NetworkManagerEmittedEvents = void 0;
19
19
  const EventEmitter_js_1 = require("./EventEmitter.js");
20
20
  const assert_js_1 = require("./assert.js");
21
21
  const helper_js_1 = require("./helper.js");
22
22
  const HTTPRequest_js_1 = require("./HTTPRequest.js");
23
23
  const HTTPResponse_js_1 = require("./HTTPResponse.js");
24
+ const NetworkEventManager_js_1 = require("./NetworkEventManager.js");
24
25
  /**
25
26
  * We use symbols to prevent any external parties listening to these events.
26
27
  * They are internal to Puppeteer.
@@ -40,39 +41,7 @@ exports.NetworkManagerEmittedEvents = {
40
41
  class NetworkManager extends EventEmitter_js_1.EventEmitter {
41
42
  constructor(client, ignoreHTTPSErrors, frameManager) {
42
43
  super();
43
- /*
44
- * There are four possible orders of events:
45
- * A. `_onRequestWillBeSent`
46
- * B. `_onRequestWillBeSent`, `_onRequestPaused`
47
- * C. `_onRequestPaused`, `_onRequestWillBeSent`
48
- * D. `_onRequestPaused`, `_onRequestWillBeSent`, `_onRequestPaused`
49
- * (see crbug.com/1196004)
50
- *
51
- * For `_onRequest` we need the event from `_onRequestWillBeSent` and
52
- * optionally the `interceptionId` from `_onRequestPaused`.
53
- *
54
- * If request interception is disabled, call `_onRequest` once per call to
55
- * `_onRequestWillBeSent`.
56
- * If request interception is enabled, call `_onRequest` once per call to
57
- * `_onRequestPaused` (once per `interceptionId`).
58
- *
59
- * Events are stored to allow for subsequent events to call `_onRequest`.
60
- *
61
- * Note that (chains of) redirect requests have the same `requestId` (!) as
62
- * the original request. We have to anticipate series of events like these:
63
- * A. `_onRequestWillBeSent`,
64
- * `_onRequestWillBeSent`, ...
65
- * B. `_onRequestWillBeSent`, `_onRequestPaused`,
66
- * `_onRequestWillBeSent`, `_onRequestPaused`, ...
67
- * C. `_onRequestWillBeSent`, `_onRequestPaused`,
68
- * `_onRequestPaused`, `_onRequestWillBeSent`, ...
69
- * D. `_onRequestPaused`, `_onRequestWillBeSent`,
70
- * `_onRequestPaused`, `_onRequestWillBeSent`, `_onRequestPaused`, ...
71
- * (see crbug.com/1196004)
72
- */
73
- this._requestIdToRequestWillBeSentEvent = new Map();
74
- this._requestIdToRequestPausedEvent = new Map();
75
- this._requestIdToRequest = new Map();
44
+ this._networkEventManager = new NetworkEventManager_js_1.NetworkEventManager();
76
45
  this._extraHTTPHeaders = {};
77
46
  this._credentials = null;
78
47
  this._attemptedAuthentications = new Set();
@@ -95,6 +64,7 @@ class NetworkManager extends EventEmitter_js_1.EventEmitter {
95
64
  this._client.on('Network.responseReceived', this._onResponseReceived.bind(this));
96
65
  this._client.on('Network.loadingFinished', this._onLoadingFinished.bind(this));
97
66
  this._client.on('Network.loadingFailed', this._onLoadingFailed.bind(this));
67
+ this._client.on('Network.responseReceivedExtraInfo', this._onResponseReceivedExtraInfo.bind(this));
98
68
  }
99
69
  async initialize() {
100
70
  await this._client.send('Network.enable');
@@ -122,9 +92,7 @@ class NetworkManager extends EventEmitter_js_1.EventEmitter {
122
92
  return Object.assign({}, this._extraHTTPHeaders);
123
93
  }
124
94
  numRequestsInProgress() {
125
- return [...this._requestIdToRequest].filter(([, request]) => {
126
- return !request.response();
127
- }).length;
95
+ return this._networkEventManager.numRequestsInProgress();
128
96
  }
129
97
  async setOfflineMode(value) {
130
98
  this._emulatedNetworkConditions.offline = value;
@@ -197,13 +165,16 @@ class NetworkManager extends EventEmitter_js_1.EventEmitter {
197
165
  // Request interception doesn't happen for data URLs with Network Service.
198
166
  if (this._userRequestInterceptionEnabled &&
199
167
  !event.request.url.startsWith('data:')) {
200
- const requestId = event.requestId;
201
- const requestPausedEvent = this._requestIdToRequestPausedEvent.get(requestId);
202
- this._requestIdToRequestWillBeSentEvent.set(requestId, event);
168
+ const { requestId: networkRequestId } = event;
169
+ this._networkEventManager.storeRequestWillBeSent(networkRequestId, event);
170
+ /**
171
+ * CDP may have sent a Fetch.requestPaused event already. Check for it.
172
+ */
173
+ const requestPausedEvent = this._networkEventManager.getRequestPaused(networkRequestId);
203
174
  if (requestPausedEvent) {
204
- const interceptionId = requestPausedEvent.requestId;
205
- this._onRequest(event, interceptionId);
206
- this._requestIdToRequestPausedEvent.delete(requestId);
175
+ const { requestId: fetchRequestId } = requestPausedEvent;
176
+ this._onRequest(event, fetchRequestId);
177
+ this._networkEventManager.forgetRequestPaused(networkRequestId);
207
178
  }
208
179
  return;
209
180
  }
@@ -229,6 +200,15 @@ class NetworkManager extends EventEmitter_js_1.EventEmitter {
229
200
  })
230
201
  .catch(helper_js_1.debugError);
231
202
  }
203
+ /**
204
+ * CDP may send a Fetch.requestPaused without or before a
205
+ * Network.requestWillBeSent
206
+ *
207
+ * CDP may send multiple Fetch.requestPaused
208
+ * for the same Network.requestWillBeSent.
209
+ *
210
+ *
211
+ */
232
212
  _onRequestPaused(event) {
233
213
  if (!this._userRequestInterceptionEnabled &&
234
214
  this._protocolRequestInterceptionEnabled) {
@@ -238,54 +218,75 @@ class NetworkManager extends EventEmitter_js_1.EventEmitter {
238
218
  })
239
219
  .catch(helper_js_1.debugError);
240
220
  }
241
- const requestId = event.networkId;
242
- const interceptionId = event.requestId;
243
- if (!requestId) {
221
+ const { networkId: networkRequestId, requestId: fetchRequestId } = event;
222
+ if (!networkRequestId) {
244
223
  return;
245
224
  }
246
- let requestWillBeSentEvent = this._requestIdToRequestWillBeSentEvent.get(requestId);
247
- // redirect requests have the same `requestId`,
248
- if (requestWillBeSentEvent &&
249
- (requestWillBeSentEvent.request.url !== event.request.url ||
250
- requestWillBeSentEvent.request.method !== event.request.method)) {
251
- this._requestIdToRequestWillBeSentEvent.delete(requestId);
252
- requestWillBeSentEvent = null;
253
- }
225
+ const requestWillBeSentEvent = (() => {
226
+ const requestWillBeSentEvent = this._networkEventManager.getRequestWillBeSent(networkRequestId);
227
+ // redirect requests have the same `requestId`,
228
+ if (requestWillBeSentEvent &&
229
+ (requestWillBeSentEvent.request.url !== event.request.url ||
230
+ requestWillBeSentEvent.request.method !== event.request.method)) {
231
+ this._networkEventManager.forgetRequestWillBeSent(networkRequestId);
232
+ return;
233
+ }
234
+ return requestWillBeSentEvent;
235
+ })();
254
236
  if (requestWillBeSentEvent) {
255
- this._onRequest(requestWillBeSentEvent, interceptionId);
256
- this._requestIdToRequestWillBeSentEvent.delete(requestId);
237
+ this._onRequest(requestWillBeSentEvent, fetchRequestId);
257
238
  }
258
239
  else {
259
- this._requestIdToRequestPausedEvent.set(requestId, event);
240
+ this._networkEventManager.storeRequestPaused(networkRequestId, event);
260
241
  }
261
242
  }
262
- _onRequest(event, interceptionId) {
243
+ _onRequest(event, fetchRequestId) {
263
244
  let redirectChain = [];
264
245
  if (event.redirectResponse) {
265
- const request = this._requestIdToRequest.get(event.requestId);
246
+ // We want to emit a response and requestfinished for the
247
+ // redirectResponse, but we can't do so unless we have a
248
+ // responseExtraInfo ready to pair it up with. If we don't have any
249
+ // responseExtraInfos saved in our queue, they we have to wait until
250
+ // the next one to emit response and requestfinished, *and* we should
251
+ // also wait to emit this Request too because it should come after the
252
+ // response/requestfinished.
253
+ let redirectResponseExtraInfo = null;
254
+ if (event.redirectHasExtraInfo) {
255
+ redirectResponseExtraInfo = this._networkEventManager
256
+ .responseExtraInfo(event.requestId)
257
+ .shift();
258
+ if (!redirectResponseExtraInfo) {
259
+ this._networkEventManager.queueRedirectInfo(event.requestId, {
260
+ event,
261
+ fetchRequestId,
262
+ });
263
+ return;
264
+ }
265
+ }
266
+ const request = this._networkEventManager.getRequest(event.requestId);
266
267
  // If we connect late to the target, we could have missed the
267
268
  // requestWillBeSent event.
268
269
  if (request) {
269
- this._handleRequestRedirect(request, event.redirectResponse);
270
+ this._handleRequestRedirect(request, event.redirectResponse, redirectResponseExtraInfo);
270
271
  redirectChain = request._redirectChain;
271
272
  }
272
273
  }
273
274
  const frame = event.frameId
274
275
  ? this._frameManager.frame(event.frameId)
275
276
  : null;
276
- const request = new HTTPRequest_js_1.HTTPRequest(this._client, frame, interceptionId, this._userRequestInterceptionEnabled, event, redirectChain);
277
- this._requestIdToRequest.set(event.requestId, request);
277
+ const request = new HTTPRequest_js_1.HTTPRequest(this._client, frame, fetchRequestId, this._userRequestInterceptionEnabled, event, redirectChain);
278
+ this._networkEventManager.storeRequest(event.requestId, request);
278
279
  this.emit(exports.NetworkManagerEmittedEvents.Request, request);
279
280
  request.finalizeInterceptions();
280
281
  }
281
282
  _onRequestServedFromCache(event) {
282
- const request = this._requestIdToRequest.get(event.requestId);
283
+ const request = this._networkEventManager.getRequest(event.requestId);
283
284
  if (request)
284
285
  request._fromMemoryCache = true;
285
286
  this.emit(exports.NetworkManagerEmittedEvents.RequestServedFromCache, request);
286
287
  }
287
- _handleRequestRedirect(request, responsePayload) {
288
- const response = new HTTPResponse_js_1.HTTPResponse(this._client, request, responsePayload);
288
+ _handleRequestRedirect(request, responsePayload, extraInfo) {
289
+ const response = new HTTPResponse_js_1.HTTPResponse(this._client, request, responsePayload, extraInfo);
289
290
  request._response = response;
290
291
  request._redirectChain.push(request);
291
292
  response._resolveBody(new Error('Response body is unavailable for redirect responses'));
@@ -293,27 +294,85 @@ class NetworkManager extends EventEmitter_js_1.EventEmitter {
293
294
  this.emit(exports.NetworkManagerEmittedEvents.Response, response);
294
295
  this.emit(exports.NetworkManagerEmittedEvents.RequestFinished, request);
295
296
  }
296
- _onResponseReceived(event) {
297
- const request = this._requestIdToRequest.get(event.requestId);
297
+ _emitResponseEvent(responseReceived, extraInfo) {
298
+ const request = this._networkEventManager.getRequest(responseReceived.requestId);
298
299
  // FileUpload sends a response without a matching request.
299
300
  if (!request)
300
301
  return;
301
- const response = new HTTPResponse_js_1.HTTPResponse(this._client, request, event.response);
302
+ const extraInfos = this._networkEventManager.responseExtraInfo(responseReceived.requestId);
303
+ if (extraInfos.length) {
304
+ (0, helper_js_1.debugError)(new Error('Unexpected extraInfo events for request ' +
305
+ responseReceived.requestId));
306
+ }
307
+ const response = new HTTPResponse_js_1.HTTPResponse(this._client, request, responseReceived.response, extraInfo);
302
308
  request._response = response;
303
309
  this.emit(exports.NetworkManagerEmittedEvents.Response, response);
304
310
  }
311
+ _onResponseReceived(event) {
312
+ const request = this._networkEventManager.getRequest(event.requestId);
313
+ let extraInfo = null;
314
+ if (request && !request._fromMemoryCache && event.hasExtraInfo) {
315
+ extraInfo = this._networkEventManager
316
+ .responseExtraInfo(event.requestId)
317
+ .shift();
318
+ if (!extraInfo) {
319
+ // Wait until we get the corresponding ExtraInfo event.
320
+ this._networkEventManager.queueEventGroup(event.requestId, {
321
+ responseReceivedEvent: event,
322
+ });
323
+ return;
324
+ }
325
+ }
326
+ this._emitResponseEvent(event, extraInfo);
327
+ }
328
+ _onResponseReceivedExtraInfo(event) {
329
+ // We may have skipped a redirect response/request pair due to waiting for
330
+ // this ExtraInfo event. If so, continue that work now that we have the
331
+ // request.
332
+ const redirectInfo = this._networkEventManager.takeQueuedRedirectInfo(event.requestId);
333
+ if (redirectInfo) {
334
+ this._networkEventManager.responseExtraInfo(event.requestId).push(event);
335
+ this._onRequest(redirectInfo.event, redirectInfo.fetchRequestId);
336
+ return;
337
+ }
338
+ // We may have skipped response and loading events because we didn't have
339
+ // this ExtraInfo event yet. If so, emit those events now.
340
+ const queuedEvents = this._networkEventManager.getQueuedEventGroup(event.requestId);
341
+ if (queuedEvents) {
342
+ this._emitResponseEvent(queuedEvents.responseReceivedEvent, event);
343
+ if (queuedEvents.loadingFinishedEvent) {
344
+ this._emitLoadingFinished(queuedEvents.loadingFinishedEvent);
345
+ }
346
+ if (queuedEvents.loadingFailedEvent) {
347
+ this._emitLoadingFailed(queuedEvents.loadingFailedEvent);
348
+ }
349
+ return;
350
+ }
351
+ // Wait until we get another event that can use this ExtraInfo event.
352
+ this._networkEventManager.responseExtraInfo(event.requestId).push(event);
353
+ }
305
354
  _forgetRequest(request, events) {
306
355
  const requestId = request._requestId;
307
356
  const interceptionId = request._interceptionId;
308
- this._requestIdToRequest.delete(requestId);
357
+ this._networkEventManager.forgetRequest(requestId);
309
358
  this._attemptedAuthentications.delete(interceptionId);
310
359
  if (events) {
311
- this._requestIdToRequestWillBeSentEvent.delete(requestId);
312
- this._requestIdToRequestPausedEvent.delete(requestId);
360
+ this._networkEventManager.forget(requestId);
313
361
  }
314
362
  }
315
363
  _onLoadingFinished(event) {
316
- const request = this._requestIdToRequest.get(event.requestId);
364
+ // If the response event for this request is still waiting on a
365
+ // corresponding ExtraInfo event, then wait to emit this event too.
366
+ const queuedEvents = this._networkEventManager.getQueuedEventGroup(event.requestId);
367
+ if (queuedEvents) {
368
+ queuedEvents.loadingFinishedEvent = event;
369
+ }
370
+ else {
371
+ this._emitLoadingFinished(event);
372
+ }
373
+ }
374
+ _emitLoadingFinished(event) {
375
+ const request = this._networkEventManager.getRequest(event.requestId);
317
376
  // For certain requestIds we never receive requestWillBeSent event.
318
377
  // @see https://crbug.com/750469
319
378
  if (!request)
@@ -326,7 +385,18 @@ class NetworkManager extends EventEmitter_js_1.EventEmitter {
326
385
  this.emit(exports.NetworkManagerEmittedEvents.RequestFinished, request);
327
386
  }
328
387
  _onLoadingFailed(event) {
329
- const request = this._requestIdToRequest.get(event.requestId);
388
+ // If the response event for this request is still waiting on a
389
+ // corresponding ExtraInfo event, then wait to emit this event too.
390
+ const queuedEvents = this._networkEventManager.getQueuedEventGroup(event.requestId);
391
+ if (queuedEvents) {
392
+ queuedEvents.loadingFailedEvent = event;
393
+ }
394
+ else {
395
+ this._emitLoadingFailed(event);
396
+ }
397
+ }
398
+ _emitLoadingFailed(event) {
399
+ const request = this._networkEventManager.getRequest(event.requestId);
330
400
  // For certain requestIds we never receive requestWillBeSent event.
331
401
  // @see https://crbug.com/750469
332
402
  if (!request)