@paulirish/trace_engine 0.0.67-beta.2 → 0.0.67

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 (759) 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.js +512 -0
  14. package/core/common/ParsedURL.js.map +1 -0
  15. package/core/common/common.d.ts +8 -33
  16. package/core/common/common.js +2 -0
  17. package/core/host/host.d.ts +1 -13
  18. package/core/host/host.js +1 -0
  19. package/core/i18n/i18n.d.ts +20 -8
  20. package/core/i18n/i18n.js +15 -0
  21. package/core/platform/ArrayUtilities.js +224 -0
  22. package/core/platform/ArrayUtilities.js.map +1 -0
  23. package/core/platform/Brand.js +5 -0
  24. package/core/platform/Brand.js.map +1 -0
  25. package/core/platform/Constructor.js +5 -0
  26. package/core/platform/Constructor.js.map +1 -0
  27. package/core/platform/DateUtilities.js +14 -0
  28. package/core/platform/DateUtilities.js.map +1 -0
  29. package/core/platform/DevToolsPath.js +28 -0
  30. package/core/platform/DevToolsPath.js.map +1 -0
  31. package/core/platform/HostRuntime.js +8 -0
  32. package/core/platform/HostRuntime.js.map +1 -0
  33. package/core/platform/KeyboardUtilities.js +34 -0
  34. package/core/platform/KeyboardUtilities.js.map +1 -0
  35. package/core/platform/MapUtilities.js +80 -0
  36. package/core/platform/MapUtilities.js.map +1 -0
  37. package/core/platform/MimeType.js +157 -0
  38. package/core/platform/MimeType.js.map +1 -0
  39. package/core/platform/NumberUtilities.js +73 -0
  40. package/core/platform/NumberUtilities.js.map +1 -0
  41. package/core/platform/Size.js +36 -0
  42. package/core/platform/Size.js.map +1 -0
  43. package/core/platform/StringUtilities.js +731 -0
  44. package/core/platform/StringUtilities.js.map +1 -0
  45. package/core/platform/Timing.js +10 -0
  46. package/core/platform/Timing.js.map +1 -0
  47. package/core/platform/TypedArrayUtilities.js +158 -0
  48. package/core/platform/TypedArrayUtilities.js.map +1 -0
  49. package/core/platform/TypescriptUtilities.js +17 -0
  50. package/core/platform/TypescriptUtilities.js.map +1 -0
  51. package/core/platform/UIString.d.ts +5 -2
  52. package/core/platform/UIString.js +5 -0
  53. package/core/platform/UIString.js.map +1 -0
  54. package/core/platform/UserVisibleError.d.ts +1 -12
  55. package/core/platform/UserVisibleError.js +23 -0
  56. package/core/platform/UserVisibleError.js.map +1 -0
  57. package/core/platform/api/HostRuntime.d.ts +1 -0
  58. package/core/platform/api/HostRuntime.js +5 -0
  59. package/core/platform/api/HostRuntime.js.map +1 -0
  60. package/core/platform/api/api-tsconfig.json +58 -0
  61. package/core/platform/api/api-tsconfig.ref.json +26 -0
  62. package/core/platform/api/api.js +6 -0
  63. package/core/platform/api/api.js.map +1 -0
  64. package/core/platform/bundle-tsconfig.json +59 -0
  65. package/core/platform/bundle-tsconfig.ref.json +27 -0
  66. package/core/platform/foundation_unittests-tsconfig.json +73 -0
  67. package/core/platform/foundation_unittests-tsconfig.ref.json +40 -0
  68. package/core/platform/foundation_unittests_node_typecheck-tsconfig.json +69 -0
  69. package/core/platform/platform-tsconfig.json +81 -0
  70. package/core/platform/platform-tsconfig.ref.json +49 -0
  71. package/core/platform/platform.js +28 -0
  72. package/core/platform/platform.js.map +1 -0
  73. package/core/platform/platform_node_typecheck-tsconfig.json +78 -0
  74. package/core/platform/platform_node_typecheck.stamp +0 -0
  75. package/core/root/root.d.ts +1 -4
  76. package/core/root/root.js +1 -0
  77. package/core/sdk/sdk.d.ts +27 -97
  78. package/core/sdk/sdk.js +1 -0
  79. package/generated/protocol.js +3304 -0
  80. package/locales/af.json +86 -92
  81. package/locales/am.json +350 -356
  82. package/locales/ar.json +351 -357
  83. package/locales/as.json +349 -355
  84. package/locales/az.json +340 -346
  85. package/locales/be.json +350 -356
  86. package/locales/bg.json +350 -356
  87. package/locales/bn.json +350 -356
  88. package/locales/bs.json +243 -249
  89. package/locales/ca.json +279 -285
  90. package/locales/cs.json +335 -341
  91. package/locales/cy.json +114 -120
  92. package/locales/da.json +199 -205
  93. package/locales/de.json +219 -225
  94. package/locales/el.json +335 -341
  95. package/locales/en-GB.json +8 -14
  96. package/locales/en-US.json +249 -252
  97. package/locales/en-XL.json +1055 -0
  98. package/locales/es-419.json +275 -281
  99. package/locales/es.json +276 -282
  100. package/locales/et.json +231 -237
  101. package/locales/eu.json +119 -125
  102. package/locales/fa.json +350 -356
  103. package/locales/fi.json +280 -286
  104. package/locales/fil.json +1 -7
  105. package/locales/fr-CA.json +307 -313
  106. package/locales/fr.json +304 -310
  107. package/locales/gl.json +259 -265
  108. package/locales/gu.json +351 -357
  109. package/locales/he.json +351 -357
  110. package/locales/hi.json +335 -341
  111. package/locales/hr.json +234 -240
  112. package/locales/hu.json +341 -347
  113. package/locales/hy.json +350 -356
  114. package/locales/id.json +2 -8
  115. package/locales/is.json +302 -308
  116. package/locales/it.json +136 -142
  117. package/locales/ja.json +350 -356
  118. package/locales/ka.json +351 -357
  119. package/locales/kk.json +351 -357
  120. package/locales/km.json +350 -356
  121. package/locales/kn.json +351 -357
  122. package/locales/ko.json +350 -356
  123. package/locales/ky.json +349 -355
  124. package/locales/lo.json +351 -357
  125. package/locales/lt.json +319 -325
  126. package/locales/lv.json +316 -322
  127. package/locales/mk.json +351 -357
  128. package/locales/ml.json +350 -356
  129. package/locales/mn.json +350 -356
  130. package/locales/mr.json +350 -356
  131. package/locales/ms.json +2 -8
  132. package/locales/my.json +349 -355
  133. package/locales/ne.json +335 -341
  134. package/locales/nl.json +61 -67
  135. package/locales/no.json +169 -175
  136. package/locales/or.json +350 -356
  137. package/locales/pa.json +350 -356
  138. package/locales/pl.json +306 -312
  139. package/locales/pt-PT.json +271 -277
  140. package/locales/pt.json +265 -271
  141. package/locales/ro.json +305 -311
  142. package/locales/ru.json +350 -356
  143. package/locales/si.json +351 -357
  144. package/locales/sk.json +332 -338
  145. package/locales/sl.json +214 -220
  146. package/locales/sq.json +315 -321
  147. package/locales/sr-Latn.json +252 -258
  148. package/locales/sr.json +351 -357
  149. package/locales/sv.json +275 -281
  150. package/locales/sw.json +2 -8
  151. package/locales/ta.json +351 -357
  152. package/locales/te.json +349 -355
  153. package/locales/th.json +351 -357
  154. package/locales/tr.json +325 -331
  155. package/locales/uk.json +350 -356
  156. package/locales/ur.json +351 -357
  157. package/locales/uz.json +159 -165
  158. package/locales/vi.json +351 -357
  159. package/locales/zh-HK.json +351 -357
  160. package/locales/zh-TW.json +350 -356
  161. package/locales/zh.json +350 -356
  162. package/locales/zu.json +2 -8
  163. package/models/cpu_profile/CPUProfileDataModel.js +517 -0
  164. package/models/cpu_profile/CPUProfileDataModel.js.map +1 -0
  165. package/models/cpu_profile/ProfileTreeModel.js +90 -0
  166. package/models/cpu_profile/ProfileTreeModel.js.map +1 -0
  167. package/models/cpu_profile/bundle-tsconfig.json +59 -0
  168. package/models/cpu_profile/bundle-tsconfig.ref.json +27 -0
  169. package/models/cpu_profile/cpu_profile-tsconfig.json +63 -0
  170. package/models/cpu_profile/cpu_profile-tsconfig.ref.json +31 -0
  171. package/models/cpu_profile/cpu_profile.js +7 -0
  172. package/models/cpu_profile/cpu_profile.js.map +1 -0
  173. package/models/cpu_profile/cpu_profile_node_typecheck-tsconfig.json +60 -0
  174. package/models/cpu_profile/cpu_profile_node_typecheck.stamp +0 -0
  175. package/models/cpu_profile/foundation_unittests-tsconfig.json +63 -0
  176. package/models/cpu_profile/foundation_unittests-tsconfig.ref.json +30 -0
  177. package/models/cpu_profile/foundation_unittests_node_typecheck-tsconfig.json +59 -0
  178. package/models/crux-manager/crux-manager.d.ts +3 -1
  179. package/models/crux-manager/crux-manager.js +1 -0
  180. package/models/trace/EntityMapper.js +133 -0
  181. package/models/trace/EntityMapper.js.map +1 -0
  182. package/models/trace/EventsSerializer.d.ts +1 -0
  183. package/models/trace/EventsSerializer.js +118 -0
  184. package/models/trace/EventsSerializer.js.map +1 -0
  185. package/models/trace/LanternComputationData.js +368 -0
  186. package/models/trace/LanternComputationData.js.map +1 -0
  187. package/models/trace/ModelImpl.js +181 -0
  188. package/models/trace/ModelImpl.js.map +1 -0
  189. package/models/trace/Name.js +115 -0
  190. package/models/trace/Name.js.map +1 -0
  191. package/models/trace/Processor.js +616 -0
  192. package/models/trace/Processor.js.map +1 -0
  193. package/models/trace/Styles.d.ts +2 -2
  194. package/models/trace/Styles.js +836 -0
  195. package/models/trace/Styles.js.map +1 -0
  196. package/models/trace/bundle-tsconfig.json +77 -0
  197. package/models/trace/bundle-tsconfig.ref.json +45 -0
  198. package/models/trace/extras/FilmStrip.js +45 -0
  199. package/models/trace/extras/FilmStrip.js.map +1 -0
  200. package/models/trace/extras/Initiators.js +47 -0
  201. package/models/trace/extras/Initiators.js.map +1 -0
  202. package/models/trace/extras/MainThreadActivity.js +77 -0
  203. package/models/trace/extras/MainThreadActivity.js.map +1 -0
  204. package/models/trace/extras/ScriptDuplication.js +163 -0
  205. package/models/trace/extras/ScriptDuplication.js.map +1 -0
  206. package/models/trace/extras/StackTraceForEvent.js +192 -0
  207. package/models/trace/extras/StackTraceForEvent.js.map +1 -0
  208. package/models/trace/extras/ThirdParties.js +119 -0
  209. package/models/trace/extras/ThirdParties.js.map +1 -0
  210. package/models/trace/extras/TraceFilter.js +51 -0
  211. package/models/trace/extras/TraceFilter.js.map +1 -0
  212. package/models/trace/extras/TraceTree.js +652 -0
  213. package/models/trace/extras/TraceTree.js.map +1 -0
  214. package/models/trace/extras/bundle-tsconfig.json +59 -0
  215. package/models/trace/extras/bundle-tsconfig.ref.json +27 -0
  216. package/models/trace/extras/extras-tsconfig.json +81 -0
  217. package/models/trace/extras/extras-tsconfig.ref.json +49 -0
  218. package/models/trace/extras/extras.js +12 -0
  219. package/models/trace/extras/extras.js.map +1 -0
  220. package/models/trace/extras/extras_node_typecheck-tsconfig.json +78 -0
  221. package/models/trace/extras/extras_node_typecheck.stamp +0 -0
  222. package/models/trace/extras/foundation_unittests-tsconfig.json +91 -0
  223. package/models/trace/extras/foundation_unittests-tsconfig.ref.json +58 -0
  224. package/models/trace/extras/foundation_unittests_node_typecheck-tsconfig.json +87 -0
  225. package/models/trace/foundation_unittests-tsconfig.json +70 -0
  226. package/models/trace/foundation_unittests-tsconfig.ref.json +37 -0
  227. package/models/trace/foundation_unittests_node_typecheck-tsconfig.json +66 -0
  228. package/models/trace/handlers/AnimationFramesHandler.js +110 -0
  229. package/models/trace/handlers/AnimationFramesHandler.js.map +1 -0
  230. package/models/trace/handlers/AnimationHandler.js +27 -0
  231. package/models/trace/handlers/AnimationHandler.js.map +1 -0
  232. package/models/trace/handlers/AsyncJSCallsHandler.js +188 -0
  233. package/models/trace/handlers/AsyncJSCallsHandler.js.map +1 -0
  234. package/models/trace/handlers/DOMStatsHandler.js +22 -0
  235. package/models/trace/handlers/DOMStatsHandler.js.map +1 -0
  236. package/models/trace/handlers/ExtensionTraceDataHandler.js +264 -0
  237. package/models/trace/handlers/ExtensionTraceDataHandler.js.map +1 -0
  238. package/models/trace/handlers/FlowsHandler.js +149 -0
  239. package/models/trace/handlers/FlowsHandler.js.map +1 -0
  240. package/models/trace/handlers/FramesHandler.js +491 -0
  241. package/models/trace/handlers/FramesHandler.js.map +1 -0
  242. package/models/trace/handlers/GPUHandler.js +36 -0
  243. package/models/trace/handlers/GPUHandler.js.map +1 -0
  244. package/models/trace/handlers/ImagePaintingHandler.js +148 -0
  245. package/models/trace/handlers/ImagePaintingHandler.js.map +1 -0
  246. package/models/trace/handlers/InitiatorsHandler.js +181 -0
  247. package/models/trace/handlers/InitiatorsHandler.js.map +1 -0
  248. package/models/trace/handlers/InvalidationsHandler.js +125 -0
  249. package/models/trace/handlers/InvalidationsHandler.js.map +1 -0
  250. package/models/trace/handlers/LargestImagePaintHandler.js +86 -0
  251. package/models/trace/handlers/LargestImagePaintHandler.js.map +1 -0
  252. package/models/trace/handlers/LargestTextPaintHandler.js +28 -0
  253. package/models/trace/handlers/LargestTextPaintHandler.js.map +1 -0
  254. package/models/trace/handlers/LayerTreeHandler.js +104 -0
  255. package/models/trace/handlers/LayerTreeHandler.js.map +1 -0
  256. package/models/trace/handlers/LayoutShiftsHandler.js +453 -0
  257. package/models/trace/handlers/LayoutShiftsHandler.js.map +1 -0
  258. package/models/trace/handlers/MemoryHandler.js +22 -0
  259. package/models/trace/handlers/MemoryHandler.js.map +1 -0
  260. package/models/trace/handlers/MetaHandler.js +442 -0
  261. package/models/trace/handlers/MetaHandler.js.map +1 -0
  262. package/models/trace/handlers/ModelHandlers.js +33 -0
  263. package/models/trace/handlers/ModelHandlers.js.map +1 -0
  264. package/models/trace/handlers/NetworkRequestsHandler.js +578 -0
  265. package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -0
  266. package/models/trace/handlers/PageFramesHandler.js +43 -0
  267. package/models/trace/handlers/PageFramesHandler.js.map +1 -0
  268. package/models/trace/handlers/PageLoadMetricsHandler.js +463 -0
  269. package/models/trace/handlers/PageLoadMetricsHandler.js.map +1 -0
  270. package/models/trace/handlers/RendererHandler.js +346 -0
  271. package/models/trace/handlers/RendererHandler.js.map +1 -0
  272. package/models/trace/handlers/SamplesHandler.js +261 -0
  273. package/models/trace/handlers/SamplesHandler.js.map +1 -0
  274. package/models/trace/handlers/ScreenshotsHandler.js +56 -0
  275. package/models/trace/handlers/ScreenshotsHandler.js.map +1 -0
  276. package/models/trace/handlers/ScriptsHandler.js +277 -0
  277. package/models/trace/handlers/ScriptsHandler.js.map +1 -0
  278. package/models/trace/handlers/SelectorStatsHandler.js +72 -0
  279. package/models/trace/handlers/SelectorStatsHandler.js.map +1 -0
  280. package/models/trace/handlers/Threads.js +108 -0
  281. package/models/trace/handlers/Threads.js.map +1 -0
  282. package/models/trace/handlers/UserInteractionsHandler.js +319 -0
  283. package/models/trace/handlers/UserInteractionsHandler.js.map +1 -0
  284. package/models/trace/handlers/UserTimingsHandler.js +194 -0
  285. package/models/trace/handlers/UserTimingsHandler.js.map +1 -0
  286. package/models/trace/handlers/WarningsHandler.js +135 -0
  287. package/models/trace/handlers/WarningsHandler.js.map +1 -0
  288. package/models/trace/handlers/WorkersHandler.js +34 -0
  289. package/models/trace/handlers/WorkersHandler.js.map +1 -0
  290. package/models/trace/handlers/bundle-tsconfig.json +59 -0
  291. package/models/trace/handlers/bundle-tsconfig.ref.json +27 -0
  292. package/models/trace/handlers/foundation_unittests-tsconfig.json +102 -0
  293. package/models/trace/handlers/foundation_unittests-tsconfig.ref.json +69 -0
  294. package/models/trace/handlers/foundation_unittests_node_typecheck-tsconfig.json +98 -0
  295. package/models/trace/handlers/handlers-tsconfig.json +112 -0
  296. package/models/trace/handlers/handlers-tsconfig.ref.json +80 -0
  297. package/models/trace/handlers/handlers.js +8 -0
  298. package/models/trace/handlers/handlers.js.map +1 -0
  299. package/models/trace/handlers/handlers_node_typecheck-tsconfig.json +109 -0
  300. package/models/trace/handlers/handlers_node_typecheck.stamp +0 -0
  301. package/models/trace/handlers/helpers.js +167 -0
  302. package/models/trace/handlers/helpers.js.map +1 -0
  303. package/models/trace/handlers/types.js +2 -0
  304. package/models/trace/handlers/types.js.map +1 -0
  305. package/models/trace/helpers/Extensions.js +42 -0
  306. package/models/trace/helpers/Extensions.js.map +1 -0
  307. package/models/trace/helpers/Network.js +103 -0
  308. package/models/trace/helpers/Network.js.map +1 -0
  309. package/models/trace/helpers/SamplesIntegrator.js +527 -0
  310. package/models/trace/helpers/SamplesIntegrator.js.map +1 -0
  311. package/models/trace/helpers/SyntheticEvents.js +96 -0
  312. package/models/trace/helpers/SyntheticEvents.js.map +1 -0
  313. package/models/trace/helpers/Timing.js +200 -0
  314. package/models/trace/helpers/Timing.js.map +1 -0
  315. package/models/trace/helpers/Trace.js +844 -0
  316. package/models/trace/helpers/Trace.js.map +1 -0
  317. package/models/trace/helpers/TreeHelpers.js +255 -0
  318. package/models/trace/helpers/TreeHelpers.js.map +1 -0
  319. package/models/trace/helpers/bundle-tsconfig.json +59 -0
  320. package/models/trace/helpers/bundle-tsconfig.ref.json +27 -0
  321. package/models/trace/helpers/foundation_unittests-tsconfig.json +73 -0
  322. package/models/trace/helpers/foundation_unittests-tsconfig.ref.json +40 -0
  323. package/models/trace/helpers/foundation_unittests_node_typecheck-tsconfig.json +69 -0
  324. package/models/trace/helpers/helpers-tsconfig.json +77 -0
  325. package/models/trace/helpers/helpers-tsconfig.ref.json +45 -0
  326. package/models/trace/helpers/helpers.js +11 -0
  327. package/models/trace/helpers/helpers.js.map +1 -0
  328. package/models/trace/helpers/helpers_node_typecheck-tsconfig.json +74 -0
  329. package/models/trace/helpers/helpers_node_typecheck.stamp +0 -0
  330. package/models/trace/insights/CLSCulprits.d.ts +14 -14
  331. package/models/trace/insights/CLSCulprits.js +519 -0
  332. package/models/trace/insights/CLSCulprits.js.map +1 -0
  333. package/models/trace/insights/Cache.d.ts +6 -6
  334. package/models/trace/insights/Cache.js +210 -0
  335. package/models/trace/insights/Cache.js.map +1 -0
  336. package/models/trace/insights/CharacterSet.d.ts +8 -8
  337. package/models/trace/insights/CharacterSet.js +132 -0
  338. package/models/trace/insights/CharacterSet.js.map +1 -0
  339. package/models/trace/insights/Common.js +367 -0
  340. package/models/trace/insights/Common.js.map +1 -0
  341. package/models/trace/insights/DOMSize.d.ts +13 -13
  342. package/models/trace/insights/DOMSize.js +182 -0
  343. package/models/trace/insights/DOMSize.js.map +1 -0
  344. package/models/trace/insights/DocumentLatency.d.ts +11 -11
  345. package/models/trace/insights/DocumentLatency.js +259 -0
  346. package/models/trace/insights/DocumentLatency.js.map +1 -0
  347. package/models/trace/insights/DuplicatedJavaScript.d.ts +5 -5
  348. package/models/trace/insights/DuplicatedJavaScript.js +110 -0
  349. package/models/trace/insights/DuplicatedJavaScript.js.map +1 -0
  350. package/models/trace/insights/FontDisplay.d.ts +5 -5
  351. package/models/trace/insights/FontDisplay.js +93 -0
  352. package/models/trace/insights/FontDisplay.js.map +1 -0
  353. package/models/trace/insights/ForcedReflow.d.ts +7 -7
  354. package/models/trace/insights/ForcedReflow.js +162 -0
  355. package/models/trace/insights/ForcedReflow.js.map +1 -0
  356. package/models/trace/insights/INPBreakdown.d.ts +8 -8
  357. package/models/trace/insights/INPBreakdown.js +130 -0
  358. package/models/trace/insights/INPBreakdown.js.map +1 -0
  359. package/models/trace/insights/ImageDelivery.d.ts +12 -12
  360. package/models/trace/insights/ImageDelivery.js +264 -0
  361. package/models/trace/insights/ImageDelivery.js.map +1 -0
  362. package/models/trace/insights/LCPBreakdown.d.ts +11 -11
  363. package/models/trace/insights/LCPBreakdown.js +200 -0
  364. package/models/trace/insights/LCPBreakdown.js.map +1 -0
  365. package/models/trace/insights/LCPDiscovery.d.ts +10 -10
  366. package/models/trace/insights/LCPDiscovery.js +190 -0
  367. package/models/trace/insights/LCPDiscovery.js.map +1 -0
  368. package/models/trace/insights/LegacyJavaScript.d.ts +5 -5
  369. package/models/trace/insights/LegacyJavaScript.js +99 -0
  370. package/models/trace/insights/LegacyJavaScript.js.map +1 -0
  371. package/models/trace/insights/Models.js +23 -0
  372. package/models/trace/insights/Models.js.map +1 -0
  373. package/models/trace/insights/ModernHTTP.d.ts +5 -5
  374. package/models/trace/insights/ModernHTTP.js +205 -0
  375. package/models/trace/insights/ModernHTTP.js.map +1 -0
  376. package/models/trace/insights/NetworkDependencyTree.d.ts +19 -19
  377. package/models/trace/insights/NetworkDependencyTree.js +551 -0
  378. package/models/trace/insights/NetworkDependencyTree.js.map +1 -0
  379. package/models/trace/insights/RenderBlocking.d.ts +5 -5
  380. package/models/trace/insights/RenderBlocking.js +211 -0
  381. package/models/trace/insights/RenderBlocking.js.map +1 -0
  382. package/models/trace/insights/SlowCSSSelector.d.ts +10 -10
  383. package/models/trace/insights/SlowCSSSelector.js +140 -0
  384. package/models/trace/insights/SlowCSSSelector.js.map +1 -0
  385. package/models/trace/insights/Statistics.js +93 -0
  386. package/models/trace/insights/Statistics.js.map +1 -0
  387. package/models/trace/insights/ThirdParties.d.ts +6 -6
  388. package/models/trace/insights/ThirdParties.js +110 -0
  389. package/models/trace/insights/ThirdParties.js.map +1 -0
  390. package/models/trace/insights/Viewport.d.ts +3 -3
  391. package/models/trace/insights/Viewport.js +105 -0
  392. package/models/trace/insights/Viewport.js.map +1 -0
  393. package/models/trace/insights/bundle-tsconfig.json +59 -0
  394. package/models/trace/insights/bundle-tsconfig.ref.json +27 -0
  395. package/models/trace/insights/foundation_unittests-tsconfig.json +98 -0
  396. package/models/trace/insights/foundation_unittests-tsconfig.ref.json +65 -0
  397. package/models/trace/insights/foundation_unittests_node_typecheck-tsconfig.json +94 -0
  398. package/models/trace/insights/insights-tsconfig.json +114 -0
  399. package/models/trace/insights/insights-tsconfig.ref.json +82 -0
  400. package/models/trace/insights/insights.js +10 -0
  401. package/models/trace/insights/insights.js.map +1 -0
  402. package/models/trace/insights/insights_node_typecheck-tsconfig.json +111 -0
  403. package/models/trace/insights/insights_node_typecheck.stamp +0 -0
  404. package/models/trace/insights/types.d.ts +3 -3
  405. package/models/trace/insights/types.js +41 -0
  406. package/models/trace/insights/types.js.map +1 -0
  407. package/models/trace/lantern/bundle-tsconfig.json +71 -0
  408. package/models/trace/lantern/bundle-tsconfig.ref.json +39 -0
  409. package/models/trace/lantern/core/LanternError.js +7 -0
  410. package/models/trace/lantern/core/LanternError.js.map +1 -0
  411. package/models/trace/lantern/core/NetworkAnalyzer.js +496 -0
  412. package/models/trace/lantern/core/NetworkAnalyzer.js.map +1 -0
  413. package/models/trace/lantern/core/bundle-tsconfig.json +59 -0
  414. package/models/trace/lantern/core/bundle-tsconfig.ref.json +27 -0
  415. package/models/trace/lantern/core/core-tsconfig.json +60 -0
  416. package/models/trace/lantern/core/core-tsconfig.ref.json +28 -0
  417. package/models/trace/lantern/core/core.js +6 -0
  418. package/models/trace/lantern/core/core.js.map +1 -0
  419. package/models/trace/lantern/core/core_node_typecheck-tsconfig.json +57 -0
  420. package/models/trace/lantern/core/core_node_typecheck.stamp +0 -0
  421. package/models/trace/lantern/core/foundation_unittests-tsconfig.json +69 -0
  422. package/models/trace/lantern/core/foundation_unittests-tsconfig.ref.json +36 -0
  423. package/models/trace/lantern/core/foundation_unittests_node_typecheck-tsconfig.json +65 -0
  424. package/models/trace/lantern/graph/BaseNode.d.ts +2 -2
  425. package/models/trace/lantern/graph/BaseNode.js +277 -0
  426. package/models/trace/lantern/graph/BaseNode.js.map +1 -0
  427. package/models/trace/lantern/graph/CPUNode.js +80 -0
  428. package/models/trace/lantern/graph/CPUNode.js.map +1 -0
  429. package/models/trace/lantern/graph/NetworkNode.js +95 -0
  430. package/models/trace/lantern/graph/NetworkNode.js.map +1 -0
  431. package/models/trace/lantern/graph/PageDependencyGraph.js +574 -0
  432. package/models/trace/lantern/graph/PageDependencyGraph.js.map +1 -0
  433. package/models/trace/lantern/graph/bundle-tsconfig.json +59 -0
  434. package/models/trace/lantern/graph/bundle-tsconfig.ref.json +27 -0
  435. package/models/trace/lantern/graph/foundation_unittests-tsconfig.json +61 -0
  436. package/models/trace/lantern/graph/foundation_unittests-tsconfig.ref.json +28 -0
  437. package/models/trace/lantern/graph/foundation_unittests_node_typecheck-tsconfig.json +57 -0
  438. package/models/trace/lantern/graph/graph-tsconfig.json +65 -0
  439. package/models/trace/lantern/graph/graph-tsconfig.ref.json +33 -0
  440. package/models/trace/lantern/graph/graph.js +8 -0
  441. package/models/trace/lantern/graph/graph.js.map +1 -0
  442. package/models/trace/lantern/graph/graph_node_typecheck-tsconfig.json +62 -0
  443. package/models/trace/lantern/graph/graph_node_typecheck.stamp +0 -0
  444. package/models/trace/lantern/lantern.js +10 -0
  445. package/models/trace/lantern/lantern.js.map +1 -0
  446. package/models/trace/lantern/metrics/FirstContentfulPaint.js +137 -0
  447. package/models/trace/lantern/metrics/FirstContentfulPaint.js.map +1 -0
  448. package/models/trace/lantern/metrics/Interactive.js +68 -0
  449. package/models/trace/lantern/metrics/Interactive.js.map +1 -0
  450. package/models/trace/lantern/metrics/LargestContentfulPaint.js +75 -0
  451. package/models/trace/lantern/metrics/LargestContentfulPaint.js.map +1 -0
  452. package/models/trace/lantern/metrics/MaxPotentialFID.js +49 -0
  453. package/models/trace/lantern/metrics/MaxPotentialFID.js.map +1 -0
  454. package/models/trace/lantern/metrics/Metric.js +69 -0
  455. package/models/trace/lantern/metrics/Metric.js.map +1 -0
  456. package/models/trace/lantern/metrics/SpeedIndex.js +102 -0
  457. package/models/trace/lantern/metrics/SpeedIndex.js.map +1 -0
  458. package/models/trace/lantern/metrics/TBTUtils.js +65 -0
  459. package/models/trace/lantern/metrics/TBTUtils.js.map +1 -0
  460. package/models/trace/lantern/metrics/TotalBlockingTime.js +79 -0
  461. package/models/trace/lantern/metrics/TotalBlockingTime.js.map +1 -0
  462. package/models/trace/lantern/metrics/bundle-tsconfig.json +59 -0
  463. package/models/trace/lantern/metrics/bundle-tsconfig.ref.json +27 -0
  464. package/models/trace/lantern/metrics/foundation_unittests-tsconfig.json +76 -0
  465. package/models/trace/lantern/metrics/foundation_unittests-tsconfig.ref.json +43 -0
  466. package/models/trace/lantern/metrics/foundation_unittests_node_typecheck-tsconfig.json +72 -0
  467. package/models/trace/lantern/metrics/metrics-tsconfig.json +75 -0
  468. package/models/trace/lantern/metrics/metrics-tsconfig.ref.json +43 -0
  469. package/models/trace/lantern/metrics/metrics.js +12 -0
  470. package/models/trace/lantern/metrics/metrics.js.map +1 -0
  471. package/models/trace/lantern/metrics/metrics_node_typecheck-tsconfig.json +72 -0
  472. package/models/trace/lantern/metrics/metrics_node_typecheck.stamp +0 -0
  473. package/models/trace/lantern/simulation/ConnectionPool.js +116 -0
  474. package/models/trace/lantern/simulation/ConnectionPool.js.map +1 -0
  475. package/models/trace/lantern/simulation/Constants.js +45 -0
  476. package/models/trace/lantern/simulation/Constants.js.map +1 -0
  477. package/models/trace/lantern/simulation/DNSCache.js +48 -0
  478. package/models/trace/lantern/simulation/DNSCache.js.map +1 -0
  479. package/models/trace/lantern/simulation/SimulationTimingMap.js +135 -0
  480. package/models/trace/lantern/simulation/SimulationTimingMap.js.map +1 -0
  481. package/models/trace/lantern/simulation/Simulator.js +457 -0
  482. package/models/trace/lantern/simulation/Simulator.js.map +1 -0
  483. package/models/trace/lantern/simulation/TCPConnection.js +155 -0
  484. package/models/trace/lantern/simulation/TCPConnection.js.map +1 -0
  485. package/models/trace/lantern/simulation/bundle-tsconfig.json +59 -0
  486. package/models/trace/lantern/simulation/bundle-tsconfig.ref.json +27 -0
  487. package/models/trace/lantern/simulation/foundation_unittests-tsconfig.json +75 -0
  488. package/models/trace/lantern/simulation/foundation_unittests-tsconfig.ref.json +42 -0
  489. package/models/trace/lantern/simulation/foundation_unittests_node_typecheck-tsconfig.json +71 -0
  490. package/models/trace/lantern/simulation/simulation-tsconfig.json +70 -0
  491. package/models/trace/lantern/simulation/simulation-tsconfig.ref.json +38 -0
  492. package/models/trace/lantern/simulation/simulation.js +10 -0
  493. package/models/trace/lantern/simulation/simulation.js.map +1 -0
  494. package/models/trace/lantern/simulation/simulation_node_typecheck-tsconfig.json +67 -0
  495. package/models/trace/lantern/simulation/simulation_node_typecheck.stamp +0 -0
  496. package/models/trace/lantern/testing/bundle-tsconfig.json +60 -0
  497. package/models/trace/lantern/testing/bundle-tsconfig.ref.json +27 -0
  498. package/models/trace/lantern/testing/testing-tsconfig.json +63 -0
  499. package/models/trace/lantern/testing/testing-tsconfig.ref.json +30 -0
  500. package/models/trace/lantern/types/Lantern.d.ts +19 -19
  501. package/models/trace/lantern/types/Lantern.js +25 -0
  502. package/models/trace/lantern/types/Lantern.js.map +1 -0
  503. package/models/trace/lantern/types/bundle-tsconfig.json +59 -0
  504. package/models/trace/lantern/types/bundle-tsconfig.ref.json +27 -0
  505. package/models/trace/lantern/types/types-tsconfig.json +59 -0
  506. package/models/trace/lantern/types/types-tsconfig.ref.json +27 -0
  507. package/models/trace/lantern/types/types.js +5 -0
  508. package/models/trace/lantern/types/types.js.map +1 -0
  509. package/models/trace/lantern/types/types_node_typecheck-tsconfig.json +56 -0
  510. package/models/trace/lantern/types/types_node_typecheck.stamp +0 -0
  511. package/models/trace/trace-tsconfig.json +89 -0
  512. package/models/trace/trace-tsconfig.ref.json +57 -0
  513. package/models/trace/trace.js +16 -544
  514. package/models/trace/trace.js.map +1 -0
  515. package/models/trace/trace_node_typecheck-tsconfig.json +86 -0
  516. package/models/trace/trace_node_typecheck.stamp +0 -0
  517. package/models/trace/types/Configuration.d.ts +2 -2
  518. package/models/trace/types/Configuration.js +19 -0
  519. package/models/trace/types/Configuration.js.map +1 -0
  520. package/models/trace/types/Extensions.d.ts +1 -1
  521. package/models/trace/types/Extensions.js +38 -0
  522. package/models/trace/types/Extensions.js.map +1 -0
  523. package/models/trace/types/File.d.ts +9 -3
  524. package/models/trace/types/File.js +92 -0
  525. package/models/trace/types/File.js.map +1 -0
  526. package/models/trace/types/Overlays.js +5 -0
  527. package/models/trace/types/Overlays.js.map +1 -0
  528. package/models/trace/types/Timing.js +16 -0
  529. package/models/trace/types/Timing.js.map +1 -0
  530. package/models/trace/types/TraceEvents.d.ts +21 -16
  531. package/models/trace/types/TraceEvents.js +983 -0
  532. package/models/trace/types/TraceEvents.js.map +1 -0
  533. package/models/trace/types/bundle-tsconfig.json +59 -0
  534. package/models/trace/types/bundle-tsconfig.ref.json +27 -0
  535. package/models/trace/types/foundation_unittests-tsconfig.json +67 -0
  536. package/models/trace/types/foundation_unittests-tsconfig.ref.json +34 -0
  537. package/models/trace/types/foundation_unittests_node_typecheck-tsconfig.json +63 -0
  538. package/models/trace/types/types-tsconfig.json +76 -0
  539. package/models/trace/types/types-tsconfig.ref.json +44 -0
  540. package/models/trace/types/types.js +10 -0
  541. package/models/trace/types/types.js.map +1 -0
  542. package/models/trace/types/types_node_typecheck-tsconfig.json +73 -0
  543. package/models/trace/types/types_node_typecheck.stamp +0 -0
  544. package/package.json +8 -40
  545. package/test/invalid-animation-events.json.gz +0 -0
  546. package/test/test-trace-engine.mjs +191 -0
  547. package/third_party/legacy-javascript/bundle-tsconfig.json +59 -0
  548. package/third_party/legacy-javascript/bundle-tsconfig.ref.json +27 -0
  549. package/third_party/legacy-javascript/legacy-javascript-tsconfig.ref.json +15 -0
  550. package/third_party/legacy-javascript/legacy-javascript.js +3 -0
  551. package/third_party/legacy-javascript/legacy-javascript.js.map +1 -0
  552. package/third_party/legacy-javascript/lib/legacy-javascript.js +1119 -0
  553. package/third_party/marked/marked.d.ts +1 -2
  554. package/third_party/marked/marked.js +1 -0
  555. package/third_party/third-party-web/third-party-web.d.ts +1 -2
  556. package/third_party/third-party-web/third-party-web.js +1 -0
  557. package/tsconfig.json +29 -0
  558. package/core/common/Base64.d.ts +0 -12
  559. package/core/common/CharacterIdMap.d.ts +0 -5
  560. package/core/common/Color.d.ts +0 -357
  561. package/core/common/ColorConverter.d.ts +0 -26
  562. package/core/common/ColorUtils.d.ts +0 -45
  563. package/core/common/Console.d.ts +0 -54
  564. package/core/common/Debouncer.d.ts +0 -8
  565. package/core/common/EventTarget.d.ts +0 -22
  566. package/core/common/Gzip.d.ts +0 -23
  567. package/core/common/JavaScriptMetaData.d.ts +0 -20
  568. package/core/common/Lazy.d.ts +0 -4
  569. package/core/common/MapWithDefault.d.ts +0 -9
  570. package/core/common/Mutex.d.ts +0 -13
  571. package/core/common/Object.d.ts +0 -20
  572. package/core/common/Progress.d.ts +0 -47
  573. package/core/common/ResolverBase.d.ts +0 -29
  574. package/core/common/ResourceType.d.ts +0 -52
  575. package/core/common/ReturnToPanel.d.ts +0 -10
  576. package/core/common/Revealer.d.ts +0 -66
  577. package/core/common/Runnable.d.ts +0 -14
  578. package/core/common/SegmentedRange.d.ts +0 -14
  579. package/core/common/SettingRegistration.d.ts +0 -136
  580. package/core/common/Settings.d.ts +0 -228
  581. package/core/common/SimpleHistoryManager.d.ts +0 -20
  582. package/core/common/Srcset.d.ts +0 -16
  583. package/core/common/StringOutputStream.d.ts +0 -10
  584. package/core/common/TextDictionary.d.ts +0 -11
  585. package/core/common/Throttler.d.ts +0 -12
  586. package/core/common/Trie.d.ts +0 -24
  587. package/core/common/VersionController.d.ts +0 -85
  588. package/core/host/AidaClient.d.ts +0 -73
  589. package/core/host/AidaClientTypes.d.ts +0 -355
  590. package/core/host/AidaGcaTranslation.d.ts +0 -10
  591. package/core/host/DispatchHttpRequestClient.d.ts +0 -14
  592. package/core/host/GcaClient.d.ts +0 -14
  593. package/core/host/GcaTypes.d.ts +0 -411
  594. package/core/host/GdpClient.d.ts +0 -84
  595. package/core/host/InspectorFrontendHost.d.ts +0 -29
  596. package/core/host/InspectorFrontendHostAPI.d.ts +0 -425
  597. package/core/host/InspectorFrontendHostStub.d.ts +0 -151
  598. package/core/host/Platform.d.ts +0 -16
  599. package/core/host/ResourceLoader.d.ts +0 -15
  600. package/core/host/UserMetrics.d.ts +0 -116
  601. package/core/host/UserMetricsEnums.d.ts +0 -888
  602. package/core/i18n/ByteUtilities.d.ts +0 -11
  603. package/core/i18n/DevToolsLocale.d.ts +0 -41
  604. package/core/i18n/NumberFormatter.d.ts +0 -11
  605. package/core/i18n/i18nImpl.d.ts +0 -64
  606. package/core/i18n/i18nTypes.d.ts +0 -5
  607. package/core/i18n/locales.d.ts +0 -15
  608. package/core/i18n/time-utilities.d.ts +0 -16
  609. package/core/platform/browser/HostRuntime.d.ts +0 -2
  610. package/core/platform/browser/browser.d.ts +0 -2
  611. package/core/platform/node/HostRuntime.d.ts +0 -2
  612. package/core/platform/node/node.d.ts +0 -2
  613. package/core/protocol_client/CDPConnection.d.ts +0 -77
  614. package/core/protocol_client/ConnectionTransport.d.ts +0 -9
  615. package/core/protocol_client/DevToolsCDPConnection.d.ts +0 -16
  616. package/core/protocol_client/InspectorBackend.d.ts +0 -223
  617. package/core/protocol_client/protocol_client.d.ts +0 -5
  618. package/core/root/DevToolsContext.d.ts +0 -34
  619. package/core/root/ExperimentNames.d.ts +0 -9
  620. package/core/root/Runtime.d.ts +0 -353
  621. package/core/sdk/AccessibilityModel.d.ts +0 -76
  622. package/core/sdk/AnimationModel.d.ts +0 -161
  623. package/core/sdk/AutofillModel.d.ts +0 -23
  624. package/core/sdk/CPUProfilerModel.d.ts +0 -46
  625. package/core/sdk/CPUThrottlingManager.d.ts +0 -47
  626. package/core/sdk/CSSContainerQuery.d.ts +0 -42
  627. package/core/sdk/CSSFontFace.d.ts +0 -10
  628. package/core/sdk/CSSLayer.d.ts +0 -9
  629. package/core/sdk/CSSLocation.d.ts +0 -14
  630. package/core/sdk/CSSMatchedStyles.d.ts +0 -138
  631. package/core/sdk/CSSMedia.d.ts +0 -36
  632. package/core/sdk/CSSMetadata.d.ts +0 -87
  633. package/core/sdk/CSSModel.d.ts +0 -185
  634. package/core/sdk/CSSNavigation.d.ts +0 -10
  635. package/core/sdk/CSSProperty.d.ts +0 -53
  636. package/core/sdk/CSSPropertyParser.d.ts +0 -126
  637. package/core/sdk/CSSPropertyParserMatchers.d.ts +0 -442
  638. package/core/sdk/CSSQuery.d.ts +0 -22
  639. package/core/sdk/CSSRule.d.ts +0 -132
  640. package/core/sdk/CSSScope.d.ts +0 -9
  641. package/core/sdk/CSSStartingStyle.d.ts +0 -9
  642. package/core/sdk/CSSStyleDeclaration.d.ts +0 -38
  643. package/core/sdk/CSSStyleSheetHeader.d.ts +0 -53
  644. package/core/sdk/CSSSupports.d.ts +0 -10
  645. package/core/sdk/CategorizedBreakpoint.d.ts +0 -42
  646. package/core/sdk/ChildTargetManager.d.ts +0 -40
  647. package/core/sdk/CompilerSourceMappingContentProvider.d.ts +0 -12
  648. package/core/sdk/Connections.d.ts +0 -36
  649. package/core/sdk/ConsoleModel.d.ts +0 -127
  650. package/core/sdk/ConsoleModelTypes.d.ts +0 -6
  651. package/core/sdk/Cookie.d.ts +0 -68
  652. package/core/sdk/CookieModel.d.ts +0 -31
  653. package/core/sdk/CookieParser.d.ts +0 -14
  654. package/core/sdk/CrashReportContextModel.d.ts +0 -8
  655. package/core/sdk/DOMDebuggerModel.d.ts +0 -127
  656. package/core/sdk/DOMModel.d.ts +0 -440
  657. package/core/sdk/DOMStorageModel.d.ts +0 -79
  658. package/core/sdk/DebuggerModel.d.ts +0 -305
  659. package/core/sdk/EmulationModel.d.ts +0 -95
  660. package/core/sdk/EnhancedTracesParser.d.ts +0 -105
  661. package/core/sdk/EventBreakpointsModel.d.ts +0 -66
  662. package/core/sdk/FrameAssociated.d.ts +0 -6
  663. package/core/sdk/FrameManager.d.ts +0 -68
  664. package/core/sdk/HeapProfilerModel.d.ts +0 -75
  665. package/core/sdk/HttpReasonPhraseStrings.d.ts +0 -5
  666. package/core/sdk/IOModel.d.ts +0 -10
  667. package/core/sdk/IsolateManager.d.ts +0 -53
  668. package/core/sdk/IssuesModel.d.ts +0 -28
  669. package/core/sdk/LayerTreeBase.d.ts +0 -70
  670. package/core/sdk/LogModel.d.ts +0 -20
  671. package/core/sdk/NetworkManager.d.ts +0 -418
  672. package/core/sdk/NetworkRequest.d.ts +0 -497
  673. package/core/sdk/NetworkRequestAccess.d.ts +0 -91
  674. package/core/sdk/OverlayColorGenerator.d.ts +0 -14
  675. package/core/sdk/OverlayModel.d.ts +0 -186
  676. package/core/sdk/OverlayPersistentHighlighter.d.ts +0 -116
  677. package/core/sdk/PageFunctions.d.ts +0 -22
  678. package/core/sdk/PageLoad.d.ts +0 -14
  679. package/core/sdk/PageResourceLoader.d.ts +0 -111
  680. package/core/sdk/PaintProfiler.d.ts +0 -43
  681. package/core/sdk/PerformanceMetricsModel.d.ts +0 -12
  682. package/core/sdk/PreloadingModel.d.ts +0 -146
  683. package/core/sdk/RehydratingConnection.d.ts +0 -73
  684. package/core/sdk/RehydratingObject.d.ts +0 -59
  685. package/core/sdk/RemoteObject.d.ts +0 -210
  686. package/core/sdk/Resource.d.ts +0 -36
  687. package/core/sdk/ResourceTreeModel.d.ts +0 -280
  688. package/core/sdk/RuntimeModel.d.ts +0 -164
  689. package/core/sdk/SDKModel.d.ts +0 -30
  690. package/core/sdk/SDKSettings.d.ts +0 -54
  691. package/core/sdk/ScopeTreeCache.d.ts +0 -21
  692. package/core/sdk/ScreenCaptureModel.d.ts +0 -69
  693. package/core/sdk/Script.d.ts +0 -134
  694. package/core/sdk/SecurityOrigin.d.ts +0 -108
  695. package/core/sdk/SecurityOriginManager.d.ts +0 -23
  696. package/core/sdk/ServerSentEvents.d.ts +0 -18
  697. package/core/sdk/ServerSentEventsProtocol.d.ts +0 -18
  698. package/core/sdk/ServerTiming.d.ts +0 -24
  699. package/core/sdk/ServiceWorkerCacheModel.d.ts +0 -71
  700. package/core/sdk/ServiceWorkerManager.d.ts +0 -125
  701. package/core/sdk/SourceMap.d.ts +0 -211
  702. package/core/sdk/SourceMapCache.d.ts +0 -12
  703. package/core/sdk/SourceMapFunctionRanges.d.ts +0 -23
  704. package/core/sdk/SourceMapManager.d.ts +0 -46
  705. package/core/sdk/SourceMapRangeMappings.d.ts +0 -15
  706. package/core/sdk/SourceMapScopeChainEntry.d.ts +0 -23
  707. package/core/sdk/SourceMapScopesInfo.d.ts +0 -184
  708. package/core/sdk/StorageBucketsModel.d.ts +0 -48
  709. package/core/sdk/StorageKeyManager.d.ts +0 -38
  710. package/core/sdk/Target.d.ts +0 -79
  711. package/core/sdk/TargetManager.d.ts +0 -92
  712. package/core/sdk/TraceObject.d.ts +0 -43
  713. package/core/sdk/WebAuthnModel.d.ts +0 -29
  714. package/core/text_utils/CodeMirrorUtils.d.ts +0 -3
  715. package/core/text_utils/ContentData.d.ts +0 -94
  716. package/core/text_utils/ContentProvider.d.ts +0 -42
  717. package/core/text_utils/Markdown.d.ts +0 -13
  718. package/core/text_utils/StaticContentProvider.d.ts +0 -13
  719. package/core/text_utils/StreamingContentData.d.ts +0 -49
  720. package/core/text_utils/Text.d.ts +0 -19
  721. package/core/text_utils/TextCursor.d.ts +0 -9
  722. package/core/text_utils/TextRange.d.ts +0 -81
  723. package/core/text_utils/TextUtils.d.ts +0 -97
  724. package/core/text_utils/WasmDisassembly.d.ts +0 -29
  725. package/core/text_utils/text_utils.d.ts +0 -12
  726. package/entrypoints/formatter_actions/formatter_actions.d.ts +0 -65
  727. package/generated/InspectorBackendCommands.d.ts +0 -14
  728. package/generated/SupportedCSSProperties.d.ts +0 -18
  729. package/generated/protocol-mapping.d.ts +0 -5985
  730. package/generated/protocol-proxy-api.d.ts +0 -5447
  731. package/index.d.ts +0 -2
  732. package/index.js +0 -6
  733. package/models/crux-manager/CrUXManager.d.ts +0 -107
  734. package/models/emulation/DeviceModeModel.d.ts +0 -157
  735. package/models/emulation/EmulatedDevices.d.ts +0 -148
  736. package/models/emulation/emulation.d.ts +0 -3
  737. package/models/formatter/FormatterWorkerPool.d.ts +0 -58
  738. package/models/formatter/ScriptFormatter.d.ts +0 -11
  739. package/models/formatter/formatter.d.ts +0 -3
  740. package/third_party/codemirror.next/codemirror.next.d.ts +0 -9196
  741. package/third_party/i18n/i18n-impl.d.ts +0 -25
  742. package/third_party/i18n/i18n.d.ts +0 -3
  743. package/third_party/i18n/localized-string-set.d.ts +0 -49
  744. package/third_party/intl-messageformat/intl-messageformat.d.ts +0 -1
  745. package/third_party/marked/package/lib/marked.esm.d.ts +0 -760
  746. package/third_party/source-map-scopes-codec/package/src/builder/builder.d.ts +0 -70
  747. package/third_party/source-map-scopes-codec/package/src/builder/safe_builder.d.ts +0 -40
  748. package/third_party/source-map-scopes-codec/package/src/codec.d.ts +0 -49
  749. package/third_party/source-map-scopes-codec/package/src/decode/decode.d.ts +0 -33
  750. package/third_party/source-map-scopes-codec/package/src/encode/encode.d.ts +0 -8
  751. package/third_party/source-map-scopes-codec/package/src/encode/encoder.d.ts +0 -9
  752. package/third_party/source-map-scopes-codec/package/src/mod.d.ts +0 -5
  753. package/third_party/source-map-scopes-codec/package/src/scopes.d.ts +0 -169
  754. package/third_party/source-map-scopes-codec/package/src/util.d.ts +0 -5
  755. package/third_party/source-map-scopes-codec/package/src/vlq.d.ts +0 -14
  756. package/third_party/source-map-scopes-codec/source-map-scopes-codec.d.ts +0 -1
  757. package/third_party/third-party-web/lib/nostats-subset.d.ts +0 -2
  758. package/third_party/third-party-web/package/lib/index.d.ts +0 -34
  759. package/third_party/third-party-web/package/lib/subsets/nostats.d.ts +0 -1
@@ -0,0 +1,87 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": false,
4
+ "allowSyntheticDefaultImports": true,
5
+ "checkJs": false,
6
+ "composite": false,
7
+ "declaration": false,
8
+ "disableSourceOfProjectReferenceRedirect": true,
9
+ "experimentalDecorators": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "incremental": false,
12
+ "inlineSources": true,
13
+ "lib": [
14
+ "ES2023",
15
+ "ES2024.Promise",
16
+ "ESNext.Iterator",
17
+ "ESNext.Collection",
18
+ "ESNext.Array"
19
+ ],
20
+ "module": "esnext",
21
+ "moduleResolution": "bundler",
22
+ "noEmit": true,
23
+ "noEmitOnError": true,
24
+ "noFallthroughCasesInSwitch": true,
25
+ "noImplicitOverride": true,
26
+ "noImplicitReturns": true,
27
+ "outDir": ".",
28
+ "preserveConstEnums": true,
29
+ "rootDir": "../../../../../../../front_end/models/trace/extras",
30
+ "rootDirs": [
31
+ "../../../../../../../",
32
+ "../../../../"
33
+ ],
34
+ "skipLibCheck": true,
35
+ "sourceMap": true,
36
+ "strict": true,
37
+ "target": "es2023",
38
+ "typeRoots": [
39
+ "../../../../../../../node_modules/@types",
40
+ "../../../../../../../node_modules"
41
+ ],
42
+ "types": [
43
+ "node",
44
+ "undici-types"
45
+ ],
46
+ "useUnknownInCatchVariables": false
47
+ },
48
+ "files": [
49
+ "../../../../../../../front_end/models/trace/extras/FilmStrip.test.ts",
50
+ "../../../../../../../front_end/models/trace/extras/Initiators.test.ts",
51
+ "../../../../../../../front_end/models/trace/extras/MainThreadActivity.test.ts",
52
+ "../../../../../../../front_end/models/trace/extras/ScriptDuplication.test.ts",
53
+ "../../../../../../../front_end/models/trace/extras/StackTraceForEvent.test.ts",
54
+ "../../../../../../../front_end/models/trace/extras/ThirdParties.test.ts",
55
+ "../../../../../../../front_end/models/trace/extras/TraceFilter.test.ts",
56
+ "../../../../../../../front_end/models/trace/extras/TraceTree.test.ts"
57
+ ],
58
+ "references": [
59
+ {
60
+ "path": "bundle-tsconfig.ref.json"
61
+ },
62
+ {
63
+ "path": "../../../core/common/bundle-tsconfig.ref.json"
64
+ },
65
+ {
66
+ "path": "../../../core/platform/bundle-tsconfig.ref.json"
67
+ },
68
+ {
69
+ "path": "../../../core/sdk/bundle-tsconfig.ref.json"
70
+ },
71
+ {
72
+ "path": "../../../generated/generated-tsconfig.ref.json"
73
+ },
74
+ {
75
+ "path": "../bundle-tsconfig.ref.json"
76
+ },
77
+ {
78
+ "path": "../../../testing/testing-tsconfig.ref.json"
79
+ },
80
+ {
81
+ "path": "../handlers/bundle-tsconfig.ref.json"
82
+ },
83
+ {
84
+ "path": "../types/bundle-tsconfig.ref.json"
85
+ }
86
+ ]
87
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": false,
4
+ "allowSyntheticDefaultImports": true,
5
+ "checkJs": false,
6
+ "composite": false,
7
+ "declaration": false,
8
+ "disableSourceOfProjectReferenceRedirect": true,
9
+ "experimentalDecorators": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "incremental": false,
12
+ "inlineSources": true,
13
+ "lib": [
14
+ "dom",
15
+ "dom.iterable",
16
+ "ES2023",
17
+ "ES2024.Promise",
18
+ "ESNext.Iterator",
19
+ "ESNext.Collection",
20
+ "ESNext.Array"
21
+ ],
22
+ "module": "esnext",
23
+ "moduleResolution": "bundler",
24
+ "noEmitOnError": true,
25
+ "noFallthroughCasesInSwitch": true,
26
+ "noImplicitOverride": true,
27
+ "noImplicitReturns": true,
28
+ "outDir": ".",
29
+ "preserveConstEnums": true,
30
+ "rootDir": "../../../../../../front_end/models/trace",
31
+ "rootDirs": [
32
+ "../../../../../../",
33
+ "../../../"
34
+ ],
35
+ "skipLibCheck": true,
36
+ "sourceMap": true,
37
+ "strict": true,
38
+ "target": "es2023",
39
+ "typeRoots": [
40
+ "../../../../../../node_modules/@types",
41
+ "../../../../../../node_modules"
42
+ ],
43
+ "types": [
44
+
45
+ ],
46
+ "useUnknownInCatchVariables": false
47
+ },
48
+ "files": [
49
+ "../../../../../../front_end/models/trace/EntityMapper.test.ts",
50
+ "../../../../../../front_end/models/trace/EventsSerializer.test.ts",
51
+ "../../../../../../front_end/models/trace/ModelImpl.test.ts",
52
+ "../../../../../../front_end/models/trace/Name.test.ts",
53
+ "../../../../../../front_end/models/trace/Processor.test.ts",
54
+ "../../../../../../front_end/legacy/legacy-defs.d.ts",
55
+ "../../../../../../front_end/global_typings/global_defs.d.ts",
56
+ "../../../../../../node_modules/@types/filesystem/index.d.ts",
57
+ "../../../../../../node_modules/@types/filewriter/index.d.ts"
58
+ ],
59
+ "references": [
60
+ {
61
+ "path": "bundle-tsconfig.ref.json"
62
+ },
63
+ {
64
+ "path": "../../testing/testing-tsconfig.ref.json"
65
+ },
66
+ {
67
+ "path": "../cpu_profile/bundle-tsconfig.ref.json"
68
+ }
69
+ ]
70
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "declaration": true,
5
+ "declarationDir": ".",
6
+ "emitDeclarationOnly": true,
7
+ "outDir": ".",
8
+ "rootDir": "../../../../../../front_end/models/trace",
9
+ "rootDirs": [
10
+ "../../../../../../",
11
+ "../../../"
12
+ ],
13
+ "skipLibCheck": true
14
+ },
15
+ "files": [
16
+ "../../../../../../front_end/models/trace/EntityMapper.test.ts",
17
+ "../../../../../../front_end/models/trace/EventsSerializer.test.ts",
18
+ "../../../../../../front_end/models/trace/ModelImpl.test.ts",
19
+ "../../../../../../front_end/models/trace/Name.test.ts",
20
+ "../../../../../../front_end/models/trace/Processor.test.ts",
21
+ "../../../../../../front_end/legacy/legacy-defs.d.ts",
22
+ "../../../../../../front_end/global_typings/global_defs.d.ts",
23
+ "../../../../../../node_modules/@types/filesystem/index.d.ts",
24
+ "../../../../../../node_modules/@types/filewriter/index.d.ts"
25
+ ],
26
+ "references": [
27
+ {
28
+ "path": "bundle-tsconfig.ref.json"
29
+ },
30
+ {
31
+ "path": "../../testing/testing-tsconfig.ref.json"
32
+ },
33
+ {
34
+ "path": "../cpu_profile/bundle-tsconfig.ref.json"
35
+ }
36
+ ]
37
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": false,
4
+ "allowSyntheticDefaultImports": true,
5
+ "checkJs": false,
6
+ "composite": false,
7
+ "declaration": false,
8
+ "disableSourceOfProjectReferenceRedirect": true,
9
+ "experimentalDecorators": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "incremental": false,
12
+ "inlineSources": true,
13
+ "lib": [
14
+ "ES2023",
15
+ "ES2024.Promise",
16
+ "ESNext.Iterator",
17
+ "ESNext.Collection",
18
+ "ESNext.Array"
19
+ ],
20
+ "module": "esnext",
21
+ "moduleResolution": "bundler",
22
+ "noEmit": true,
23
+ "noEmitOnError": true,
24
+ "noFallthroughCasesInSwitch": true,
25
+ "noImplicitOverride": true,
26
+ "noImplicitReturns": true,
27
+ "outDir": ".",
28
+ "preserveConstEnums": true,
29
+ "rootDir": "../../../../../../front_end/models/trace",
30
+ "rootDirs": [
31
+ "../../../../../../",
32
+ "../../../"
33
+ ],
34
+ "skipLibCheck": true,
35
+ "sourceMap": true,
36
+ "strict": true,
37
+ "target": "es2023",
38
+ "typeRoots": [
39
+ "../../../../../../node_modules/@types",
40
+ "../../../../../../node_modules"
41
+ ],
42
+ "types": [
43
+ "node",
44
+ "undici-types"
45
+ ],
46
+ "useUnknownInCatchVariables": false
47
+ },
48
+ "files": [
49
+ "../../../../../../front_end/models/trace/EntityMapper.test.ts",
50
+ "../../../../../../front_end/models/trace/EventsSerializer.test.ts",
51
+ "../../../../../../front_end/models/trace/ModelImpl.test.ts",
52
+ "../../../../../../front_end/models/trace/Name.test.ts",
53
+ "../../../../../../front_end/models/trace/Processor.test.ts"
54
+ ],
55
+ "references": [
56
+ {
57
+ "path": "bundle-tsconfig.ref.json"
58
+ },
59
+ {
60
+ "path": "../../testing/testing-tsconfig.ref.json"
61
+ },
62
+ {
63
+ "path": "../cpu_profile/bundle-tsconfig.ref.json"
64
+ }
65
+ ]
66
+ }
@@ -0,0 +1,110 @@
1
+ // Copyright 2024 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
+ function threadKey(data) {
7
+ return `${data.pid}-${data.tid}`;
8
+ }
9
+ // Track all the start + end events. We key them by the PID+TID so we don't
10
+ // accidentally pair across different threads.
11
+ let animationFrameStarts = new Map();
12
+ let animationFrameEnds = new Map();
13
+ // Store all the AnimationFrame::Presentation events. Key them by their ID for
14
+ // easy look-up later on when we associate one to the AnimationFrame event.
15
+ let animationFramePresentations = new Map();
16
+ // The final list of animation frames that we return.
17
+ let animationFrames = [];
18
+ let presentationForFrame = new WeakMap();
19
+ export function reset() {
20
+ animationFrameStarts = new Map();
21
+ animationFrameEnds = new Map();
22
+ animationFrames = [];
23
+ presentationForFrame = new WeakMap();
24
+ animationFramePresentations = new Map();
25
+ isEnabled = false;
26
+ }
27
+ let isEnabled = false;
28
+ export function handleUserConfig(config) {
29
+ isEnabled = config.enableAnimationsFrameHandler;
30
+ }
31
+ export function handleEvent(event) {
32
+ if (!isEnabled) {
33
+ return;
34
+ }
35
+ if (Types.Events.isAnimationFrameAsyncStart(event)) {
36
+ const key = threadKey(event);
37
+ const existing = animationFrameStarts.get(key) ?? [];
38
+ existing.push(event);
39
+ animationFrameStarts.set(key, existing);
40
+ }
41
+ else if (Types.Events.isAnimationFrameAsyncEnd(event)) {
42
+ const key = threadKey(event);
43
+ const existing = animationFrameEnds.get(key) ?? [];
44
+ existing.push(event);
45
+ animationFrameEnds.set(key, existing);
46
+ }
47
+ else if (Types.Events.isAnimationFramePresentation(event) && event.args?.id) {
48
+ animationFramePresentations.set(event.args.id, event);
49
+ }
50
+ }
51
+ export async function finalize() {
52
+ // AnimationFrames are represented with begin & end events on a stack; so we
53
+ // can pair them by walking through the list of start events and pairing with
54
+ // the same index in the list of end events, once both lists are sorted by
55
+ // timestamp.
56
+ // We walk through the set of begin/end events we gathered per pid+tid and
57
+ // pair those up.
58
+ // Unfortunately we cannot use the pairing helpers in Helpers.Trace because
59
+ // only the begin event has an ID; the end event does not. But because we
60
+ // know that AnimationFrames are sequential and do not overlap, we can pair
61
+ // up events easily.
62
+ for (const [key, startEvents] of animationFrameStarts.entries()) {
63
+ const endEvents = animationFrameEnds.get(key);
64
+ if (!endEvents) {
65
+ continue;
66
+ }
67
+ Helpers.Trace.sortTraceEventsInPlace(startEvents);
68
+ Helpers.Trace.sortTraceEventsInPlace(endEvents);
69
+ for (let i = 0; i < startEvents.length; i++) {
70
+ const endEvent = endEvents.at(i);
71
+ if (!endEvent) {
72
+ // Invalid data: break. We can't pair any other events up.
73
+ break;
74
+ }
75
+ const startEvent = startEvents[i];
76
+ const syntheticEvent = Helpers.SyntheticEvents.SyntheticEventsManager
77
+ .registerSyntheticEvent({
78
+ rawSourceEvent: startEvent,
79
+ ...startEvent,
80
+ dur: Types.Timing.Micro(endEvent.ts - startEvent.ts),
81
+ args: {
82
+ data: {
83
+ beginEvent: startEvent,
84
+ endEvent,
85
+ },
86
+ },
87
+ });
88
+ animationFrames.push(syntheticEvent);
89
+ // AnimationFrame begin events + AnimationFrame::Presentation events share
90
+ // an args.id, so we can pair them up based on that.
91
+ const id = startEvent.args?.id;
92
+ if (id) {
93
+ const presentationEvent = animationFramePresentations.get(id);
94
+ if (presentationEvent) {
95
+ presentationForFrame.set(syntheticEvent, presentationEvent);
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
101
+ export function data() {
102
+ return {
103
+ animationFrames,
104
+ presentationForFrame,
105
+ };
106
+ }
107
+ export function deps() {
108
+ return ['Meta'];
109
+ }
110
+ //# sourceMappingURL=AnimationFramesHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnimationFramesHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/AnimationFramesHandler.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAC7B,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAS3C,SAAS,SAAS,CAAC,IAAwB;IACzC,OAAO,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;AACnC,CAAC;AACD,2EAA2E;AAC3E,8CAA8C;AAC9C,IAAI,oBAAoB,GAAG,IAAI,GAAG,EAAmD,CAAC;AACtF,IAAI,kBAAkB,GAAG,IAAI,GAAG,EAAiD,CAAC;AAClF,8EAA8E;AAC9E,2EAA2E;AAC3E,IAAI,2BAA2B,GAAG,IAAI,GAAG,EAAmD,CAAC;AAE7F,qDAAqD;AACrD,IAAI,eAAe,GAA+C,EAAE,CAAC;AAErE,IAAI,oBAAoB,GACpB,IAAI,OAAO,EAAqF,CAAC;AAErG,MAAM,UAAU,KAAK;IACnB,oBAAoB,GAAG,IAAI,GAAG,EAAE,CAAC;IACjC,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAC;IAC/B,eAAe,GAAG,EAAE,CAAC;IACrB,oBAAoB,GAAG,IAAI,OAAO,EAAE,CAAC;IACrC,2BAA2B,GAAG,IAAI,GAAG,EAAE,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AAE,CAAC;YAC/B,IAAI,EAAE,EAAE,CAAC;gBACP,MAAM,iBAAiB,GAAG,2BAA2B,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBAC9D,IAAI,iBAAiB,EAAE,CAAC;oBACtB,oBAAoB,CAAC,GAAG,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;gBAC9D,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,IAAI;IAClB,OAAO;QACL,eAAe;QACf,oBAAoB;KACrB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,IAAI;IAClB,OAAO,CAAC,MAAM,CAAC,CAAC;AAClB,CAAC","sourcesContent":["// Copyright 2024 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.\nimport * as Helpers from '../helpers/helpers.js';\nimport * as Types from '../types/types.js';\n\nimport type {HandlerName} from './types.js';\n\nexport interface Data {\n animationFrames: Types.Events.SyntheticAnimationFramePair[];\n presentationForFrame: WeakMap<Types.Events.SyntheticAnimationFramePair, Types.Events.AnimationFramePresentation>;\n}\n\nfunction threadKey(data: Types.Events.Event): string {\n return `${data.pid}-${data.tid}`;\n}\n// Track all the start + end events. We key them by the PID+TID so we don't\n// accidentally pair across different threads.\nlet animationFrameStarts = new Map<string, Types.Events.AnimationFrameAsyncStart[]>();\nlet animationFrameEnds = new Map<string, Types.Events.AnimationFrameAsyncEnd[]>();\n// Store all the AnimationFrame::Presentation events. Key them by their ID for\n// easy look-up later on when we associate one to the AnimationFrame event.\nlet animationFramePresentations = new Map<string, Types.Events.AnimationFramePresentation>();\n\n// The final list of animation frames that we return.\nlet animationFrames: Types.Events.SyntheticAnimationFramePair[] = [];\n\nlet presentationForFrame =\n new WeakMap<Types.Events.SyntheticAnimationFramePair, Types.Events.AnimationFramePresentation>();\n\nexport function reset(): void {\n animationFrameStarts = new Map();\n animationFrameEnds = new Map();\n animationFrames = [];\n presentationForFrame = new WeakMap();\n animationFramePresentations = new Map();\n isEnabled = false;\n}\n\nlet isEnabled = false;\nexport function handleUserConfig(config: Types.Configuration.Configuration): void {\n isEnabled = config.enableAnimationsFrameHandler;\n}\n\nexport function handleEvent(event: Types.Events.Event): void {\n if (!isEnabled) {\n return;\n }\n\n if (Types.Events.isAnimationFrameAsyncStart(event)) {\n const key = threadKey(event);\n const existing = animationFrameStarts.get(key) ?? [];\n existing.push(event);\n animationFrameStarts.set(key, existing);\n } else if (Types.Events.isAnimationFrameAsyncEnd(event)) {\n const key = threadKey(event);\n const existing = animationFrameEnds.get(key) ?? [];\n existing.push(event);\n animationFrameEnds.set(key, existing);\n } else if (Types.Events.isAnimationFramePresentation(event) && event.args?.id) {\n animationFramePresentations.set(event.args.id, event);\n }\n}\n\nexport async function finalize(): Promise<void> {\n // AnimationFrames are represented with begin & end events on a stack; so we\n // can pair them by walking through the list of start events and pairing with\n // the same index in the list of end events, once both lists are sorted by\n // timestamp.\n // We walk through the set of begin/end events we gathered per pid+tid and\n // pair those up.\n // Unfortunately we cannot use the pairing helpers in Helpers.Trace because\n // only the begin event has an ID; the end event does not. But because we\n // know that AnimationFrames are sequential and do not overlap, we can pair\n // up events easily.\n for (const [key, startEvents] of animationFrameStarts.entries()) {\n const endEvents = animationFrameEnds.get(key);\n if (!endEvents) {\n continue;\n }\n\n Helpers.Trace.sortTraceEventsInPlace(startEvents);\n Helpers.Trace.sortTraceEventsInPlace(endEvents);\n\n for (let i = 0; i < startEvents.length; i++) {\n const endEvent = endEvents.at(i);\n if (!endEvent) {\n // Invalid data: break. We can't pair any other events up.\n break;\n }\n const startEvent = startEvents[i];\n\n const syntheticEvent = Helpers.SyntheticEvents.SyntheticEventsManager\n .registerSyntheticEvent<Types.Events.SyntheticAnimationFramePair>({\n rawSourceEvent: startEvent,\n ...startEvent,\n dur: Types.Timing.Micro(endEvent.ts - startEvent.ts),\n args: {\n data: {\n beginEvent: startEvent,\n endEvent,\n },\n },\n });\n animationFrames.push(syntheticEvent);\n\n // AnimationFrame begin events + AnimationFrame::Presentation events share\n // an args.id, so we can pair them up based on that.\n const id = startEvent.args?.id;\n if (id) {\n const presentationEvent = animationFramePresentations.get(id);\n if (presentationEvent) {\n presentationForFrame.set(syntheticEvent, presentationEvent);\n }\n }\n }\n }\n}\n\nexport function data(): Data {\n return {\n animationFrames,\n presentationForFrame,\n };\n}\n\nexport function deps(): HandlerName[] {\n return ['Meta'];\n}\n"]}
@@ -0,0 +1,27 @@
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 animations = [];
7
+ let animationsSyntheticEvents = [];
8
+ export function reset() {
9
+ animations = [];
10
+ animationsSyntheticEvents = [];
11
+ }
12
+ export function handleEvent(event) {
13
+ if (Types.Events.isAnimation(event)) {
14
+ animations.push(event);
15
+ return;
16
+ }
17
+ }
18
+ export async function finalize() {
19
+ const syntheticEvents = Helpers.Trace.createMatchedSortedSyntheticEvents(animations);
20
+ animationsSyntheticEvents.push(...syntheticEvents);
21
+ }
22
+ export function data() {
23
+ return {
24
+ animations: animationsSyntheticEvents,
25
+ };
26
+ }
27
+ //# sourceMappingURL=AnimationHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnimationHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/AnimationHandler.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,IAAI,UAAU,GAA6B,EAAE,CAAC;AAC9C,IAAI,yBAAyB,GAA0C,EAAE,CAAC;AAM1E,MAAM,UAAU,KAAK;IACnB,UAAU,GAAG,EAAE,CAAC;IAChB,yBAAyB,GAAG,EAAE,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAyB;IACnD,IAAI,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QACpC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvB,OAAO;IACT,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC5B,MAAM,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,kCAAkC,CAAC,UAAU,CAAC,CAAC;IACrF,yBAAyB,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,IAAI;IAClB,OAAO;QACL,UAAU,EAAE,yBAAyB;KACtC,CAAC;AACJ,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\nlet animations: Types.Events.Animation[] = [];\nlet animationsSyntheticEvents: Types.Events.SyntheticAnimationPair[] = [];\n\nexport interface AnimationData {\n animations: readonly Types.Events.SyntheticAnimationPair[];\n}\n\nexport function reset(): void {\n animations = [];\n animationsSyntheticEvents = [];\n}\n\nexport function handleEvent(event: Types.Events.Event): void {\n if (Types.Events.isAnimation(event)) {\n animations.push(event);\n return;\n }\n}\n\nexport async function finalize(): Promise<void> {\n const syntheticEvents = Helpers.Trace.createMatchedSortedSyntheticEvents(animations);\n animationsSyntheticEvents.push(...syntheticEvents);\n}\n\nexport function data(): AnimationData {\n return {\n animations: animationsSyntheticEvents,\n };\n}\n"]}
@@ -0,0 +1,188 @@
1
+ // Copyright 2024 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 flowsHandlerData } from './FlowsHandler.js';
7
+ import { data as rendererHandlerData } from './RendererHandler.js';
8
+ let schedulerToRunEntryPoints = new Map();
9
+ let taskScheduleForTaskRunEvent = new WeakMap();
10
+ let asyncCallToScheduler = new WeakMap();
11
+ let runEntryPointToScheduler = new WeakMap();
12
+ export function reset() {
13
+ schedulerToRunEntryPoints = new Map();
14
+ asyncCallToScheduler = new WeakMap();
15
+ taskScheduleForTaskRunEvent = new WeakMap();
16
+ runEntryPointToScheduler = new WeakMap();
17
+ }
18
+ export function handleEvent(_) {
19
+ }
20
+ export async function finalize() {
21
+ const { flows } = flowsHandlerData();
22
+ const { entryToNode } = rendererHandlerData();
23
+ // Process async task flows
24
+ for (const flow of flows) {
25
+ let maybeAsyncTaskScheduled = flow.at(0);
26
+ if (!maybeAsyncTaskScheduled) {
27
+ continue;
28
+ }
29
+ if (Types.Events.isDebuggerAsyncTaskRun(maybeAsyncTaskScheduled)) {
30
+ // Sometimes a AsyncTaskRun event run can incorrectly appear as
31
+ // initiated by another AsyncTaskRun from Perfetto's flows
32
+ // perspective.
33
+ // For example, in this snippet:
34
+ //
35
+ // const myTask = console.createTask('hola'); // creates an AsyncTaskSchedule
36
+ // myTask.run(something); // creates an AsyncTaskRun
37
+ // myTask.run(somethingElse); // creates an AsyncTaskRun
38
+ //
39
+ // or also in this one
40
+ //
41
+ // setInterval(something); // creates multiple connected AsyncTaskRun.
42
+ //
43
+ // Because the flow id is created based on the task's memory address,
44
+ // the three events will end up belonging to the same flow (even if
45
+ // in the frontend we receive it as pairs), and elements in a flow
46
+ // are connected to their immediately consecutive neighbor.
47
+ //
48
+ // To ensure we use the right Schedule event, if the "initiating"
49
+ // portion of the flow is a Run event, we look for any corresponding
50
+ // Schedule event that we might have found before.
51
+ maybeAsyncTaskScheduled = taskScheduleForTaskRunEvent.get(maybeAsyncTaskScheduled);
52
+ }
53
+ if (!maybeAsyncTaskScheduled || !Types.Events.isDebuggerAsyncTaskScheduled(maybeAsyncTaskScheduled)) {
54
+ continue;
55
+ }
56
+ const taskName = maybeAsyncTaskScheduled.args.taskName;
57
+ const asyncTaskRun = flow.at(1);
58
+ if (!asyncTaskRun || !Types.Events.isDebuggerAsyncTaskRun(asyncTaskRun)) {
59
+ // Unexpected flow shape, ignore.
60
+ continue;
61
+ }
62
+ // Cache the Schedule event for this Run for future reference.
63
+ taskScheduleForTaskRunEvent.set(asyncTaskRun, maybeAsyncTaskScheduled);
64
+ // Get the JS call scheduled the task.
65
+ const asyncCaller = findNearestJSAncestor(maybeAsyncTaskScheduled, entryToNode);
66
+ // Get the trace entrypoint for the scheduled task (e.g. FunctionCall, etc.).
67
+ const asyncEntryPoint = findFirstJsInvocationForAsyncTaskRun(asyncTaskRun, entryToNode);
68
+ // Store the async relationship between traces to be shown with initiator arrows.
69
+ // Default to the AsyncTask events in case the JS entrypoints aren't found.
70
+ runEntryPointToScheduler.set(asyncEntryPoint || asyncTaskRun, { taskName, scheduler: asyncCaller || maybeAsyncTaskScheduled });
71
+ if (!asyncCaller || !asyncEntryPoint) {
72
+ // Unexpected async call trace data shape, ignore.
73
+ continue;
74
+ }
75
+ // Set scheduler -> scheduled mapping.
76
+ // The scheduled being the JS entrypoint
77
+ const entryPoints = Platform.MapUtilities.getWithDefault(schedulerToRunEntryPoints, asyncCaller, () => []);
78
+ entryPoints.push(asyncEntryPoint);
79
+ // Set scheduled -> scheduler mapping.
80
+ // The scheduled being the JS calls (instead of the entrypoints as
81
+ // above, for usage ergonomics).
82
+ const scheduledProfileCalls = findFirstJSCallsForAsyncTaskRun(asyncTaskRun, entryToNode);
83
+ for (const call of scheduledProfileCalls) {
84
+ asyncCallToScheduler.set(call, { taskName, scheduler: asyncCaller });
85
+ }
86
+ }
87
+ }
88
+ /**
89
+ * Given a DebuggerAsyncTaskScheduled event, returns its closest
90
+ * ProfileCall or JS invocation ancestor, which represents the JS call
91
+ * that scheduled the async task.
92
+ */
93
+ function findNearestJSAncestor(asyncTaskScheduled, entryToNode) {
94
+ let node = entryToNode.get(asyncTaskScheduled)?.parent;
95
+ while (node) {
96
+ if (Types.Events.isProfileCall(node.entry) || acceptJSInvocationsPredicate(node.entry)) {
97
+ return node.entry;
98
+ }
99
+ node = node.parent;
100
+ }
101
+ return null;
102
+ }
103
+ /**
104
+ * Entrypoints to JS execution in the timeline. We ignore those starting
105
+ * with 'v8' because they aren't shown in the timeline, and ultimately
106
+ * this function's output results in "initiated" events, so ideally this
107
+ * returns events that end up in the flame chart.
108
+ */
109
+ function acceptJSInvocationsPredicate(event) {
110
+ const eventIsConsoleRunTask = Types.Events.isConsoleRunTask(event);
111
+ const eventIsV8EntryPoint = event.name.startsWith('v8') || event.name.startsWith('V8');
112
+ return Types.Events.isJSInvocationEvent(event) && (eventIsConsoleRunTask || !eventIsV8EntryPoint);
113
+ }
114
+ /**
115
+ * Given a DebuggerAsyncTaskRun event, returns its closest JS entry
116
+ * point descendant, which contains the task being scheduled.
117
+ */
118
+ function findFirstJsInvocationForAsyncTaskRun(asyncTaskRun, entryToNode) {
119
+ // Ignore descendants of other DebuggerAsyncTaskRuns since they
120
+ // are part of another async task and have to be handled separately
121
+ return findFirstDescendantsOfType(asyncTaskRun, entryToNode, acceptJSInvocationsPredicate, Types.Events.isDebuggerAsyncTaskRun)
122
+ .at(0);
123
+ }
124
+ /**
125
+ * Given an async task run event, returns the top level call frames
126
+ * (profile calls) directly called by the async task. This implies that
127
+ * any profile calls under another async task run event are ignored.
128
+ * These profile calls represent the JS task being scheduled, AKA
129
+ * the other part of the async stack.
130
+ *
131
+ * For example, here the profile calls "js 1", "js 2" and "js 4" would
132
+ * be returned:
133
+ *
134
+ * |------------------Async Task Run------------------|
135
+ * |--FunctionCall--| |--FunctionCall--|
136
+ * |-js 1-||-js 2-| |-js 4-|
137
+ * |-js 3-|
138
+ *
139
+ * But here, only "js 1" and "js 2" would be returned:
140
+ *
141
+ * |------------------Async Task Run------------------|
142
+ * |--FunctionCall--| |------------------------|
143
+ * |-js 1-||-js 2-| |---Async Task Run--|
144
+ * |-js 3-| |--FunctionCall--|
145
+ * |-js 4-|
146
+ */
147
+ function findFirstJSCallsForAsyncTaskRun(asyncTaskRun, entryToNode) {
148
+ // Ignore descendants of other DebuggerAsyncTaskRuns since they
149
+ // are part of another async task and have to be handled separately
150
+ return findFirstDescendantsOfType(asyncTaskRun, entryToNode, Types.Events.isProfileCall, Types.Events.isDebuggerAsyncTaskRun);
151
+ }
152
+ /**
153
+ * Given a root event returns all the first descendants that meet a
154
+ * predicate condition (predicateAccept) while ignoring subtrees whose
155
+ * top event meets an ignore condition (predicateIgnore).
156
+ */
157
+ function findFirstDescendantsOfType(root, entryToNode, predicateAccept, predicateIgnore) {
158
+ const node = entryToNode.get(root);
159
+ if (!node) {
160
+ return [];
161
+ }
162
+ const childrenGroups = [[...node.children]];
163
+ const firstDescendants = [];
164
+ for (let i = 0; i < childrenGroups.length; i++) {
165
+ const siblings = childrenGroups[i];
166
+ for (let j = 0; j < siblings.length; j++) {
167
+ const node = siblings[j];
168
+ if (predicateAccept(node.entry)) {
169
+ firstDescendants.push(node.entry);
170
+ }
171
+ else if (!predicateIgnore(node.entry)) {
172
+ childrenGroups.push([...node.children]);
173
+ }
174
+ }
175
+ }
176
+ return firstDescendants;
177
+ }
178
+ export function data() {
179
+ return {
180
+ schedulerToRunEntryPoints,
181
+ asyncCallToScheduler,
182
+ runEntryPointToScheduler,
183
+ };
184
+ }
185
+ export function deps() {
186
+ return ['Renderer', 'Flows'];
187
+ }
188
+ //# sourceMappingURL=AsyncJSCallsHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AsyncJSCallsHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/AsyncJSCallsHandler.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAC7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAE/D,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,IAAI,IAAI,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAC,IAAI,IAAI,mBAAmB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,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC1C,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,IAAI;IAwBlB,OAAO;QACL,yBAAyB;QACzB,oBAAoB;QACpB,wBAAwB;KACzB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,IAAI;IAClB,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["// Copyright 2024 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.\nimport * as Platform from '../../../core/platform/platform.js';\nimport type * as Helpers from '../helpers/helpers.js';\nimport * as Types from '../types/types.js';\n\nimport {data as flowsHandlerData} from './FlowsHandler.js';\nimport {data as rendererHandlerData} from './RendererHandler.js';\n\nlet schedulerToRunEntryPoints: Map<Types.Events.Event, Types.Events.Event[]> =\n new Map<Types.Events.Event, Types.Events.Event[]>();\n\nlet taskScheduleForTaskRunEvent: WeakMap<Types.Events.DebuggerAsyncTaskRun, Types.Events.DebuggerAsyncTaskScheduled> =\n new WeakMap<Types.Events.DebuggerAsyncTaskRun, Types.Events.DebuggerAsyncTaskScheduled>();\nlet asyncCallToScheduler:\n WeakMap<Types.Events.SyntheticProfileCall, {taskName: string, scheduler: Types.Events.Event}> =\n new WeakMap<Types.Events.SyntheticProfileCall, {taskName: string, scheduler: Types.Events.Event}>();\n\nlet runEntryPointToScheduler: WeakMap<Types.Events.Event, {taskName: string, scheduler: Types.Events.Event}> =\n new WeakMap<Types.Events.Event, {taskName: string, scheduler: Types.Events.Event}>();\n\nexport function reset(): void {\n schedulerToRunEntryPoints = new Map();\n asyncCallToScheduler = new WeakMap();\n taskScheduleForTaskRunEvent = new WeakMap();\n runEntryPointToScheduler = new WeakMap();\n}\n\nexport function handleEvent(_: Types.Events.Event): void {\n}\n\nexport async function finalize(): Promise<void> {\n const {flows} = flowsHandlerData();\n const {entryToNode} = rendererHandlerData();\n // Process async task flows\n for (const flow of flows) {\n let maybeAsyncTaskScheduled = flow.at(0);\n if (!maybeAsyncTaskScheduled) {\n continue;\n }\n if (Types.Events.isDebuggerAsyncTaskRun(maybeAsyncTaskScheduled)) {\n // Sometimes a AsyncTaskRun event run can incorrectly appear as\n // initiated by another AsyncTaskRun from Perfetto's flows\n // perspective.\n // For example, in this snippet:\n //\n // const myTask = console.createTask('hola'); // creates an AsyncTaskSchedule\n // myTask.run(something); // creates an AsyncTaskRun\n // myTask.run(somethingElse); // creates an AsyncTaskRun\n //\n // or also in this one\n //\n // setInterval(something); // creates multiple connected AsyncTaskRun.\n //\n // Because the flow id is created based on the task's memory address,\n // the three events will end up belonging to the same flow (even if\n // in the frontend we receive it as pairs), and elements in a flow\n // are connected to their immediately consecutive neighbor.\n //\n // To ensure we use the right Schedule event, if the \"initiating\"\n // portion of the flow is a Run event, we look for any corresponding\n // Schedule event that we might have found before.\n maybeAsyncTaskScheduled = taskScheduleForTaskRunEvent.get(maybeAsyncTaskScheduled);\n }\n if (!maybeAsyncTaskScheduled || !Types.Events.isDebuggerAsyncTaskScheduled(maybeAsyncTaskScheduled)) {\n continue;\n }\n const taskName = maybeAsyncTaskScheduled.args.taskName;\n const asyncTaskRun = flow.at(1);\n if (!asyncTaskRun || !Types.Events.isDebuggerAsyncTaskRun(asyncTaskRun)) {\n // Unexpected flow shape, ignore.\n continue;\n }\n // Cache the Schedule event for this Run for future reference.\n taskScheduleForTaskRunEvent.set(asyncTaskRun, maybeAsyncTaskScheduled);\n\n // Get the JS call scheduled the task.\n const asyncCaller = findNearestJSAncestor(maybeAsyncTaskScheduled, entryToNode);\n\n // Get the trace entrypoint for the scheduled task (e.g. FunctionCall, etc.).\n const asyncEntryPoint = findFirstJsInvocationForAsyncTaskRun(asyncTaskRun, entryToNode);\n\n // Store the async relationship between traces to be shown with initiator arrows.\n // Default to the AsyncTask events in case the JS entrypoints aren't found.\n runEntryPointToScheduler.set(\n asyncEntryPoint || asyncTaskRun, {taskName, scheduler: asyncCaller || maybeAsyncTaskScheduled});\n if (!asyncCaller || !asyncEntryPoint) {\n // Unexpected async call trace data shape, ignore.\n continue;\n }\n // Set scheduler -> scheduled mapping.\n // The scheduled being the JS entrypoint\n const entryPoints = Platform.MapUtilities.getWithDefault(schedulerToRunEntryPoints, asyncCaller, () => []);\n entryPoints.push(asyncEntryPoint);\n\n // Set scheduled -> scheduler mapping.\n // The scheduled being the JS calls (instead of the entrypoints as\n // above, for usage ergonomics).\n const scheduledProfileCalls = findFirstJSCallsForAsyncTaskRun(asyncTaskRun, entryToNode);\n for (const call of scheduledProfileCalls) {\n asyncCallToScheduler.set(call, {taskName, scheduler: asyncCaller});\n }\n }\n}\n/**\n * Given a DebuggerAsyncTaskScheduled event, returns its closest\n * ProfileCall or JS invocation ancestor, which represents the JS call\n * that scheduled the async task.\n */\nfunction findNearestJSAncestor(\n asyncTaskScheduled: Types.Events.DebuggerAsyncTaskScheduled,\n entryToNode: Map<Types.Events.Event, Helpers.TreeHelpers.TraceEntryNode>): Types.Events.Event|null {\n let node = entryToNode.get(asyncTaskScheduled)?.parent;\n while (node) {\n if (Types.Events.isProfileCall(node.entry) || acceptJSInvocationsPredicate(node.entry)) {\n return node.entry;\n }\n node = node.parent;\n }\n return null;\n}\n/**\n * Entrypoints to JS execution in the timeline. We ignore those starting\n * with 'v8' because they aren't shown in the timeline, and ultimately\n * this function's output results in \"initiated\" events, so ideally this\n * returns events that end up in the flame chart.\n */\nfunction acceptJSInvocationsPredicate(event: Types.Events.Event): event is Types.Events.Event {\n const eventIsConsoleRunTask = Types.Events.isConsoleRunTask(event);\n const eventIsV8EntryPoint = event.name.startsWith('v8') || event.name.startsWith('V8');\n return Types.Events.isJSInvocationEvent(event) && (eventIsConsoleRunTask || !eventIsV8EntryPoint);\n}\n\n/**\n * Given a DebuggerAsyncTaskRun event, returns its closest JS entry\n * point descendant, which contains the task being scheduled.\n */\nfunction findFirstJsInvocationForAsyncTaskRun(\n asyncTaskRun: Types.Events.DebuggerAsyncTaskRun,\n entryToNode: Map<Types.Events.Event, Helpers.TreeHelpers.TraceEntryNode>): Types.Events.Event|undefined {\n // Ignore descendants of other DebuggerAsyncTaskRuns since they\n // are part of another async task and have to be handled separately\n return findFirstDescendantsOfType(\n asyncTaskRun, entryToNode, acceptJSInvocationsPredicate, Types.Events.isDebuggerAsyncTaskRun)\n .at(0);\n}\n\n/**\n * Given an async task run event, returns the top level call frames\n * (profile calls) directly called by the async task. This implies that\n * any profile calls under another async task run event are ignored.\n * These profile calls represent the JS task being scheduled, AKA\n * the other part of the async stack.\n *\n * For example, here the profile calls \"js 1\", \"js 2\" and \"js 4\" would\n * be returned:\n *\n * |------------------Async Task Run------------------|\n * |--FunctionCall--| |--FunctionCall--|\n * |-js 1-||-js 2-| |-js 4-|\n * |-js 3-|\n *\n * But here, only \"js 1\" and \"js 2\" would be returned:\n *\n * |------------------Async Task Run------------------|\n * |--FunctionCall--| |------------------------|\n * |-js 1-||-js 2-| |---Async Task Run--|\n * |-js 3-| |--FunctionCall--|\n * |-js 4-|\n */\nfunction findFirstJSCallsForAsyncTaskRun(\n asyncTaskRun: Types.Events.DebuggerAsyncTaskRun,\n entryToNode: Map<Types.Events.Event, Helpers.TreeHelpers.TraceEntryNode>): Types.Events.SyntheticProfileCall[] {\n // Ignore descendants of other DebuggerAsyncTaskRuns since they\n // are part of another async task and have to be handled separately\n return findFirstDescendantsOfType(\n asyncTaskRun, entryToNode, Types.Events.isProfileCall, Types.Events.isDebuggerAsyncTaskRun);\n}\n\n/**\n * Given a root event returns all the first descendants that meet a\n * predicate condition (predicateAccept) while ignoring subtrees whose\n * top event meets an ignore condition (predicateIgnore).\n */\nfunction findFirstDescendantsOfType<T extends Types.Events.Event>(\n root: Types.Events.Event, entryToNode: Map<Types.Events.Event, Helpers.TreeHelpers.TraceEntryNode>,\n predicateAccept: (event: Types.Events.Event) => event is T,\n predicateIgnore: (event: Types.Events.Event) => boolean): T[] {\n const node = entryToNode.get(root);\n if (!node) {\n return [];\n }\n const childrenGroups = [[...node.children]];\n const firstDescendants = [];\n for (let i = 0; i < childrenGroups.length; i++) {\n const siblings = childrenGroups[i];\n for (let j = 0; j < siblings.length; j++) {\n const node = siblings[j];\n if (predicateAccept(node.entry)) {\n firstDescendants.push(node.entry);\n } else if (!predicateIgnore(node.entry)) {\n childrenGroups.push([...node.children]);\n }\n }\n }\n return firstDescendants;\n}\n\nexport function data(): {\n // Given a profile call, returns the JS entrypoint it scheduled (if any).\n // For example, given a setTimeout call, returns the JS entry point\n // trace event for the timeout callback run event (usually a\n // FunctionCall event).\n schedulerToRunEntryPoints: typeof schedulerToRunEntryPoints,\n // Given a profile call, returns the profile call that scheduled it.\n // For example given a timeout callback run event, returns its\n // setTimeout call event.\n asyncCallToScheduler: typeof asyncCallToScheduler,\n // Given a trace event, returns its corresponding async parent trace\n // event caused by an async js call. This can be used as a fallback\n // for cases where a corresponding JS call is not found at either\n // end of the async task scheduling pair (e.g. due to sampling data\n // incompleteness).\n // In the StackTraceForEvent helper, as we move up the call tree,\n // this is used to jump to an async parent stack from a\n // non-profile call trace event in cases where a profile call wasn't\n // found before. In theory we should make the jump from the scheduled\n // profile call using `asyncCallToScheduler`, but its possible that\n // the the call information isn't available to us as a consequence of\n // missing samples.\n runEntryPointToScheduler: typeof runEntryPointToScheduler,\n} {\n return {\n schedulerToRunEntryPoints,\n asyncCallToScheduler,\n runEntryPointToScheduler,\n };\n}\n\nexport function deps(): ['Renderer', 'Flows'] {\n return ['Renderer', 'Flows'];\n}\n"]}