@paulirish/trace_engine 0.0.67-beta.2 → 0.0.68

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