@paulirish/trace_engine 0.0.66 → 0.0.67-beta.1

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 (788) hide show
  1. package/README.md +62 -22
  2. package/analyze-trace.mjs +6 -144
  3. package/core/common/Base64.d.ts +12 -0
  4. package/core/common/CharacterIdMap.d.ts +5 -0
  5. package/core/common/Color.d.ts +357 -0
  6. package/core/common/ColorConverter.d.ts +26 -0
  7. package/core/common/ColorUtils.d.ts +45 -0
  8. package/core/common/Console.d.ts +54 -0
  9. package/core/common/Debouncer.d.ts +8 -0
  10. package/core/common/EventTarget.d.ts +22 -0
  11. package/core/common/Gzip.d.ts +23 -0
  12. package/core/common/JavaScriptMetaData.d.ts +20 -0
  13. package/core/common/Lazy.d.ts +4 -0
  14. package/core/common/MapWithDefault.d.ts +9 -0
  15. package/core/common/Mutex.d.ts +13 -0
  16. package/core/common/Object.d.ts +20 -0
  17. package/core/common/ParsedURL.d.ts +87 -0
  18. package/core/common/Progress.d.ts +47 -0
  19. package/core/common/ResolverBase.d.ts +29 -0
  20. package/core/common/ResourceType.d.ts +52 -0
  21. package/core/common/ReturnToPanel.d.ts +10 -0
  22. package/core/common/Revealer.d.ts +66 -0
  23. package/core/common/Runnable.d.ts +14 -0
  24. package/core/common/SegmentedRange.d.ts +14 -0
  25. package/core/common/SettingRegistration.d.ts +136 -0
  26. package/core/common/Settings.d.ts +226 -0
  27. package/core/common/SimpleHistoryManager.d.ts +20 -0
  28. package/core/common/Srcset.d.ts +16 -0
  29. package/core/common/StringOutputStream.d.ts +10 -0
  30. package/core/common/TextDictionary.d.ts +11 -0
  31. package/core/common/Throttler.d.ts +12 -0
  32. package/core/common/Trie.d.ts +24 -0
  33. package/core/common/VersionController.d.ts +85 -0
  34. package/core/common/common.d.ts +33 -1
  35. package/core/host/AidaClient.d.ts +73 -0
  36. package/core/host/AidaClientTypes.d.ts +355 -0
  37. package/core/host/AidaGcaTranslation.d.ts +10 -0
  38. package/core/host/DispatchHttpRequestClient.d.ts +14 -0
  39. package/core/host/GcaClient.d.ts +14 -0
  40. package/core/host/GcaTypes.d.ts +411 -0
  41. package/core/host/GdpClient.d.ts +84 -0
  42. package/core/host/InspectorFrontendHost.d.ts +29 -0
  43. package/core/host/InspectorFrontendHostAPI.d.ts +425 -0
  44. package/core/host/InspectorFrontendHostStub.d.ts +151 -0
  45. package/core/host/Platform.d.ts +11 -0
  46. package/core/host/ResourceLoader.d.ts +15 -0
  47. package/core/host/UserMetrics.d.ts +116 -0
  48. package/core/host/UserMetricsEnums.d.ts +883 -0
  49. package/core/host/host.d.ts +13 -1
  50. package/core/i18n/ByteUtilities.d.ts +11 -0
  51. package/core/i18n/DevToolsLocale.d.ts +41 -0
  52. package/core/i18n/NumberFormatter.d.ts +11 -0
  53. package/core/i18n/i18n.d.ts +10 -0
  54. package/core/i18n/i18nImpl.d.ts +64 -0
  55. package/core/i18n/i18nTypes.d.ts +5 -0
  56. package/core/i18n/locales.d.ts +15 -0
  57. package/core/i18n/time-utilities.d.ts +16 -0
  58. package/core/platform/StringUtilities.d.ts +0 -21
  59. package/core/protocol_client/CDPConnection.d.ts +77 -0
  60. package/core/protocol_client/ConnectionTransport.d.ts +9 -0
  61. package/core/protocol_client/DevToolsCDPConnection.d.ts +16 -0
  62. package/core/protocol_client/InspectorBackend.d.ts +223 -0
  63. package/core/protocol_client/protocol_client.d.ts +5 -0
  64. package/core/root/DevToolsContext.d.ts +34 -0
  65. package/core/root/ExperimentNames.d.ts +8 -0
  66. package/core/root/Runtime.d.ts +351 -0
  67. package/core/root/root.d.ts +4 -1
  68. package/core/sdk/AccessibilityModel.d.ts +76 -0
  69. package/core/sdk/AnimationModel.d.ts +161 -0
  70. package/core/sdk/AutofillModel.d.ts +23 -0
  71. package/core/sdk/CPUProfilerModel.d.ts +46 -0
  72. package/core/sdk/CPUThrottlingManager.d.ts +47 -0
  73. package/core/sdk/CSSContainerQuery.d.ts +42 -0
  74. package/core/sdk/CSSFontFace.d.ts +10 -0
  75. package/core/sdk/CSSLayer.d.ts +9 -0
  76. package/core/sdk/CSSLocation.d.ts +14 -0
  77. package/core/sdk/CSSMatchedStyles.d.ts +138 -0
  78. package/core/sdk/CSSMedia.d.ts +36 -0
  79. package/core/sdk/CSSMetadata.d.ts +87 -0
  80. package/core/sdk/CSSModel.d.ts +180 -0
  81. package/core/sdk/CSSNavigation.d.ts +10 -0
  82. package/core/sdk/CSSProperty.d.ts +53 -0
  83. package/core/sdk/CSSPropertyParser.d.ts +131 -0
  84. package/core/sdk/CSSPropertyParserMatchers.d.ts +442 -0
  85. package/core/sdk/CSSQuery.d.ts +22 -0
  86. package/core/sdk/CSSRule.d.ts +132 -0
  87. package/core/sdk/CSSScope.d.ts +9 -0
  88. package/core/sdk/CSSStartingStyle.d.ts +9 -0
  89. package/core/sdk/CSSStyleDeclaration.d.ts +38 -0
  90. package/core/sdk/CSSStyleSheetHeader.d.ts +53 -0
  91. package/core/sdk/CSSSupports.d.ts +10 -0
  92. package/core/sdk/CategorizedBreakpoint.d.ts +42 -0
  93. package/core/sdk/ChildTargetManager.d.ts +40 -0
  94. package/core/sdk/CompilerSourceMappingContentProvider.d.ts +12 -0
  95. package/core/sdk/Connections.d.ts +36 -0
  96. package/core/sdk/ConsoleModel.d.ts +127 -0
  97. package/core/sdk/ConsoleModelTypes.d.ts +6 -0
  98. package/core/sdk/Cookie.d.ts +68 -0
  99. package/core/sdk/CookieModel.d.ts +31 -0
  100. package/core/sdk/CookieParser.d.ts +14 -0
  101. package/core/sdk/CrashReportContextModel.d.ts +8 -0
  102. package/core/sdk/DOMDebuggerModel.d.ts +127 -0
  103. package/core/sdk/DOMModel.d.ts +436 -0
  104. package/core/sdk/DOMStorageModel.d.ts +79 -0
  105. package/core/sdk/DebuggerModel.d.ts +272 -0
  106. package/core/sdk/EmulationModel.d.ts +95 -0
  107. package/core/sdk/EnhancedTracesParser.d.ts +105 -0
  108. package/core/sdk/EventBreakpointsModel.d.ts +66 -0
  109. package/core/sdk/FrameAssociated.d.ts +6 -0
  110. package/core/sdk/FrameManager.d.ts +68 -0
  111. package/core/sdk/HeapProfilerModel.d.ts +75 -0
  112. package/core/sdk/HttpReasonPhraseStrings.d.ts +5 -0
  113. package/core/sdk/IOModel.d.ts +10 -0
  114. package/core/sdk/IsolateManager.d.ts +53 -0
  115. package/core/sdk/IssuesModel.d.ts +28 -0
  116. package/core/sdk/LayerTreeBase.d.ts +70 -0
  117. package/core/sdk/LogModel.d.ts +20 -0
  118. package/core/sdk/NetworkManager.d.ts +418 -0
  119. package/core/sdk/NetworkRequest.d.ts +469 -0
  120. package/core/sdk/NetworkRequestAccess.d.ts +91 -0
  121. package/core/sdk/OverlayColorGenerator.d.ts +14 -0
  122. package/core/sdk/OverlayModel.d.ts +186 -0
  123. package/core/sdk/OverlayPersistentHighlighter.d.ts +116 -0
  124. package/core/sdk/PageFunctions.d.ts +22 -0
  125. package/core/sdk/PageLoad.d.ts +14 -0
  126. package/core/sdk/PageResourceLoader.d.ts +111 -0
  127. package/core/sdk/PaintProfiler.d.ts +43 -0
  128. package/core/sdk/PerformanceMetricsModel.d.ts +12 -0
  129. package/core/sdk/PreloadingModel.d.ts +146 -0
  130. package/core/sdk/RehydratingConnection.d.ts +73 -0
  131. package/core/sdk/RehydratingObject.d.ts +59 -0
  132. package/core/sdk/RemoteObject.d.ts +210 -0
  133. package/core/sdk/Resource.d.ts +36 -0
  134. package/core/sdk/ResourceTreeModel.d.ts +278 -0
  135. package/core/sdk/RuntimeModel.d.ts +163 -0
  136. package/core/sdk/SDKModel.d.ts +30 -0
  137. package/core/sdk/SDKSettings.d.ts +53 -0
  138. package/core/sdk/ScopeTreeCache.d.ts +21 -0
  139. package/core/sdk/ScreenCaptureModel.d.ts +69 -0
  140. package/core/sdk/Script.d.ts +134 -0
  141. package/core/sdk/SecurityOrigin.d.ts +108 -0
  142. package/core/sdk/SecurityOriginManager.d.ts +23 -0
  143. package/core/sdk/ServerSentEvents.d.ts +18 -0
  144. package/core/sdk/ServerSentEventsProtocol.d.ts +18 -0
  145. package/core/sdk/ServerTiming.d.ts +24 -0
  146. package/core/sdk/ServiceWorkerCacheModel.d.ts +71 -0
  147. package/core/sdk/ServiceWorkerManager.d.ts +125 -0
  148. package/core/sdk/SourceMap.d.ts +197 -0
  149. package/core/sdk/SourceMapCache.d.ts +12 -0
  150. package/core/sdk/SourceMapFunctionRanges.d.ts +26 -0
  151. package/core/sdk/SourceMapManager.d.ts +46 -0
  152. package/core/sdk/SourceMapRangeMappings.d.ts +15 -0
  153. package/core/sdk/SourceMapScopeChainEntry.d.ts +23 -0
  154. package/core/sdk/SourceMapScopesInfo.d.ts +109 -0
  155. package/core/sdk/StorageBucketsModel.d.ts +48 -0
  156. package/core/sdk/StorageKeyManager.d.ts +38 -0
  157. package/core/sdk/Target.d.ts +79 -0
  158. package/core/sdk/TargetManager.d.ts +92 -0
  159. package/core/sdk/TraceObject.d.ts +43 -0
  160. package/core/sdk/WebAuthnModel.d.ts +29 -0
  161. package/core/sdk/sdk.d.ts +97 -1
  162. package/core/text_utils/CodeMirrorUtils.d.ts +3 -0
  163. package/core/text_utils/ContentData.d.ts +94 -0
  164. package/core/text_utils/ContentProvider.d.ts +42 -0
  165. package/core/text_utils/StaticContentProvider.d.ts +13 -0
  166. package/core/text_utils/StreamingContentData.d.ts +49 -0
  167. package/core/text_utils/Text.d.ts +19 -0
  168. package/core/text_utils/TextCursor.d.ts +9 -0
  169. package/core/text_utils/TextRange.d.ts +81 -0
  170. package/core/text_utils/TextUtils.d.ts +97 -0
  171. package/core/text_utils/WasmDisassembly.d.ts +29 -0
  172. package/core/text_utils/text_utils.d.ts +11 -0
  173. package/entrypoints/formatter_actions/formatter_actions.d.ts +48 -0
  174. package/generated/InspectorBackendCommands.d.ts +14 -0
  175. package/generated/SupportedCSSProperties.d.ts +18 -0
  176. package/generated/protocol-mapping.d.ts +5930 -0
  177. package/generated/protocol-proxy-api.d.ts +5396 -0
  178. package/generated/protocol.d.ts +26 -72
  179. package/index.d.ts +2 -0
  180. package/index.js +6 -0
  181. package/locales/af.json +171 -174
  182. package/locales/am.json +351 -354
  183. package/locales/ar.json +352 -355
  184. package/locales/as.json +350 -353
  185. package/locales/az.json +341 -344
  186. package/locales/be.json +351 -354
  187. package/locales/bg.json +351 -354
  188. package/locales/bn.json +351 -354
  189. package/locales/bs.json +253 -256
  190. package/locales/ca.json +283 -286
  191. package/locales/cs.json +336 -339
  192. package/locales/cy.json +144 -147
  193. package/locales/da.json +232 -235
  194. package/locales/de.json +251 -254
  195. package/locales/el.json +336 -339
  196. package/locales/en-GB.json +132 -135
  197. package/locales/en-US.json +294 -297
  198. package/locales/es-419.json +282 -285
  199. package/locales/es.json +282 -285
  200. package/locales/et.json +236 -239
  201. package/locales/eu.json +131 -134
  202. package/locales/fa.json +351 -354
  203. package/locales/fi.json +283 -286
  204. package/locales/fil.json +128 -131
  205. package/locales/fr-CA.json +310 -313
  206. package/locales/fr.json +309 -312
  207. package/locales/gl.json +264 -267
  208. package/locales/gu.json +352 -355
  209. package/locales/he.json +352 -355
  210. package/locales/hi.json +336 -339
  211. package/locales/hr.json +257 -260
  212. package/locales/hu.json +342 -345
  213. package/locales/hy.json +351 -354
  214. package/locales/id.json +128 -131
  215. package/locales/is.json +304 -307
  216. package/locales/it.json +221 -224
  217. package/locales/ja.json +351 -354
  218. package/locales/ka.json +352 -355
  219. package/locales/kk.json +352 -355
  220. package/locales/km.json +351 -354
  221. package/locales/kn.json +352 -355
  222. package/locales/ko.json +351 -354
  223. package/locales/ky.json +350 -353
  224. package/locales/lo.json +352 -355
  225. package/locales/lt.json +323 -326
  226. package/locales/lv.json +317 -320
  227. package/locales/mk.json +352 -355
  228. package/locales/ml.json +351 -354
  229. package/locales/mn.json +351 -354
  230. package/locales/mr.json +351 -354
  231. package/locales/ms.json +128 -131
  232. package/locales/my.json +350 -353
  233. package/locales/ne.json +336 -339
  234. package/locales/nl.json +183 -186
  235. package/locales/no.json +238 -241
  236. package/locales/or.json +351 -354
  237. package/locales/pa.json +351 -354
  238. package/locales/pl.json +307 -310
  239. package/locales/pt-PT.json +273 -276
  240. package/locales/pt.json +270 -273
  241. package/locales/ro.json +309 -312
  242. package/locales/ru.json +351 -354
  243. package/locales/si.json +352 -355
  244. package/locales/sk.json +333 -336
  245. package/locales/sl.json +273 -276
  246. package/locales/sq.json +316 -319
  247. package/locales/sr-Latn.json +256 -259
  248. package/locales/sr.json +352 -355
  249. package/locales/sv.json +296 -299
  250. package/locales/sw.json +128 -131
  251. package/locales/ta.json +352 -355
  252. package/locales/te.json +350 -353
  253. package/locales/th.json +352 -355
  254. package/locales/tr.json +327 -330
  255. package/locales/uk.json +351 -354
  256. package/locales/ur.json +352 -355
  257. package/locales/uz.json +232 -235
  258. package/locales/vi.json +352 -355
  259. package/locales/zh-HK.json +352 -355
  260. package/locales/zh-TW.json +351 -354
  261. package/locales/zh.json +351 -354
  262. package/locales/zu.json +127 -130
  263. package/models/crux-manager/CrUXManager.d.ts +107 -0
  264. package/models/crux-manager/crux-manager.d.ts +1 -0
  265. package/models/emulation/DeviceModeModel.d.ts +156 -0
  266. package/models/emulation/EmulatedDevices.d.ts +148 -0
  267. package/models/emulation/emulation.d.ts +3 -0
  268. package/models/formatter/FormatterWorkerPool.d.ts +58 -0
  269. package/models/formatter/ScriptFormatter.d.ts +11 -0
  270. package/models/formatter/formatter.d.ts +3 -0
  271. package/models/trace/ModelImpl.d.ts +1 -1
  272. package/models/trace/extras/extras.d.ts +2 -7
  273. package/models/trace/handlers/ScriptsHandler.d.ts +2 -2
  274. package/models/trace/insights/CLSCulprits.d.ts +14 -14
  275. package/models/trace/insights/Cache.d.ts +8 -8
  276. package/models/trace/insights/CharacterSet.d.ts +10 -10
  277. package/models/trace/insights/Common.d.ts +4 -4
  278. package/models/trace/insights/DOMSize.d.ts +15 -15
  279. package/models/trace/insights/DocumentLatency.d.ts +13 -13
  280. package/models/trace/insights/DuplicatedJavaScript.d.ts +7 -7
  281. package/models/trace/insights/FontDisplay.d.ts +7 -7
  282. package/models/trace/insights/ForcedReflow.d.ts +9 -9
  283. package/models/trace/insights/INPBreakdown.d.ts +10 -10
  284. package/models/trace/insights/ImageDelivery.d.ts +12 -13
  285. package/models/trace/insights/LCPBreakdown.d.ts +13 -13
  286. package/models/trace/insights/LCPDiscovery.d.ts +12 -12
  287. package/models/trace/insights/LegacyJavaScript.d.ts +7 -7
  288. package/models/trace/insights/ModernHTTP.d.ts +7 -7
  289. package/models/trace/insights/NetworkDependencyTree.d.ts +21 -104
  290. package/models/trace/insights/RenderBlocking.d.ts +7 -7
  291. package/models/trace/insights/SlowCSSSelector.d.ts +12 -12
  292. package/models/trace/insights/ThirdParties.d.ts +8 -8
  293. package/models/trace/insights/Viewport.d.ts +5 -5
  294. package/models/trace/insights/types.d.ts +1 -1
  295. package/models/trace/lantern/core/NetworkAnalyzer.d.ts +0 -1
  296. package/models/trace/lantern/graph/BaseNode.d.ts +2 -2
  297. package/models/trace/lantern/graph/CPUNode.d.ts +2 -4
  298. package/models/trace/lantern/simulation/TCPConnection.d.ts +4 -4
  299. package/models/trace/lantern/types/Lantern.d.ts +19 -27
  300. package/models/trace/trace.js +544 -16
  301. package/models/trace/types/Configuration.d.ts +1 -1
  302. package/models/trace/types/Extensions.d.ts +1 -1
  303. package/models/trace/types/File.d.ts +5 -5
  304. package/models/trace/types/TraceEvents.d.ts +24 -24
  305. package/package.json +37 -8
  306. package/third_party/codemirror.next/codemirror.next.d.ts +9196 -0
  307. package/third_party/i18n/i18n-impl.d.ts +25 -0
  308. package/third_party/i18n/i18n.d.ts +3 -0
  309. package/third_party/i18n/localized-string-set.d.ts +49 -0
  310. package/third_party/intl-messageformat/intl-messageformat.d.ts +1 -0
  311. package/third_party/source-map-scopes-codec/package/src/builder/builder.d.ts +67 -0
  312. package/third_party/source-map-scopes-codec/package/src/builder/safe_builder.d.ts +38 -0
  313. package/third_party/source-map-scopes-codec/package/src/codec.d.ts +48 -0
  314. package/third_party/source-map-scopes-codec/package/src/decode/decode.d.ts +31 -0
  315. package/third_party/source-map-scopes-codec/package/src/encode/encode.d.ts +8 -0
  316. package/third_party/source-map-scopes-codec/package/src/encode/encoder.d.ts +6 -0
  317. package/third_party/source-map-scopes-codec/package/src/mod.d.ts +5 -0
  318. package/third_party/source-map-scopes-codec/package/src/scopes.d.ts +168 -0
  319. package/third_party/source-map-scopes-codec/package/src/util.d.ts +5 -0
  320. package/third_party/source-map-scopes-codec/package/src/vlq.d.ts +14 -0
  321. package/third_party/source-map-scopes-codec/source-map-scopes-codec.d.ts +1 -0
  322. package/third_party/third-party-web/lib/nostats-subset.d.ts +2 -0
  323. package/third_party/third-party-web/package/lib/index.d.ts +34 -0
  324. package/third_party/third-party-web/package/lib/subsets/nostats.d.ts +1 -0
  325. package/third_party/third-party-web/third-party-web.d.ts +2 -1
  326. package/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts +0 -13
  327. package/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts.map +0 -1
  328. package/.tmp/tsbuildinfo/analyze-trace.d.mts +0 -17
  329. package/.tmp/tsbuildinfo/analyze-trace.d.mts.map +0 -1
  330. package/.tmp/tsbuildinfo/models/trace/extras/polyfills.d.ts +0 -4
  331. package/.tmp/tsbuildinfo/models/trace/extras/polyfills.d.ts.map +0 -1
  332. package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts +0 -2
  333. package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts.map +0 -1
  334. package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts +0 -3
  335. package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts.map +0 -1
  336. package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +0 -1
  337. package/analyze-inspector-issues.mjs +0 -60
  338. package/core/common/common.js +0 -1
  339. package/core/host/host.js +0 -1
  340. package/core/platform/ArrayUtilities.js +0 -224
  341. package/core/platform/ArrayUtilities.js.map +0 -1
  342. package/core/platform/Brand.js +0 -5
  343. package/core/platform/Brand.js.map +0 -1
  344. package/core/platform/Constructor.js +0 -5
  345. package/core/platform/Constructor.js.map +0 -1
  346. package/core/platform/DateUtilities.js +0 -14
  347. package/core/platform/DateUtilities.js.map +0 -1
  348. package/core/platform/DevToolsPath.js +0 -28
  349. package/core/platform/DevToolsPath.js.map +0 -1
  350. package/core/platform/HostRuntime.js +0 -31
  351. package/core/platform/HostRuntime.js.map +0 -1
  352. package/core/platform/KeyboardUtilities.js +0 -34
  353. package/core/platform/KeyboardUtilities.js.map +0 -1
  354. package/core/platform/MapUtilities.js +0 -80
  355. package/core/platform/MapUtilities.js.map +0 -1
  356. package/core/platform/MimeType.js +0 -157
  357. package/core/platform/MimeType.js.map +0 -1
  358. package/core/platform/NumberUtilities.js +0 -73
  359. package/core/platform/NumberUtilities.js.map +0 -1
  360. package/core/platform/Size.js +0 -36
  361. package/core/platform/Size.js.map +0 -1
  362. package/core/platform/StringUtilities.js +0 -731
  363. package/core/platform/StringUtilities.js.map +0 -1
  364. package/core/platform/Timing.js +0 -10
  365. package/core/platform/Timing.js.map +0 -1
  366. package/core/platform/TypedArrayUtilities.js +0 -158
  367. package/core/platform/TypedArrayUtilities.js.map +0 -1
  368. package/core/platform/TypescriptUtilities.js +0 -17
  369. package/core/platform/TypescriptUtilities.js.map +0 -1
  370. package/core/platform/UIString.js +0 -5
  371. package/core/platform/UIString.js.map +0 -1
  372. package/core/platform/UserVisibleError.js +0 -23
  373. package/core/platform/UserVisibleError.js.map +0 -1
  374. package/core/platform/api/HostRuntime.js +0 -5
  375. package/core/platform/api/HostRuntime.js.map +0 -1
  376. package/core/platform/api/api-tsconfig.json +0 -58
  377. package/core/platform/api/api-tsconfig.ref.json +0 -26
  378. package/core/platform/api/api.js +0 -6
  379. package/core/platform/api/api.js.map +0 -1
  380. package/core/platform/browser/HostRuntime.js +0 -165
  381. package/core/platform/browser/HostRuntime.js.map +0 -1
  382. package/core/platform/browser/browser-tsconfig.json +0 -59
  383. package/core/platform/browser/browser-tsconfig.ref.json +0 -27
  384. package/core/platform/browser/browser.js +0 -6
  385. package/core/platform/browser/browser.js.map +0 -1
  386. package/core/platform/browser/bundle-tsconfig.json +0 -59
  387. package/core/platform/browser/bundle-tsconfig.ref.json +0 -27
  388. package/core/platform/bundle-tsconfig.json +0 -59
  389. package/core/platform/bundle-tsconfig.ref.json +0 -27
  390. package/core/platform/foundation_unittests-tsconfig.json +0 -73
  391. package/core/platform/foundation_unittests-tsconfig.ref.json +0 -40
  392. package/core/platform/foundation_unittests_node_typecheck-tsconfig.json +0 -70
  393. package/core/platform/node/HostRuntime.js +0 -127
  394. package/core/platform/node/HostRuntime.js.map +0 -1
  395. package/core/platform/node/bundle-tsconfig.json +0 -59
  396. package/core/platform/node/bundle-tsconfig.ref.json +0 -27
  397. package/core/platform/node/node-tsconfig.json +0 -59
  398. package/core/platform/node/node-tsconfig.ref.json +0 -27
  399. package/core/platform/node/node.js +0 -6
  400. package/core/platform/node/node.js.map +0 -1
  401. package/core/platform/platform-tsconfig.json +0 -81
  402. package/core/platform/platform-tsconfig.ref.json +0 -49
  403. package/core/platform/platform.js +0 -28
  404. package/core/platform/platform.js.map +0 -1
  405. package/core/platform/platform_node_typecheck-tsconfig.json +0 -78
  406. package/core/platform/platform_node_typecheck.stamp +0 -0
  407. package/core/root/root.js +0 -1
  408. package/core/sdk/sdk.js +0 -1
  409. package/generated/protocol.js +0 -3304
  410. package/locales/en-XL.json +0 -1058
  411. package/models/cpu_profile/CPUProfileDataModel.js +0 -517
  412. package/models/cpu_profile/CPUProfileDataModel.js.map +0 -1
  413. package/models/cpu_profile/ProfileTreeModel.js +0 -90
  414. package/models/cpu_profile/ProfileTreeModel.js.map +0 -1
  415. package/models/cpu_profile/bundle-tsconfig.json +0 -59
  416. package/models/cpu_profile/bundle-tsconfig.ref.json +0 -27
  417. package/models/cpu_profile/cpu_profile-tsconfig.json +0 -63
  418. package/models/cpu_profile/cpu_profile-tsconfig.ref.json +0 -31
  419. package/models/cpu_profile/cpu_profile.js +0 -7
  420. package/models/cpu_profile/cpu_profile.js.map +0 -1
  421. package/models/cpu_profile/cpu_profile_node_typecheck-tsconfig.json +0 -60
  422. package/models/cpu_profile/cpu_profile_node_typecheck.stamp +0 -0
  423. package/models/cpu_profile/foundation_unittests-tsconfig.json +0 -63
  424. package/models/cpu_profile/foundation_unittests-tsconfig.ref.json +0 -30
  425. package/models/cpu_profile/foundation_unittests_node_typecheck-tsconfig.json +0 -60
  426. package/models/issues_manager/CheckFormsIssuesTrigger.d.ts +0 -1
  427. package/models/issues_manager/CheckFormsIssuesTrigger.js +0 -1
  428. package/models/issues_manager/ContrastCheckTrigger.d.ts +0 -1
  429. package/models/issues_manager/ContrastCheckTrigger.js +0 -1
  430. package/models/issues_manager/DeprecationIssue.d.ts +0 -1
  431. package/models/issues_manager/DeprecationIssue.js +0 -1
  432. package/models/issues_manager/IssueResolver.d.ts +0 -1
  433. package/models/issues_manager/IssueResolver.js +0 -1
  434. package/models/issues_manager/RelatedIssue.d.ts +0 -1
  435. package/models/issues_manager/RelatedIssue.js +0 -1
  436. package/models/issues_manager/SourceFrameIssuesManager.d.ts +0 -1
  437. package/models/issues_manager/SourceFrameIssuesManager.js +0 -1
  438. package/models/trace/EntityMapper.js +0 -133
  439. package/models/trace/EntityMapper.js.map +0 -1
  440. package/models/trace/EventsSerializer.js +0 -90
  441. package/models/trace/EventsSerializer.js.map +0 -1
  442. package/models/trace/LanternComputationData.js +0 -374
  443. package/models/trace/LanternComputationData.js.map +0 -1
  444. package/models/trace/LegacyTracingModel.d.ts +0 -1
  445. package/models/trace/LegacyTracingModel.js +0 -1
  446. package/models/trace/ModelImpl.js +0 -181
  447. package/models/trace/ModelImpl.js.map +0 -1
  448. package/models/trace/Name.js +0 -115
  449. package/models/trace/Name.js.map +0 -1
  450. package/models/trace/Processor.js +0 -618
  451. package/models/trace/Processor.js.map +0 -1
  452. package/models/trace/Styles.js +0 -836
  453. package/models/trace/Styles.js.map +0 -1
  454. package/models/trace/TracingManager.d.ts +0 -1
  455. package/models/trace/TracingManager.js +0 -1
  456. package/models/trace/bundle-tsconfig.json +0 -77
  457. package/models/trace/bundle-tsconfig.ref.json +0 -45
  458. package/models/trace/extras/FilmStrip.js +0 -45
  459. package/models/trace/extras/FilmStrip.js.map +0 -1
  460. package/models/trace/extras/Initiators.js +0 -47
  461. package/models/trace/extras/Initiators.js.map +0 -1
  462. package/models/trace/extras/MainThreadActivity.js +0 -77
  463. package/models/trace/extras/MainThreadActivity.js.map +0 -1
  464. package/models/trace/extras/ScriptDuplication.js +0 -163
  465. package/models/trace/extras/ScriptDuplication.js.map +0 -1
  466. package/models/trace/extras/StackTraceForEvent.js +0 -192
  467. package/models/trace/extras/StackTraceForEvent.js.map +0 -1
  468. package/models/trace/extras/ThirdParties.js +0 -119
  469. package/models/trace/extras/ThirdParties.js.map +0 -1
  470. package/models/trace/extras/TraceFilter.js +0 -51
  471. package/models/trace/extras/TraceFilter.js.map +0 -1
  472. package/models/trace/extras/TraceTree.js +0 -621
  473. package/models/trace/extras/TraceTree.js.map +0 -1
  474. package/models/trace/extras/bundle-tsconfig.json +0 -59
  475. package/models/trace/extras/bundle-tsconfig.ref.json +0 -27
  476. package/models/trace/extras/extras-tsconfig.json +0 -81
  477. package/models/trace/extras/extras-tsconfig.ref.json +0 -49
  478. package/models/trace/extras/extras.js +0 -13
  479. package/models/trace/extras/extras.js.map +0 -1
  480. package/models/trace/extras/extras_node_typecheck-tsconfig.json +0 -78
  481. package/models/trace/extras/extras_node_typecheck.stamp +0 -0
  482. package/models/trace/extras/foundation_unittests-tsconfig.json +0 -91
  483. package/models/trace/extras/foundation_unittests-tsconfig.ref.json +0 -58
  484. package/models/trace/extras/foundation_unittests_node_typecheck-tsconfig.json +0 -88
  485. package/models/trace/foundation_unittests-tsconfig.json +0 -70
  486. package/models/trace/foundation_unittests-tsconfig.ref.json +0 -37
  487. package/models/trace/foundation_unittests_node_typecheck-tsconfig.json +0 -67
  488. package/models/trace/handlers/AnimationFramesHandler.js +0 -110
  489. package/models/trace/handlers/AnimationFramesHandler.js.map +0 -1
  490. package/models/trace/handlers/AnimationHandler.js +0 -27
  491. package/models/trace/handlers/AnimationHandler.js.map +0 -1
  492. package/models/trace/handlers/AsyncJSCallsHandler.js +0 -188
  493. package/models/trace/handlers/AsyncJSCallsHandler.js.map +0 -1
  494. package/models/trace/handlers/DOMStatsHandler.js +0 -22
  495. package/models/trace/handlers/DOMStatsHandler.js.map +0 -1
  496. package/models/trace/handlers/ExtensionTraceDataHandler.js +0 -264
  497. package/models/trace/handlers/ExtensionTraceDataHandler.js.map +0 -1
  498. package/models/trace/handlers/FlowsHandler.js +0 -149
  499. package/models/trace/handlers/FlowsHandler.js.map +0 -1
  500. package/models/trace/handlers/FramesHandler.js +0 -491
  501. package/models/trace/handlers/FramesHandler.js.map +0 -1
  502. package/models/trace/handlers/GPUHandler.js +0 -36
  503. package/models/trace/handlers/GPUHandler.js.map +0 -1
  504. package/models/trace/handlers/ImagePaintingHandler.js +0 -148
  505. package/models/trace/handlers/ImagePaintingHandler.js.map +0 -1
  506. package/models/trace/handlers/InitiatorsHandler.js +0 -181
  507. package/models/trace/handlers/InitiatorsHandler.js.map +0 -1
  508. package/models/trace/handlers/InvalidationsHandler.js +0 -127
  509. package/models/trace/handlers/InvalidationsHandler.js.map +0 -1
  510. package/models/trace/handlers/LargestImagePaintHandler.js +0 -86
  511. package/models/trace/handlers/LargestImagePaintHandler.js.map +0 -1
  512. package/models/trace/handlers/LargestTextPaintHandler.js +0 -28
  513. package/models/trace/handlers/LargestTextPaintHandler.js.map +0 -1
  514. package/models/trace/handlers/LayerTreeHandler.js +0 -104
  515. package/models/trace/handlers/LayerTreeHandler.js.map +0 -1
  516. package/models/trace/handlers/LayoutShiftsHandler.js +0 -457
  517. package/models/trace/handlers/LayoutShiftsHandler.js.map +0 -1
  518. package/models/trace/handlers/MemoryHandler.js +0 -22
  519. package/models/trace/handlers/MemoryHandler.js.map +0 -1
  520. package/models/trace/handlers/MetaHandler.js +0 -442
  521. package/models/trace/handlers/MetaHandler.js.map +0 -1
  522. package/models/trace/handlers/ModelHandlers.js +0 -33
  523. package/models/trace/handlers/ModelHandlers.js.map +0 -1
  524. package/models/trace/handlers/NetworkRequestsHandler.js +0 -578
  525. package/models/trace/handlers/NetworkRequestsHandler.js.map +0 -1
  526. package/models/trace/handlers/PageFramesHandler.js +0 -43
  527. package/models/trace/handlers/PageFramesHandler.js.map +0 -1
  528. package/models/trace/handlers/PageLoadMetricsHandler.js +0 -462
  529. package/models/trace/handlers/PageLoadMetricsHandler.js.map +0 -1
  530. package/models/trace/handlers/RendererHandler.js +0 -346
  531. package/models/trace/handlers/RendererHandler.js.map +0 -1
  532. package/models/trace/handlers/SamplesHandler.js +0 -261
  533. package/models/trace/handlers/SamplesHandler.js.map +0 -1
  534. package/models/trace/handlers/ScreenshotsHandler.js +0 -56
  535. package/models/trace/handlers/ScreenshotsHandler.js.map +0 -1
  536. package/models/trace/handlers/ScriptsHandler.js +0 -286
  537. package/models/trace/handlers/ScriptsHandler.js.map +0 -1
  538. package/models/trace/handlers/SelectorStatsHandler.js +0 -72
  539. package/models/trace/handlers/SelectorStatsHandler.js.map +0 -1
  540. package/models/trace/handlers/Threads.js +0 -108
  541. package/models/trace/handlers/Threads.js.map +0 -1
  542. package/models/trace/handlers/UserInteractionsHandler.js +0 -319
  543. package/models/trace/handlers/UserInteractionsHandler.js.map +0 -1
  544. package/models/trace/handlers/UserTimingsHandler.js +0 -194
  545. package/models/trace/handlers/UserTimingsHandler.js.map +0 -1
  546. package/models/trace/handlers/WarningsHandler.js +0 -135
  547. package/models/trace/handlers/WarningsHandler.js.map +0 -1
  548. package/models/trace/handlers/WorkersHandler.js +0 -34
  549. package/models/trace/handlers/WorkersHandler.js.map +0 -1
  550. package/models/trace/handlers/bundle-tsconfig.json +0 -59
  551. package/models/trace/handlers/bundle-tsconfig.ref.json +0 -27
  552. package/models/trace/handlers/foundation_unittests-tsconfig.json +0 -102
  553. package/models/trace/handlers/foundation_unittests-tsconfig.ref.json +0 -69
  554. package/models/trace/handlers/foundation_unittests_node_typecheck-tsconfig.json +0 -99
  555. package/models/trace/handlers/handlers-tsconfig.json +0 -112
  556. package/models/trace/handlers/handlers-tsconfig.ref.json +0 -80
  557. package/models/trace/handlers/handlers.js +0 -8
  558. package/models/trace/handlers/handlers.js.map +0 -1
  559. package/models/trace/handlers/handlers_node_typecheck-tsconfig.json +0 -109
  560. package/models/trace/handlers/handlers_node_typecheck.stamp +0 -0
  561. package/models/trace/handlers/helpers.js +0 -164
  562. package/models/trace/handlers/helpers.js.map +0 -1
  563. package/models/trace/handlers/types.js +0 -2
  564. package/models/trace/handlers/types.js.map +0 -1
  565. package/models/trace/helpers/Extensions.js +0 -42
  566. package/models/trace/helpers/Extensions.js.map +0 -1
  567. package/models/trace/helpers/Network.js +0 -103
  568. package/models/trace/helpers/Network.js.map +0 -1
  569. package/models/trace/helpers/SamplesIntegrator.js +0 -512
  570. package/models/trace/helpers/SamplesIntegrator.js.map +0 -1
  571. package/models/trace/helpers/SyntheticEvents.js +0 -94
  572. package/models/trace/helpers/SyntheticEvents.js.map +0 -1
  573. package/models/trace/helpers/Timing.js +0 -207
  574. package/models/trace/helpers/Timing.js.map +0 -1
  575. package/models/trace/helpers/Trace.js +0 -817
  576. package/models/trace/helpers/Trace.js.map +0 -1
  577. package/models/trace/helpers/TreeHelpers.js +0 -255
  578. package/models/trace/helpers/TreeHelpers.js.map +0 -1
  579. package/models/trace/helpers/bundle-tsconfig.json +0 -59
  580. package/models/trace/helpers/bundle-tsconfig.ref.json +0 -27
  581. package/models/trace/helpers/foundation_unittests-tsconfig.json +0 -73
  582. package/models/trace/helpers/foundation_unittests-tsconfig.ref.json +0 -40
  583. package/models/trace/helpers/foundation_unittests_node_typecheck-tsconfig.json +0 -70
  584. package/models/trace/helpers/helpers-tsconfig.json +0 -77
  585. package/models/trace/helpers/helpers-tsconfig.ref.json +0 -45
  586. package/models/trace/helpers/helpers.js +0 -11
  587. package/models/trace/helpers/helpers.js.map +0 -1
  588. package/models/trace/helpers/helpers_node_typecheck-tsconfig.json +0 -74
  589. package/models/trace/helpers/helpers_node_typecheck.stamp +0 -0
  590. package/models/trace/insights/CLSCulprits.js +0 -519
  591. package/models/trace/insights/CLSCulprits.js.map +0 -1
  592. package/models/trace/insights/Cache.js +0 -210
  593. package/models/trace/insights/Cache.js.map +0 -1
  594. package/models/trace/insights/CharacterSet.js +0 -132
  595. package/models/trace/insights/CharacterSet.js.map +0 -1
  596. package/models/trace/insights/Common.js +0 -366
  597. package/models/trace/insights/Common.js.map +0 -1
  598. package/models/trace/insights/DOMSize.js +0 -182
  599. package/models/trace/insights/DOMSize.js.map +0 -1
  600. package/models/trace/insights/DocumentLatency.js +0 -259
  601. package/models/trace/insights/DocumentLatency.js.map +0 -1
  602. package/models/trace/insights/DuplicatedJavaScript.js +0 -99
  603. package/models/trace/insights/DuplicatedJavaScript.js.map +0 -1
  604. package/models/trace/insights/FontDisplay.js +0 -93
  605. package/models/trace/insights/FontDisplay.js.map +0 -1
  606. package/models/trace/insights/ForcedReflow.js +0 -162
  607. package/models/trace/insights/ForcedReflow.js.map +0 -1
  608. package/models/trace/insights/INPBreakdown.js +0 -130
  609. package/models/trace/insights/INPBreakdown.js.map +0 -1
  610. package/models/trace/insights/ImageDelivery.js +0 -264
  611. package/models/trace/insights/ImageDelivery.js.map +0 -1
  612. package/models/trace/insights/LCPBreakdown.js +0 -200
  613. package/models/trace/insights/LCPBreakdown.js.map +0 -1
  614. package/models/trace/insights/LCPDiscovery.js +0 -190
  615. package/models/trace/insights/LCPDiscovery.js.map +0 -1
  616. package/models/trace/insights/LegacyJavaScript.js +0 -99
  617. package/models/trace/insights/LegacyJavaScript.js.map +0 -1
  618. package/models/trace/insights/Models.js +0 -23
  619. package/models/trace/insights/Models.js.map +0 -1
  620. package/models/trace/insights/ModernHTTP.js +0 -205
  621. package/models/trace/insights/ModernHTTP.js.map +0 -1
  622. package/models/trace/insights/NetworkDependencyTree.js +0 -972
  623. package/models/trace/insights/NetworkDependencyTree.js.map +0 -1
  624. package/models/trace/insights/RenderBlocking.js +0 -191
  625. package/models/trace/insights/RenderBlocking.js.map +0 -1
  626. package/models/trace/insights/SlowCSSSelector.js +0 -140
  627. package/models/trace/insights/SlowCSSSelector.js.map +0 -1
  628. package/models/trace/insights/Statistics.js +0 -93
  629. package/models/trace/insights/Statistics.js.map +0 -1
  630. package/models/trace/insights/ThirdParties.js +0 -110
  631. package/models/trace/insights/ThirdParties.js.map +0 -1
  632. package/models/trace/insights/Viewport.js +0 -105
  633. package/models/trace/insights/Viewport.js.map +0 -1
  634. package/models/trace/insights/bundle-tsconfig.json +0 -59
  635. package/models/trace/insights/bundle-tsconfig.ref.json +0 -27
  636. package/models/trace/insights/foundation_unittests-tsconfig.json +0 -98
  637. package/models/trace/insights/foundation_unittests-tsconfig.ref.json +0 -65
  638. package/models/trace/insights/foundation_unittests_node_typecheck-tsconfig.json +0 -95
  639. package/models/trace/insights/insights-tsconfig.json +0 -114
  640. package/models/trace/insights/insights-tsconfig.ref.json +0 -82
  641. package/models/trace/insights/insights.js +0 -10
  642. package/models/trace/insights/insights.js.map +0 -1
  643. package/models/trace/insights/insights_node_typecheck-tsconfig.json +0 -111
  644. package/models/trace/insights/insights_node_typecheck.stamp +0 -0
  645. package/models/trace/insights/types.js +0 -41
  646. package/models/trace/insights/types.js.map +0 -1
  647. package/models/trace/lantern/bundle-tsconfig.json +0 -71
  648. package/models/trace/lantern/bundle-tsconfig.ref.json +0 -39
  649. package/models/trace/lantern/core/LanternError.js +0 -7
  650. package/models/trace/lantern/core/LanternError.js.map +0 -1
  651. package/models/trace/lantern/core/NetworkAnalyzer.js +0 -488
  652. package/models/trace/lantern/core/NetworkAnalyzer.js.map +0 -1
  653. package/models/trace/lantern/core/bundle-tsconfig.json +0 -59
  654. package/models/trace/lantern/core/bundle-tsconfig.ref.json +0 -27
  655. package/models/trace/lantern/core/core-tsconfig.json +0 -60
  656. package/models/trace/lantern/core/core-tsconfig.ref.json +0 -28
  657. package/models/trace/lantern/core/core.js +0 -6
  658. package/models/trace/lantern/core/core.js.map +0 -1
  659. package/models/trace/lantern/core/core_node_typecheck-tsconfig.json +0 -57
  660. package/models/trace/lantern/core/core_node_typecheck.stamp +0 -0
  661. package/models/trace/lantern/core/foundation_unittests-tsconfig.json +0 -69
  662. package/models/trace/lantern/core/foundation_unittests-tsconfig.ref.json +0 -36
  663. package/models/trace/lantern/core/foundation_unittests_node_typecheck-tsconfig.json +0 -66
  664. package/models/trace/lantern/graph/BaseNode.js +0 -277
  665. package/models/trace/lantern/graph/BaseNode.js.map +0 -1
  666. package/models/trace/lantern/graph/CPUNode.js +0 -80
  667. package/models/trace/lantern/graph/CPUNode.js.map +0 -1
  668. package/models/trace/lantern/graph/NetworkNode.js +0 -95
  669. package/models/trace/lantern/graph/NetworkNode.js.map +0 -1
  670. package/models/trace/lantern/graph/PageDependencyGraph.js +0 -574
  671. package/models/trace/lantern/graph/PageDependencyGraph.js.map +0 -1
  672. package/models/trace/lantern/graph/bundle-tsconfig.json +0 -59
  673. package/models/trace/lantern/graph/bundle-tsconfig.ref.json +0 -27
  674. package/models/trace/lantern/graph/foundation_unittests-tsconfig.json +0 -61
  675. package/models/trace/lantern/graph/foundation_unittests-tsconfig.ref.json +0 -28
  676. package/models/trace/lantern/graph/foundation_unittests_node_typecheck-tsconfig.json +0 -58
  677. package/models/trace/lantern/graph/graph-tsconfig.json +0 -65
  678. package/models/trace/lantern/graph/graph-tsconfig.ref.json +0 -33
  679. package/models/trace/lantern/graph/graph.js +0 -8
  680. package/models/trace/lantern/graph/graph.js.map +0 -1
  681. package/models/trace/lantern/graph/graph_node_typecheck-tsconfig.json +0 -62
  682. package/models/trace/lantern/graph/graph_node_typecheck.stamp +0 -0
  683. package/models/trace/lantern/lantern.js +0 -10
  684. package/models/trace/lantern/lantern.js.map +0 -1
  685. package/models/trace/lantern/metrics/FirstContentfulPaint.js +0 -137
  686. package/models/trace/lantern/metrics/FirstContentfulPaint.js.map +0 -1
  687. package/models/trace/lantern/metrics/Interactive.js +0 -68
  688. package/models/trace/lantern/metrics/Interactive.js.map +0 -1
  689. package/models/trace/lantern/metrics/LargestContentfulPaint.js +0 -69
  690. package/models/trace/lantern/metrics/LargestContentfulPaint.js.map +0 -1
  691. package/models/trace/lantern/metrics/MaxPotentialFID.js +0 -49
  692. package/models/trace/lantern/metrics/MaxPotentialFID.js.map +0 -1
  693. package/models/trace/lantern/metrics/Metric.js +0 -69
  694. package/models/trace/lantern/metrics/Metric.js.map +0 -1
  695. package/models/trace/lantern/metrics/SpeedIndex.js +0 -102
  696. package/models/trace/lantern/metrics/SpeedIndex.js.map +0 -1
  697. package/models/trace/lantern/metrics/TBTUtils.js +0 -65
  698. package/models/trace/lantern/metrics/TBTUtils.js.map +0 -1
  699. package/models/trace/lantern/metrics/TotalBlockingTime.js +0 -79
  700. package/models/trace/lantern/metrics/TotalBlockingTime.js.map +0 -1
  701. package/models/trace/lantern/metrics/bundle-tsconfig.json +0 -59
  702. package/models/trace/lantern/metrics/bundle-tsconfig.ref.json +0 -27
  703. package/models/trace/lantern/metrics/foundation_unittests-tsconfig.json +0 -76
  704. package/models/trace/lantern/metrics/foundation_unittests-tsconfig.ref.json +0 -43
  705. package/models/trace/lantern/metrics/foundation_unittests_node_typecheck-tsconfig.json +0 -73
  706. package/models/trace/lantern/metrics/metrics-tsconfig.json +0 -75
  707. package/models/trace/lantern/metrics/metrics-tsconfig.ref.json +0 -43
  708. package/models/trace/lantern/metrics/metrics.js +0 -12
  709. package/models/trace/lantern/metrics/metrics.js.map +0 -1
  710. package/models/trace/lantern/metrics/metrics_node_typecheck-tsconfig.json +0 -72
  711. package/models/trace/lantern/metrics/metrics_node_typecheck.stamp +0 -0
  712. package/models/trace/lantern/simulation/ConnectionPool.js +0 -116
  713. package/models/trace/lantern/simulation/ConnectionPool.js.map +0 -1
  714. package/models/trace/lantern/simulation/Constants.js +0 -45
  715. package/models/trace/lantern/simulation/Constants.js.map +0 -1
  716. package/models/trace/lantern/simulation/DNSCache.js +0 -48
  717. package/models/trace/lantern/simulation/DNSCache.js.map +0 -1
  718. package/models/trace/lantern/simulation/SimulationTimingMap.js +0 -135
  719. package/models/trace/lantern/simulation/SimulationTimingMap.js.map +0 -1
  720. package/models/trace/lantern/simulation/Simulator.js +0 -455
  721. package/models/trace/lantern/simulation/Simulator.js.map +0 -1
  722. package/models/trace/lantern/simulation/TCPConnection.js +0 -155
  723. package/models/trace/lantern/simulation/TCPConnection.js.map +0 -1
  724. package/models/trace/lantern/simulation/bundle-tsconfig.json +0 -59
  725. package/models/trace/lantern/simulation/bundle-tsconfig.ref.json +0 -27
  726. package/models/trace/lantern/simulation/foundation_unittests-tsconfig.json +0 -75
  727. package/models/trace/lantern/simulation/foundation_unittests-tsconfig.ref.json +0 -42
  728. package/models/trace/lantern/simulation/foundation_unittests_node_typecheck-tsconfig.json +0 -72
  729. package/models/trace/lantern/simulation/simulation-tsconfig.json +0 -70
  730. package/models/trace/lantern/simulation/simulation-tsconfig.ref.json +0 -38
  731. package/models/trace/lantern/simulation/simulation.js +0 -10
  732. package/models/trace/lantern/simulation/simulation.js.map +0 -1
  733. package/models/trace/lantern/simulation/simulation_node_typecheck-tsconfig.json +0 -67
  734. package/models/trace/lantern/simulation/simulation_node_typecheck.stamp +0 -0
  735. package/models/trace/lantern/testing/bundle-tsconfig.json +0 -60
  736. package/models/trace/lantern/testing/bundle-tsconfig.ref.json +0 -27
  737. package/models/trace/lantern/testing/testing-tsconfig.json +0 -63
  738. package/models/trace/lantern/testing/testing-tsconfig.ref.json +0 -30
  739. package/models/trace/lantern/types/Lantern.js +0 -25
  740. package/models/trace/lantern/types/Lantern.js.map +0 -1
  741. package/models/trace/lantern/types/bundle-tsconfig.json +0 -59
  742. package/models/trace/lantern/types/bundle-tsconfig.ref.json +0 -27
  743. package/models/trace/lantern/types/types-tsconfig.json +0 -59
  744. package/models/trace/lantern/types/types-tsconfig.ref.json +0 -27
  745. package/models/trace/lantern/types/types.js +0 -5
  746. package/models/trace/lantern/types/types.js.map +0 -1
  747. package/models/trace/lantern/types/types_node_typecheck-tsconfig.json +0 -56
  748. package/models/trace/lantern/types/types_node_typecheck.stamp +0 -0
  749. package/models/trace/trace-tsconfig.json +0 -89
  750. package/models/trace/trace-tsconfig.ref.json +0 -57
  751. package/models/trace/trace.js.map +0 -1
  752. package/models/trace/trace_node_typecheck-tsconfig.json +0 -86
  753. package/models/trace/trace_node_typecheck.stamp +0 -0
  754. package/models/trace/types/Configuration.js +0 -19
  755. package/models/trace/types/Configuration.js.map +0 -1
  756. package/models/trace/types/Extensions.js +0 -38
  757. package/models/trace/types/Extensions.js.map +0 -1
  758. package/models/trace/types/File.js +0 -82
  759. package/models/trace/types/File.js.map +0 -1
  760. package/models/trace/types/Overlays.js +0 -5
  761. package/models/trace/types/Overlays.js.map +0 -1
  762. package/models/trace/types/Timing.js +0 -16
  763. package/models/trace/types/Timing.js.map +0 -1
  764. package/models/trace/types/TraceEvents.js +0 -986
  765. package/models/trace/types/TraceEvents.js.map +0 -1
  766. package/models/trace/types/bundle-tsconfig.json +0 -59
  767. package/models/trace/types/bundle-tsconfig.ref.json +0 -27
  768. package/models/trace/types/foundation_unittests-tsconfig.json +0 -67
  769. package/models/trace/types/foundation_unittests-tsconfig.ref.json +0 -34
  770. package/models/trace/types/foundation_unittests_node_typecheck-tsconfig.json +0 -64
  771. package/models/trace/types/types-tsconfig.json +0 -76
  772. package/models/trace/types/types-tsconfig.ref.json +0 -44
  773. package/models/trace/types/types.js +0 -10
  774. package/models/trace/types/types.js.map +0 -1
  775. package/models/trace/types/types_node_typecheck-tsconfig.json +0 -73
  776. package/models/trace/types/types_node_typecheck.stamp +0 -0
  777. package/test/invalid-animation-events.json.gz +0 -0
  778. package/test/test-trace-engine.mjs +0 -191
  779. package/third_party/legacy-javascript/bundle-tsconfig.json +0 -59
  780. package/third_party/legacy-javascript/bundle-tsconfig.ref.json +0 -27
  781. package/third_party/legacy-javascript/legacy-javascript-tsconfig.ref.json +0 -15
  782. package/third_party/legacy-javascript/legacy-javascript.js +0 -3
  783. package/third_party/legacy-javascript/legacy-javascript.js.map +0 -1
  784. package/third_party/legacy-javascript/lib/legacy-javascript.js +0 -1119
  785. package/third_party/marked/marked.d.ts +0 -1
  786. package/third_party/marked/marked.js +0 -1
  787. package/third_party/third-party-web/third-party-web.js +0 -1
  788. package/tsconfig.json +0 -29
@@ -1,261 +0,0 @@
1
- // Copyright 2022 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
- import * as Platform from '../../../core/platform/platform.js';
5
- import * as CPUProfile from '../../cpu_profile/cpu_profile.js';
6
- import * as Helpers from '../helpers/helpers.js';
7
- import * as Types from '../types/types.js';
8
- let profilesInProcess = new Map();
9
- let entryToNode = new Map();
10
- // The profile head, containing its metadata like its start
11
- // time, comes in a "Profile" event. The sample data comes in
12
- // "ProfileChunk" events. We match these ProfileChunks with their head
13
- // using process and profile ids. However, in order to integrate sample
14
- // data with trace data, we need the thread id that owns each profile.
15
- // This thread id is extracted from the head event.
16
- // For this reason, we have a preprocessed data structure, where events
17
- // are matched by profile id, which we then finish processing to export
18
- // events matched by thread id.
19
- let preprocessedData = new Map();
20
- /**
21
- * Profile source selection priority when multiple profiles exist for the same thread.
22
- *
23
- * Profile sources and their typical scenarios:
24
- * - 'Internal': Browser-initiated profiling performance panel traces.
25
- * This is the profiling mechanism when users click "Record" in the Devtools UI.
26
- * - 'Inspector': User-initiated via console.profile()/profileEnd() calls.
27
- * Represents explicit developer intent to profile specific code.
28
- * - 'SelfProfiling': Page-initiated via JS Self-Profiling API.
29
- * Lower signal vs the two above; treated as fallback.
30
- *
31
- * Selection strategy:
32
- * - CPU Profile mode: Prefer 'Inspector' (explicit user request).
33
- * - Performance trace: Prefer 'Internal' (integrated timeline context), then 'Inspector'.
34
- * - Sources not in the priority list (including 'SelfProfiling') act as fallbacks.
35
- * When no priority source matches, the first candidate profile is selected.
36
- */
37
- const PROFILE_SOURCES_BY_PRIORITY = {
38
- cpuProfile: ['Inspector'],
39
- performanceTrace: ['Internal', 'Inspector'],
40
- };
41
- function parseCPUProfileData(parseOptions) {
42
- const priorityList = parseOptions.isCPUProfile ? PROFILE_SOURCES_BY_PRIORITY.cpuProfile : PROFILE_SOURCES_BY_PRIORITY.performanceTrace;
43
- for (const [processId, profiles] of preprocessedData) {
44
- const profilesByThread = new Map();
45
- for (const [profileId, preProcessedData] of profiles) {
46
- const threadId = preProcessedData.threadId;
47
- if (threadId === undefined) {
48
- continue;
49
- }
50
- const listForThread = Platform.MapUtilities.getWithDefault(profilesByThread, threadId, () => []);
51
- listForThread.push({ id: profileId, data: preProcessedData });
52
- }
53
- for (const [threadId, candidates] of profilesByThread) {
54
- if (!candidates.length) {
55
- continue;
56
- }
57
- let chosen = candidates[0];
58
- for (const source of priorityList) {
59
- const match = candidates.find(p => p.data.source === source);
60
- if (match) {
61
- chosen = match;
62
- break;
63
- }
64
- }
65
- const chosenData = chosen.data;
66
- if (!chosenData.rawProfile.nodes.length) {
67
- continue;
68
- }
69
- const indexStack = [];
70
- const profileModel = new CPUProfile.CPUProfileDataModel.CPUProfileDataModel(chosenData.rawProfile);
71
- const profileTree = Helpers.TreeHelpers.makeEmptyTraceEntryTree();
72
- profileTree.maxDepth = profileModel.maxDepth;
73
- const selectedProfileId = chosen.id;
74
- const finalizedData = {
75
- rawProfile: chosenData.rawProfile,
76
- parsedProfile: profileModel,
77
- profileCalls: [],
78
- profileTree,
79
- profileId: selectedProfileId,
80
- };
81
- const dataByThread = Platform.MapUtilities.getWithDefault(profilesInProcess, processId, () => new Map());
82
- dataByThread.set(threadId, finalizedData);
83
- // Only need to build pure JS ProfileCalls if we're parsing a CPU Profile, otherwise SamplesIntegrator does the work.
84
- if (parseOptions.isCPUProfile) {
85
- buildProfileCallsForCPUProfile();
86
- }
87
- function buildProfileCallsForCPUProfile() {
88
- profileModel.forEachFrame(openFrameCallback, closeFrameCallback);
89
- function openFrameCallback(depth, node, sampleIndex, timeStampMilliseconds) {
90
- if (threadId === undefined) {
91
- return;
92
- }
93
- const ts = Helpers.Timing.milliToMicro(Types.Timing.Milli(timeStampMilliseconds));
94
- const nodeId = node.id;
95
- const profileCall = Helpers.Trace.makeProfileCall(node, selectedProfileId, sampleIndex, ts, processId, threadId);
96
- finalizedData.profileCalls.push(profileCall);
97
- indexStack.push(finalizedData.profileCalls.length - 1);
98
- const traceEntryNode = Helpers.TreeHelpers.makeEmptyTraceEntryNode(profileCall, nodeId);
99
- entryToNode.set(profileCall, traceEntryNode);
100
- traceEntryNode.depth = depth;
101
- if (indexStack.length === 1) {
102
- // First call in the stack is a root call.
103
- finalizedData.profileTree?.roots.add(traceEntryNode);
104
- }
105
- }
106
- function closeFrameCallback(_depth, _node, _sampleIndex, _timeStampMillis, durMs, selfTimeMs) {
107
- const profileCallIndex = indexStack.pop();
108
- const profileCall = profileCallIndex !== undefined && finalizedData.profileCalls[profileCallIndex];
109
- if (!profileCall) {
110
- return;
111
- }
112
- const { callFrame, ts, pid, tid } = profileCall;
113
- const traceEntryNode = entryToNode.get(profileCall);
114
- if (callFrame === undefined || ts === undefined || pid === undefined || selectedProfileId === undefined ||
115
- tid === undefined || traceEntryNode === undefined) {
116
- return;
117
- }
118
- const dur = Helpers.Timing.milliToMicro(Types.Timing.Milli(durMs));
119
- const selfTime = Helpers.Timing.milliToMicro(Types.Timing.Milli(selfTimeMs));
120
- profileCall.dur = dur;
121
- traceEntryNode.selfTime = selfTime;
122
- const parentIndex = indexStack.at(-1);
123
- const parent = parentIndex !== undefined && finalizedData.profileCalls.at(parentIndex);
124
- const parentNode = parent && entryToNode.get(parent);
125
- if (!parentNode) {
126
- return;
127
- }
128
- traceEntryNode.parent = parentNode;
129
- parentNode.children.push(traceEntryNode);
130
- }
131
- }
132
- }
133
- }
134
- }
135
- export function reset() {
136
- preprocessedData = new Map();
137
- profilesInProcess = new Map();
138
- entryToNode = new Map();
139
- }
140
- export function handleEvent(event) {
141
- /**
142
- * A fake trace event created to support CDP.Profiler.Profiles in the
143
- * trace engine.
144
- */
145
- if (Types.Events.isSyntheticCpuProfile(event)) {
146
- // At the moment we are attaching to a single node target so we
147
- // should only get a single CPU profile. The values of the process
148
- // id and thread id are not really important, so we use the data
149
- // in the fake event. Should multi-thread CPU profiling be supported
150
- // we could use these fields in the event to pass thread info.
151
- const profileData = getOrCreatePreProcessedData(event.pid, event.id);
152
- profileData.rawProfile = event.args.data.cpuProfile;
153
- profileData.threadId = event.tid;
154
- return;
155
- }
156
- if (Types.Events.isProfile(event)) {
157
- // Do not use event.args.data.startTime as it is in CLOCK_MONOTONIC domain,
158
- // but use profileEvent.ts which has been translated to Perfetto's clock
159
- // domain. Also convert from ms to us.
160
- // Note: events are collected on a different thread than what's sampled.
161
- // The correct process and thread ids are specified by the profile.
162
- const profileData = getOrCreatePreProcessedData(event.pid, event.id);
163
- profileData.rawProfile.startTime = event.ts;
164
- profileData.threadId = event.tid;
165
- assignProfileSourceIfKnown(profileData, event.args?.data?.source);
166
- return;
167
- }
168
- if (Types.Events.isProfileChunk(event)) {
169
- const profileData = getOrCreatePreProcessedData(event.pid, event.id);
170
- const cdpProfile = profileData.rawProfile;
171
- const nodesAndSamples = event.args?.data?.cpuProfile || { samples: [] };
172
- const samples = nodesAndSamples?.samples || [];
173
- const traceIds = event.args?.data?.cpuProfile?.trace_ids;
174
- for (const n of nodesAndSamples?.nodes || []) {
175
- const lineNumber = typeof n.callFrame.lineNumber === 'undefined' ? -1 : n.callFrame.lineNumber;
176
- const columnNumber = typeof n.callFrame.columnNumber === 'undefined' ? -1 : n.callFrame.columnNumber;
177
- const scriptId = String(n.callFrame.scriptId);
178
- const url = n.callFrame.url || '';
179
- const node = {
180
- ...n,
181
- callFrame: {
182
- ...n.callFrame,
183
- url,
184
- lineNumber,
185
- columnNumber,
186
- scriptId,
187
- },
188
- };
189
- cdpProfile.nodes.push(node);
190
- }
191
- const timeDeltas = event.args.data?.timeDeltas || [];
192
- const lines = event.args.data?.lines || Array(samples.length).fill(0);
193
- const columns = event.args.data?.columns || Array(samples.length).fill(0);
194
- cdpProfile.samples?.push(...samples);
195
- cdpProfile.timeDeltas?.push(...timeDeltas);
196
- cdpProfile.lines?.push(...lines);
197
- cdpProfile.columns?.push(...columns);
198
- if (traceIds) {
199
- cdpProfile.traceIds ??= {};
200
- for (const key in traceIds) {
201
- cdpProfile.traceIds[key] = traceIds[key];
202
- }
203
- }
204
- if (cdpProfile.samples && cdpProfile.timeDeltas && cdpProfile.samples.length !== cdpProfile.timeDeltas.length) {
205
- console.error('Failed to parse CPU profile.');
206
- return;
207
- }
208
- if (!cdpProfile.endTime && cdpProfile.timeDeltas) {
209
- const timeDeltas = cdpProfile.timeDeltas;
210
- cdpProfile.endTime = timeDeltas.reduce((x, y) => x + y, cdpProfile.startTime);
211
- }
212
- assignProfileSourceIfKnown(profileData, event.args?.data?.source);
213
- return;
214
- }
215
- }
216
- export async function finalize(parseOptions = {}) {
217
- parseCPUProfileData(parseOptions);
218
- }
219
- function assignProfileSourceIfKnown(profileData, source) {
220
- if (Types.Events.VALID_PROFILE_SOURCES.includes(source)) {
221
- profileData.source = source;
222
- }
223
- }
224
- export function data() {
225
- return {
226
- profilesInProcess,
227
- entryToNode,
228
- };
229
- }
230
- function getOrCreatePreProcessedData(processId, profileId) {
231
- const profileById = Platform.MapUtilities.getWithDefault(preprocessedData, processId, () => new Map());
232
- return Platform.MapUtilities.getWithDefault(profileById, profileId, () => ({
233
- rawProfile: {
234
- startTime: 0,
235
- endTime: 0,
236
- nodes: [],
237
- samples: [],
238
- timeDeltas: [],
239
- lines: [],
240
- columns: [],
241
- },
242
- profileId,
243
- }));
244
- }
245
- /**
246
- * Returns the name of a function for a given synthetic profile call.
247
- * We first look to find the ProfileNode representing this call, and use its
248
- * function name. This is preferred (and should always exist) because if we
249
- * resolve sourcemaps, we will update this name. If that name is not present,
250
- * we fall back to the function name that was in the callframe that we got
251
- * when parsing the profile's trace data.
252
- */
253
- export function getProfileCallFunctionName(data, entry) {
254
- const profile = data.profilesInProcess.get(entry.pid)?.get(entry.tid);
255
- const node = profile?.parsedProfile.nodeById(entry.nodeId);
256
- if (node?.functionName) {
257
- return node.functionName;
258
- }
259
- return entry.callFrame.functionName;
260
- }
261
- //# sourceMappingURL=SamplesHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SamplesHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/SamplesHandler.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAE/D,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAC/D,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,IAAI,iBAAiB,GACjB,IAAI,GAAG,EAAmE,CAAC;AAC/E,IAAI,WAAW,GACX,IAAI,GAAG,EAA0D,CAAC;AAEtE,2DAA2D;AAC3D,6DAA6D;AAC7D,sEAAsE;AACtE,uEAAuE;AACvE,sEAAsE;AACtE,mDAAmD;AACnD,uEAAuE;AACvE,uEAAuE;AACvE,+BAA+B;AAC/B,IAAI,gBAAgB,GAAG,IAAI,GAAG,EAAyE,CAAC;AAExG;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,2BAA2B,GAAG;IAClC,UAAU,EAAE,CAAC,WAAW,CAAiC;IACzD,gBAAgB,EAAE,CAAC,UAAU,EAAE,WAAW,CAAiC;CAC5E,CAAC;AAEF,SAAS,mBAAmB,CAAC,YAA8C;IACzE,MAAM,YAAY,GACd,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,2BAA2B,CAAC,UAAU,CAAC,CAAC,CAAC,2BAA2B,CAAC,gBAAgB,CAAC;IAEtH,KAAK,MAAM,CAAC,SAAS,EAAE,QAAQ,CAA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,iBAAiB;QACjB,WAAW;KACZ,CAAC;AACJ,CAAC;AAED,SAAS,2BAA2B,CAChC,SAAiC,EAAE,SAAiC;IACtE,MAAM,WAAW,GAAG,QAAQ,CAAC,YAAY,CAAC,cAAc,CAAC,gBAAgB,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;IACvG,OAAO,QAAQ,CAAC,YAAY,CAAC,cAAc,CACvC,WAAW,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;QACL,UAAU,EAAE;YACV,SAAS,EAAE,CAAC;YACZ,OAAO,EAAE,CAAC;YACV,KAAK,EAAE,EAAE;YACT,OAAO,EAAE,EAAE;YACX,UAAU,EAAE,EAAE;YACd,KAAK,EAAE,EAAE;YACT,OAAO,EAAE,EAAE;SACZ;QACD,SAAS;KACV,CAAC,CAAC,CAAC;AAClC,CAAC;AAsCD;;;;;;;GAOG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAwB,EAAE,KAAwC;IAC3G,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtE,MAAM,IAAI,GAAG,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3D,IAAI,IAAI,EAAE,YAAY,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IACD,OAAO,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC;AACtC,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport * as CPUProfile from '../../cpu_profile/cpu_profile.js';\nimport * as Helpers from '../helpers/helpers.js';\nimport * as Types from '../types/types.js';\n\nlet profilesInProcess: Map<Types.Events.ProcessID, Map<Types.Events.ThreadID, ProfileData>> =\n new Map<Types.Events.ProcessID, Map<Types.Events.ThreadID, ProfileData>>();\nlet entryToNode: Map<Types.Events.Event, Helpers.TreeHelpers.TraceEntryNode> =\n new Map<Types.Events.Event, Helpers.TreeHelpers.TraceEntryNode>();\n\n// The profile head, containing its metadata like its start\n// time, comes in a \"Profile\" event. The sample data comes in\n// \"ProfileChunk\" events. We match these ProfileChunks with their head\n// using process and profile ids. However, in order to integrate sample\n// data with trace data, we need the thread id that owns each profile.\n// This thread id is extracted from the head event.\n// For this reason, we have a preprocessed data structure, where events\n// are matched by profile id, which we then finish processing to export\n// events matched by thread id.\nlet preprocessedData = new Map<Types.Events.ProcessID, Map<Types.Events.ProfileID, PreprocessedData>>();\n\n/**\n * Profile source selection priority when multiple profiles exist for the same thread.\n *\n * Profile sources and their typical scenarios:\n * - 'Internal': Browser-initiated profiling performance panel traces.\n * This is the profiling mechanism when users click \"Record\" in the Devtools UI.\n * - 'Inspector': User-initiated via console.profile()/profileEnd() calls.\n * Represents explicit developer intent to profile specific code.\n * - 'SelfProfiling': Page-initiated via JS Self-Profiling API.\n * Lower signal vs the two above; treated as fallback.\n *\n * Selection strategy:\n * - CPU Profile mode: Prefer 'Inspector' (explicit user request).\n * - Performance trace: Prefer 'Internal' (integrated timeline context), then 'Inspector'.\n * - Sources not in the priority list (including 'SelfProfiling') act as fallbacks.\n * When no priority source matches, the first candidate profile is selected.\n */\nconst PROFILE_SOURCES_BY_PRIORITY = {\n cpuProfile: ['Inspector'] as Types.Events.ProfileSource[],\n performanceTrace: ['Internal', 'Inspector'] as Types.Events.ProfileSource[],\n};\n\nfunction parseCPUProfileData(parseOptions: Types.Configuration.ParseOptions): void {\n const priorityList =\n parseOptions.isCPUProfile ? PROFILE_SOURCES_BY_PRIORITY.cpuProfile : PROFILE_SOURCES_BY_PRIORITY.performanceTrace;\n\n for (const [processId, profiles] of preprocessedData) {\n const profilesByThread =\n new Map<Types.Events.ThreadID, Array<{id: Types.Events.ProfileID, data: PreprocessedData}>>();\n for (const [profileId, preProcessedData] of profiles) {\n const threadId = preProcessedData.threadId;\n if (threadId === undefined) {\n continue;\n }\n const listForThread = Platform.MapUtilities.getWithDefault(profilesByThread, threadId, () => []);\n listForThread.push({id: profileId, data: preProcessedData});\n }\n\n for (const [threadId, candidates] of profilesByThread) {\n if (!candidates.length) {\n continue;\n }\n let chosen = candidates[0];\n for (const source of priorityList) {\n const match = candidates.find(p => p.data.source === source);\n if (match) {\n chosen = match;\n break;\n }\n }\n const chosenData = chosen.data;\n if (!chosenData.rawProfile.nodes.length) {\n continue;\n }\n const indexStack: number[] = [];\n\n const profileModel = new CPUProfile.CPUProfileDataModel.CPUProfileDataModel(chosenData.rawProfile);\n const profileTree = Helpers.TreeHelpers.makeEmptyTraceEntryTree();\n profileTree.maxDepth = profileModel.maxDepth;\n\n const selectedProfileId = chosen.id;\n const finalizedData: ProfileData = {\n rawProfile: chosenData.rawProfile,\n parsedProfile: profileModel,\n profileCalls: [],\n profileTree,\n profileId: selectedProfileId,\n };\n const dataByThread = Platform.MapUtilities.getWithDefault(profilesInProcess, processId, () => new Map());\n dataByThread.set(threadId, finalizedData);\n\n // Only need to build pure JS ProfileCalls if we're parsing a CPU Profile, otherwise SamplesIntegrator does the work.\n if (parseOptions.isCPUProfile) {\n buildProfileCallsForCPUProfile();\n }\n\n function buildProfileCallsForCPUProfile(): void {\n profileModel.forEachFrame(openFrameCallback, closeFrameCallback);\n\n function openFrameCallback(\n depth: number, node: CPUProfile.ProfileTreeModel.ProfileNode, sampleIndex: number,\n timeStampMilliseconds: number): void {\n if (threadId === undefined) {\n return;\n }\n const ts = Helpers.Timing.milliToMicro(Types.Timing.Milli(timeStampMilliseconds));\n const nodeId = node.id as Helpers.TreeHelpers.TraceEntryNodeId;\n\n const profileCall =\n Helpers.Trace.makeProfileCall(node, selectedProfileId, sampleIndex, ts, processId, threadId);\n finalizedData.profileCalls.push(profileCall);\n indexStack.push(finalizedData.profileCalls.length - 1);\n const traceEntryNode = Helpers.TreeHelpers.makeEmptyTraceEntryNode(profileCall, nodeId);\n entryToNode.set(profileCall, traceEntryNode);\n traceEntryNode.depth = depth;\n if (indexStack.length === 1) {\n // First call in the stack is a root call.\n finalizedData.profileTree?.roots.add(traceEntryNode);\n }\n }\n function closeFrameCallback(\n _depth: number, _node: CPUProfile.ProfileTreeModel.ProfileNode, _sampleIndex: number,\n _timeStampMillis: number, durMs: number, selfTimeMs: number): void {\n const profileCallIndex = indexStack.pop();\n const profileCall = profileCallIndex !== undefined && finalizedData.profileCalls[profileCallIndex];\n if (!profileCall) {\n return;\n }\n const {callFrame, ts, pid, tid} = profileCall;\n const traceEntryNode = entryToNode.get(profileCall);\n if (callFrame === undefined || ts === undefined || pid === undefined || selectedProfileId === undefined ||\n tid === undefined || traceEntryNode === undefined) {\n return;\n }\n const dur = Helpers.Timing.milliToMicro(Types.Timing.Milli(durMs));\n const selfTime = Helpers.Timing.milliToMicro(Types.Timing.Milli(selfTimeMs));\n profileCall.dur = dur;\n traceEntryNode.selfTime = selfTime;\n\n const parentIndex = indexStack.at(-1);\n const parent = parentIndex !== undefined && finalizedData.profileCalls.at(parentIndex);\n const parentNode = parent && entryToNode.get(parent);\n if (!parentNode) {\n return;\n }\n traceEntryNode.parent = parentNode;\n parentNode.children.push(traceEntryNode);\n }\n }\n }\n }\n}\n\nexport function reset(): void {\n preprocessedData = new Map();\n profilesInProcess = new Map();\n entryToNode = new Map();\n}\n\nexport function handleEvent(event: Types.Events.Event): void {\n /**\n * A fake trace event created to support CDP.Profiler.Profiles in the\n * trace engine.\n */\n if (Types.Events.isSyntheticCpuProfile(event)) {\n // At the moment we are attaching to a single node target so we\n // should only get a single CPU profile. The values of the process\n // id and thread id are not really important, so we use the data\n // in the fake event. Should multi-thread CPU profiling be supported\n // we could use these fields in the event to pass thread info.\n const profileData = getOrCreatePreProcessedData(event.pid, event.id);\n profileData.rawProfile = event.args.data.cpuProfile;\n profileData.threadId = event.tid;\n return;\n }\n\n if (Types.Events.isProfile(event)) {\n // Do not use event.args.data.startTime as it is in CLOCK_MONOTONIC domain,\n // but use profileEvent.ts which has been translated to Perfetto's clock\n // domain. Also convert from ms to us.\n // Note: events are collected on a different thread than what's sampled.\n // The correct process and thread ids are specified by the profile.\n const profileData = getOrCreatePreProcessedData(event.pid, event.id);\n profileData.rawProfile.startTime = event.ts;\n profileData.threadId = event.tid;\n assignProfileSourceIfKnown(profileData, event.args?.data?.source);\n return;\n }\n if (Types.Events.isProfileChunk(event)) {\n const profileData = getOrCreatePreProcessedData(event.pid, event.id);\n const cdpProfile = profileData.rawProfile;\n const nodesAndSamples: Types.Events.PartialProfile = event.args?.data?.cpuProfile || {samples: []};\n const samples = nodesAndSamples?.samples || [];\n const traceIds = event.args?.data?.cpuProfile?.trace_ids;\n for (const n of nodesAndSamples?.nodes || []) {\n const lineNumber = typeof n.callFrame.lineNumber === 'undefined' ? -1 : n.callFrame.lineNumber;\n const columnNumber = typeof n.callFrame.columnNumber === 'undefined' ? -1 : n.callFrame.columnNumber;\n\n const scriptId = String(n.callFrame.scriptId) as Protocol.Runtime.ScriptId;\n const url = n.callFrame.url || '';\n const node = {\n ...n,\n callFrame: {\n ...n.callFrame,\n url,\n lineNumber,\n columnNumber,\n scriptId,\n },\n };\n cdpProfile.nodes.push(node);\n }\n\n const timeDeltas = event.args.data?.timeDeltas || [];\n const lines = event.args.data?.lines || Array(samples.length).fill(0);\n const columns = event.args.data?.columns || Array(samples.length).fill(0);\n cdpProfile.samples?.push(...samples);\n cdpProfile.timeDeltas?.push(...timeDeltas);\n cdpProfile.lines?.push(...lines);\n cdpProfile.columns?.push(...columns);\n\n if (traceIds) {\n cdpProfile.traceIds ??= {};\n for (const key in traceIds) {\n cdpProfile.traceIds[key] = traceIds[key];\n }\n }\n\n if (cdpProfile.samples && cdpProfile.timeDeltas && cdpProfile.samples.length !== cdpProfile.timeDeltas.length) {\n console.error('Failed to parse CPU profile.');\n return;\n }\n if (!cdpProfile.endTime && cdpProfile.timeDeltas) {\n const timeDeltas: number[] = cdpProfile.timeDeltas;\n cdpProfile.endTime = timeDeltas.reduce((x, y) => x + y, cdpProfile.startTime);\n }\n assignProfileSourceIfKnown(profileData, event.args?.data?.source);\n return;\n }\n}\n\nexport async function finalize(parseOptions: Types.Configuration.ParseOptions = {}): Promise<void> {\n parseCPUProfileData(parseOptions);\n}\n\nfunction assignProfileSourceIfKnown(profileData: PreprocessedData, source: unknown): void {\n if (Types.Events.VALID_PROFILE_SOURCES.includes(source as Types.Events.ProfileSource)) {\n profileData.source = source as Types.Events.ProfileSource;\n }\n}\n\nexport function data(): SamplesHandlerData {\n return {\n profilesInProcess,\n entryToNode,\n };\n}\n\nfunction getOrCreatePreProcessedData(\n processId: Types.Events.ProcessID, profileId: Types.Events.ProfileID): PreprocessedData {\n const profileById = Platform.MapUtilities.getWithDefault(preprocessedData, processId, () => new Map());\n return Platform.MapUtilities.getWithDefault<Types.Events.ProfileID, PreprocessedData>(\n profileById, profileId, () => ({\n rawProfile: {\n startTime: 0,\n endTime: 0,\n nodes: [],\n samples: [],\n timeDeltas: [],\n lines: [],\n columns: [],\n },\n profileId,\n }));\n}\n\nexport interface SamplesHandlerData {\n profilesInProcess: typeof profilesInProcess;\n entryToNode: typeof entryToNode;\n}\n\nexport interface ProfileData {\n profileId: Types.Events.ProfileID;\n rawProfile: CPUProfile.CPUProfileDataModel.ExtendedProfile;\n parsedProfile: CPUProfile.CPUProfileDataModel.CPUProfileDataModel;\n /**\n * Contains the calls built from the CPU profile samples.\n * Note: This doesn't contain real trace events coming from the\n * browser, only calls synthetically typed as trace events for\n * compatibility, as such it only makes sense to use them in pure CPU\n * profiles.\n *\n * If you need the profile calls from a CPU profile obtained from a\n * web trace, use the data exported by the RendererHandler instead.\n */\n profileCalls: Types.Events.SyntheticProfileCall[];\n /**\n * Contains the call tree built from the CPU profile samples.\n * Similar to the profileCalls field, this tree does not contain nor\n * take into account trace events, as such it only makes sense to use\n * them in pure CPU profiles.\n */\n profileTree?: Helpers.TreeHelpers.TraceEntryTree;\n}\n\ninterface PreprocessedData {\n rawProfile: CPUProfile.CPUProfileDataModel.ExtendedProfile;\n profileId: Types.Events.ProfileID;\n threadId?: Types.Events.ThreadID;\n source?: Types.Events.ProfileSource;\n}\n\n/**\n * Returns the name of a function for a given synthetic profile call.\n * We first look to find the ProfileNode representing this call, and use its\n * function name. This is preferred (and should always exist) because if we\n * resolve sourcemaps, we will update this name. If that name is not present,\n * we fall back to the function name that was in the callframe that we got\n * when parsing the profile's trace data.\n */\nexport function getProfileCallFunctionName(data: SamplesHandlerData, entry: Types.Events.SyntheticProfileCall): string {\n const profile = data.profilesInProcess.get(entry.pid)?.get(entry.tid);\n const node = profile?.parsedProfile.nodeById(entry.nodeId);\n if (node?.functionName) {\n return node.functionName;\n }\n return entry.callFrame.functionName;\n}\n"]}
@@ -1,56 +0,0 @@
1
- // Copyright 2022 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
- import * as Helpers from '../helpers/helpers.js';
5
- import * as Types from '../types/types.js';
6
- let legacyScreenshotEvents = [];
7
- let modernScreenshotEvents = [];
8
- let syntheticScreenshots = [];
9
- export function reset() {
10
- legacyScreenshotEvents = [];
11
- syntheticScreenshots = [];
12
- modernScreenshotEvents = [];
13
- }
14
- export function handleEvent(event) {
15
- if (Types.Events.isLegacyScreenshot(event)) {
16
- legacyScreenshotEvents.push(event);
17
- }
18
- else if (Types.Events.isScreenshot(event)) {
19
- modernScreenshotEvents.push(event);
20
- }
21
- }
22
- export async function finalize() {
23
- for (const snapshotEvent of legacyScreenshotEvents) {
24
- const { cat, name, ph, pid, tid } = snapshotEvent;
25
- const syntheticEvent = Helpers.SyntheticEvents.SyntheticEventsManager.registerSyntheticEvent({
26
- rawSourceEvent: snapshotEvent,
27
- cat,
28
- name,
29
- ph,
30
- pid,
31
- tid,
32
- // TODO(paulirish, crbug.com/41363012): fix snapshot timestamps.
33
- ts: snapshotEvent.ts,
34
- args: {
35
- dataUri: `data:image/jpg;base64,${snapshotEvent.args.snapshot}`,
36
- },
37
- });
38
- syntheticScreenshots.push(syntheticEvent);
39
- }
40
- }
41
- export function screenshotImageDataUri(event) {
42
- if (Types.Events.isLegacySyntheticScreenshot(event)) {
43
- return event.args.dataUri;
44
- }
45
- return `data:image/jpg;base64,${event.args.snapshot}`;
46
- }
47
- export function data() {
48
- return {
49
- legacySyntheticScreenshots: syntheticScreenshots.length ? syntheticScreenshots : null,
50
- screenshots: modernScreenshotEvents.length ? modernScreenshotEvents : null,
51
- };
52
- }
53
- export function deps() {
54
- return ['Meta'];
55
- }
56
- //# sourceMappingURL=ScreenshotsHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ScreenshotsHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/ScreenshotsHandler.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAI3C,IAAI,sBAAsB,GAAoC,EAAE,CAAC;AACjE,IAAI,sBAAsB,GAA8B,EAAE,CAAC;AAC3D,IAAI,oBAAoB,GAA6C,EAAE,CAAC;AAExE,MAAM,UAAU,KAAK;IACnB,sBAAsB,GAAG,EAAE,CAAC;IAC5B,oBAAoB,GAAG,EAAE,CAAC;IAC1B,sBAAsB,GAAG,EAAE,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAyB;IACnD,IAAI,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3C,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;SAAM,IAAI,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5C,sBAAsB,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this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Helpers from '../helpers/helpers.js';\nimport * as Types from '../types/types.js';\n\nimport type {HandlerName} from './types.js';\n\nlet legacyScreenshotEvents: Types.Events.LegacyScreenshot[] = [];\nlet modernScreenshotEvents: Types.Events.Screenshot[] = [];\nlet syntheticScreenshots: Types.Events.LegacySyntheticScreenshot[] = [];\n\nexport function reset(): void {\n legacyScreenshotEvents = [];\n syntheticScreenshots = [];\n modernScreenshotEvents = [];\n}\n\nexport function handleEvent(event: Types.Events.Event): void {\n if (Types.Events.isLegacyScreenshot(event)) {\n legacyScreenshotEvents.push(event);\n } else if (Types.Events.isScreenshot(event)) {\n modernScreenshotEvents.push(event);\n }\n}\n\nexport async function finalize(): Promise<void> {\n for (const snapshotEvent of legacyScreenshotEvents) {\n const {cat, name, ph, pid, tid} = snapshotEvent;\n const syntheticEvent =\n Helpers.SyntheticEvents.SyntheticEventsManager.registerSyntheticEvent<Types.Events.LegacySyntheticScreenshot>({\n rawSourceEvent: snapshotEvent,\n cat,\n name,\n ph,\n pid,\n tid,\n // TODO(paulirish, crbug.com/41363012): fix snapshot timestamps.\n ts: snapshotEvent.ts,\n args: {\n dataUri: `data:image/jpg;base64,${snapshotEvent.args.snapshot}`,\n },\n });\n syntheticScreenshots.push(syntheticEvent);\n }\n}\n\nexport function screenshotImageDataUri(event: Types.Events.LegacySyntheticScreenshot|Types.Events.Screenshot): string {\n if (Types.Events.isLegacySyntheticScreenshot(event)) {\n return event.args.dataUri;\n }\n return `data:image/jpg;base64,${event.args.snapshot}`;\n}\n\nexport interface Data {\n // These are nullable because in January 2025 a CL in Chromium\n // crrev.com/c/6197645 landed which changed the format of screenshots. For a\n // given trace, it can have either \"legacy\" screenshot events, or \"modern\"\n // screenshot events, but no trace can ever contain both.\n // So, if either of these arrays are empty, we instead return `null`. This forces consumers to check the presence of the array.\n // Traces can have no screenshots if the trace category is not enabled, so it\n // is possible for a trace to return null for both of these arrays.\n legacySyntheticScreenshots: Types.Events.LegacySyntheticScreenshot[]|null;\n screenshots: Types.Events.Screenshot[]|null;\n}\n\nexport function data(): Data {\n return {\n legacySyntheticScreenshots: syntheticScreenshots.length ? syntheticScreenshots : null,\n screenshots: modernScreenshotEvents.length ? modernScreenshotEvents : null,\n };\n}\n\nexport function deps(): HandlerName[] {\n return ['Meta'];\n}\n"]}
@@ -1,286 +0,0 @@
1
- // Copyright 2025 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
- import * as Platform from '../../../core/platform/platform.js';
5
- import * as Types from '../types/types.js';
6
- import { data as metaHandlerData } from './MetaHandler.js';
7
- import { data as networkRequestsHandlerData } from './NetworkRequestsHandler.js';
8
- function completeURL(base, url) {
9
- if (url.startsWith('data:') || url.startsWith('blob:') || url.startsWith('javascript:') || url.startsWith('mailto:')) {
10
- return url;
11
- }
12
- try {
13
- return new URL(url, base).href;
14
- }
15
- catch { }
16
- return null;
17
- }
18
- let scriptById = new Map();
19
- let frameIdByIsolate = new Map();
20
- export function deps() {
21
- return ['Meta', 'NetworkRequests'];
22
- }
23
- export function reset() {
24
- scriptById = new Map();
25
- frameIdByIsolate = new Map();
26
- }
27
- export function handleEvent(event) {
28
- const getOrMakeScript = (isolate, scriptIdAsNumber) => {
29
- const scriptId = String(scriptIdAsNumber);
30
- const key = `${isolate}.${scriptId}`;
31
- return Platform.MapUtilities.getWithDefault(scriptById, key, () => ({ isolate, scriptId, frame: '', ts: event.ts }));
32
- };
33
- if (Types.Events.isRundownScriptCompiled(event) && event.args.data) {
34
- const { isolate, scriptId, frame } = event.args.data;
35
- const script = getOrMakeScript(isolate, scriptId);
36
- script.frame = frame;
37
- script.ts = event.ts;
38
- return;
39
- }
40
- if (Types.Events.isRundownScript(event)) {
41
- const { isolate, scriptId, url, sourceUrl, sourceMapUrl, sourceMapUrlElided } = event.args.data;
42
- const script = getOrMakeScript(isolate, scriptId);
43
- if (!script.frame) {
44
- script.frame = frameIdByIsolate.get(String(isolate)) ?? '';
45
- }
46
- script.url = url;
47
- script.ts = event.ts;
48
- if (sourceUrl) {
49
- script.sourceUrl = sourceUrl;
50
- }
51
- // Older traces may have data source map urls. Those can be very large, so a change
52
- // was made to elide them from the trace.
53
- // If elided, a fresh trace will fetch the source map from the Script model
54
- // (see TimelinePanel getExistingSourceMap). If not fresh, the source map is resolved
55
- // instead in this handler via `findCachedRawSourceMap`.
56
- if (sourceMapUrlElided) {
57
- script.sourceMapUrlElided = true;
58
- }
59
- else if (sourceMapUrl) {
60
- script.sourceMapUrl = sourceMapUrl;
61
- }
62
- return;
63
- }
64
- if (Types.Events.isRundownScriptSource(event)) {
65
- const { isolate, scriptId, sourceText } = event.args.data;
66
- const script = getOrMakeScript(isolate, scriptId);
67
- script.content = sourceText;
68
- return;
69
- }
70
- if (Types.Events.isRundownScriptSourceLarge(event)) {
71
- const { isolate, scriptId, sourceText } = event.args.data;
72
- const script = getOrMakeScript(isolate, scriptId);
73
- script.content = (script.content ?? '') + sourceText;
74
- return;
75
- }
76
- // Setup frameIdByIsolate, which is used only in the case that we are missing
77
- // rundown events for a script. We won't get a frame association from the rundown
78
- // events if the recording started only after the script was first compiled. In
79
- // that scenario, derive the frame via the isolate / FunctionCall events.
80
- // TODO: ideally, we put the frame on ScriptCatchup event. So much easier. This approach has some
81
- // issues.
82
- if (Types.Events.isFunctionCall(event) && event.args.data?.isolate && event.args.data.frame) {
83
- const { isolate, frame } = event.args.data;
84
- const existingValue = frameIdByIsolate.get(isolate);
85
- if (existingValue !== frame) {
86
- frameIdByIsolate.set(isolate, frame);
87
- // Update the scripts we discovered but without knowing their frame.
88
- for (const script of scriptById.values()) {
89
- if (!script.frame && script.isolate === isolate) {
90
- script.frame = frame;
91
- }
92
- }
93
- }
94
- }
95
- }
96
- function findFrame(meta, frameId) {
97
- for (const frames of meta.frameByProcessId?.values()) {
98
- const frame = frames.get(frameId);
99
- if (frame) {
100
- return frame;
101
- }
102
- }
103
- return null;
104
- }
105
- function findNetworkRequest(networkRequests, script) {
106
- if (!script.url) {
107
- return null;
108
- }
109
- return networkRequests.find(request => request.args.data.url === script.url) ?? null;
110
- }
111
- function computeMappingEndColumns(map) {
112
- const result = new Map();
113
- const mappings = map.mappings();
114
- for (let i = 0; i < mappings.length - 1; i++) {
115
- const mapping = mappings[i];
116
- const nextMapping = mappings[i + 1];
117
- if (mapping.lineNumber === nextMapping.lineNumber) {
118
- result.set(mapping, nextMapping.columnNumber);
119
- }
120
- }
121
- // Now, all but the last mapping on each line will have a value in this map.
122
- return result;
123
- }
124
- /**
125
- * Using a script's contents and source map, attribute every generated byte to an authored source file.
126
- */
127
- function computeGeneratedFileSizes(script) {
128
- if (!script.sourceMap) {
129
- throw new Error('expected source map');
130
- }
131
- const map = script.sourceMap;
132
- const content = script.content ?? '';
133
- const contentLength = content.length;
134
- const lines = content.split('\n');
135
- const files = {};
136
- const totalBytes = contentLength;
137
- let unmappedBytes = totalBytes;
138
- const mappingEndCols = computeMappingEndColumns(script.sourceMap);
139
- for (const mapping of map.mappings()) {
140
- const source = mapping.sourceURL;
141
- const lineNum = mapping.lineNumber;
142
- const colNum = mapping.columnNumber;
143
- const lastColNum = mappingEndCols.get(mapping);
144
- // Webpack sometimes emits null mappings.
145
- // https://github.com/mozilla/source-map/pull/303
146
- if (!source) {
147
- continue;
148
- }
149
- // Lines and columns are zero-based indices. Visually, lines are shown as a 1-based index.
150
- const line = lines[lineNum];
151
- if (line === null || line === undefined) {
152
- const errorMessage = `${map.url()} mapping for line out of bounds: ${lineNum + 1}`;
153
- return { errorMessage };
154
- }
155
- if (colNum > line.length) {
156
- const errorMessage = `${map.url()} mapping for column out of bounds: ${lineNum + 1}:${colNum}`;
157
- return { errorMessage };
158
- }
159
- let mappingLength = 0;
160
- if (lastColNum !== undefined) {
161
- if (lastColNum > line.length) {
162
- const errorMessage = `${map.url()} mapping for last column out of bounds: ${lineNum + 1}:${lastColNum}`;
163
- return { errorMessage };
164
- }
165
- mappingLength = lastColNum - colNum;
166
- }
167
- else {
168
- // Add +1 to account for the newline.
169
- mappingLength = line.length - colNum + 1;
170
- }
171
- files[source] = (files[source] || 0) + mappingLength;
172
- unmappedBytes -= mappingLength;
173
- }
174
- return {
175
- files,
176
- unmappedBytes,
177
- totalBytes,
178
- };
179
- }
180
- export function getScriptGeneratedSizes(script) {
181
- if (script.sourceMap && !script.sizes) {
182
- script.sizes = computeGeneratedFileSizes(script);
183
- }
184
- return script.sizes ?? null;
185
- }
186
- function findCachedRawSourceMap(script, options) {
187
- if (options.isFreshRecording || !options.metadata?.sourceMaps) {
188
- // Exit if this is not a loaded trace w/ source maps in the metadata.
189
- return;
190
- }
191
- // For elided data url source maps, search the metadata source maps by script url.
192
- if (script.sourceMapUrlElided) {
193
- if (!script.url) {
194
- return;
195
- }
196
- const cachedSourceMap = options.metadata.sourceMaps.find(m => m.url === script.url);
197
- if (cachedSourceMap) {
198
- return cachedSourceMap.sourceMap;
199
- }
200
- return;
201
- }
202
- if (!script.sourceMapUrl) {
203
- return;
204
- }
205
- // Otherwise, search by source map url.
206
- // Note: early enhanced traces may have this field set for data urls. Ignore those,
207
- // as they were never stored in metadata sourcemap.
208
- const isDataUrl = script.sourceMapUrl.startsWith('data:');
209
- if (!isDataUrl) {
210
- const cachedSourceMap = options.metadata.sourceMaps.find(m => m.sourceMapUrl === script.sourceMapUrl);
211
- if (cachedSourceMap) {
212
- return cachedSourceMap.sourceMap;
213
- }
214
- }
215
- return;
216
- }
217
- export async function finalize(options) {
218
- const meta = metaHandlerData();
219
- const networkRequests = [...networkRequestsHandlerData().byId.values()];
220
- const documentUrls = new Set();
221
- for (const frames of meta.frameByProcessId.values()) {
222
- for (const frame of frames.values()) {
223
- documentUrls.add(frame.url);
224
- }
225
- }
226
- for (const script of scriptById.values()) {
227
- script.request = findNetworkRequest(networkRequests, script) ?? undefined;
228
- script.inline = !!script.url && documentUrls.has(script.url);
229
- }
230
- if (!options.resolveSourceMap) {
231
- return;
232
- }
233
- const promises = [];
234
- for (const script of scriptById.values()) {
235
- // No frame or url means the script came from somewhere we don't care about.
236
- // Note: scripts from inline <SCRIPT> elements use the url of the HTML document,
237
- // so aren't ignored.
238
- if (!script.frame || !script.url || (!script.sourceMapUrl && !script.sourceMapUrlElided)) {
239
- continue;
240
- }
241
- const frameUrl = findFrame(meta, script.frame)?.url;
242
- if (!frameUrl) {
243
- continue;
244
- }
245
- // If there is a `sourceURL` magic comment, resolve the compiledUrl against the frame url.
246
- // example: `// #sourceURL=foo.js` for target frame https://www.example.com/home -> https://www.example.com/home/foo.js
247
- let sourceUrl = script.url;
248
- if (script.sourceUrl) {
249
- sourceUrl = completeURL(frameUrl, script.sourceUrl) ?? script.sourceUrl;
250
- }
251
- let sourceMapUrl;
252
- if (script.sourceMapUrl) {
253
- // Resolve the source map url. The value given by v8 may be relative, so resolve it here.
254
- // This process should match the one in `SourceMapManager.attachSourceMap`.
255
- sourceMapUrl =
256
- completeURL(sourceUrl, script.sourceMapUrl);
257
- if (!sourceMapUrl) {
258
- continue;
259
- }
260
- script.sourceMapUrl = sourceMapUrl;
261
- }
262
- const params = {
263
- scriptId: script.scriptId,
264
- scriptUrl: script.url,
265
- sourceUrl: sourceUrl,
266
- sourceMapUrl: sourceMapUrl ?? '',
267
- frame: script.frame,
268
- cachedRawSourceMap: findCachedRawSourceMap(script, options),
269
- };
270
- const promise = options.resolveSourceMap(params).then(sourceMap => {
271
- if (sourceMap) {
272
- script.sourceMap = sourceMap;
273
- }
274
- });
275
- promises.push(promise.catch(e => {
276
- console.error('Uncaught error when resolving source map', params, e);
277
- }));
278
- }
279
- await Promise.all(promises);
280
- }
281
- export function data() {
282
- return {
283
- scripts: [...scriptById.values()],
284
- };
285
- }
286
- //# sourceMappingURL=ScriptsHandler.js.map