@paulirish/trace_engine 0.0.65 → 0.0.67-beta.0

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 (720) hide show
  1. package/README.md +19 -17
  2. package/analyze-trace.mjs +6 -144
  3. package/core/common/Base64.d.ts +12 -0
  4. package/core/common/CharacterIdMap.d.ts +5 -0
  5. package/core/common/Color.d.ts +357 -0
  6. package/core/common/ColorConverter.d.ts +26 -0
  7. package/core/common/ColorUtils.d.ts +45 -0
  8. package/core/common/Console.d.ts +54 -0
  9. package/core/common/Debouncer.d.ts +8 -0
  10. package/core/common/EventTarget.d.ts +22 -0
  11. package/core/common/Gzip.d.ts +23 -0
  12. package/core/common/JavaScriptMetaData.d.ts +20 -0
  13. package/core/common/Lazy.d.ts +4 -0
  14. package/core/common/MapWithDefault.d.ts +9 -0
  15. package/core/common/Mutex.d.ts +13 -0
  16. package/core/common/Object.d.ts +20 -0
  17. package/core/common/ParsedURL.d.ts +87 -0
  18. package/core/common/Progress.d.ts +47 -0
  19. package/core/common/ResolverBase.d.ts +29 -0
  20. package/core/common/ResourceType.d.ts +52 -0
  21. package/core/common/ReturnToPanel.d.ts +10 -0
  22. package/core/common/Revealer.d.ts +66 -0
  23. package/core/common/Runnable.d.ts +14 -0
  24. package/core/common/SegmentedRange.d.ts +14 -0
  25. package/core/common/SettingRegistration.d.ts +136 -0
  26. package/core/common/Settings.d.ts +226 -0
  27. package/core/common/SimpleHistoryManager.d.ts +20 -0
  28. package/core/common/Srcset.d.ts +16 -0
  29. package/core/common/StringOutputStream.d.ts +10 -0
  30. package/core/common/TextDictionary.d.ts +11 -0
  31. package/core/common/Throttler.d.ts +12 -0
  32. package/core/common/Trie.d.ts +24 -0
  33. package/core/common/VersionController.d.ts +85 -0
  34. package/core/common/common.d.ts +33 -1
  35. package/core/host/AidaClient.d.ts +73 -0
  36. package/core/host/AidaClientTypes.d.ts +355 -0
  37. package/core/host/AidaGcaTranslation.d.ts +10 -0
  38. package/core/host/DispatchHttpRequestClient.d.ts +14 -0
  39. package/core/host/GcaClient.d.ts +14 -0
  40. package/core/host/GcaTypes.d.ts +411 -0
  41. package/core/host/GdpClient.d.ts +84 -0
  42. package/core/host/InspectorFrontendHost.d.ts +29 -0
  43. package/core/host/InspectorFrontendHostAPI.d.ts +425 -0
  44. package/core/host/InspectorFrontendHostStub.d.ts +151 -0
  45. package/core/host/Platform.d.ts +11 -0
  46. package/core/host/ResourceLoader.d.ts +15 -0
  47. package/core/host/UserMetrics.d.ts +116 -0
  48. package/core/host/UserMetricsEnums.d.ts +883 -0
  49. package/core/host/host.d.ts +13 -1
  50. package/core/i18n/ByteUtilities.d.ts +11 -0
  51. package/core/i18n/DevToolsLocale.d.ts +41 -0
  52. package/core/i18n/NumberFormatter.d.ts +11 -0
  53. package/core/i18n/i18n.d.ts +10 -0
  54. package/core/i18n/i18nImpl.d.ts +64 -0
  55. package/core/i18n/i18nTypes.d.ts +5 -0
  56. package/core/i18n/locales.d.ts +15 -0
  57. package/core/i18n/time-utilities.d.ts +16 -0
  58. package/core/platform/ArrayUtilities.d.ts +5 -0
  59. package/core/platform/HostRuntime.d.ts +1 -0
  60. package/core/platform/Size.d.ts +12 -0
  61. package/core/platform/StringUtilities.d.ts +28 -0
  62. package/core/platform/TypescriptUtilities.d.ts +0 -6
  63. package/core/platform/api/HostRuntime.d.ts +25 -0
  64. package/core/platform/platform.d.ts +2 -1
  65. package/core/protocol_client/CDPConnection.d.ts +77 -0
  66. package/core/protocol_client/ConnectionTransport.d.ts +9 -0
  67. package/core/protocol_client/DevToolsCDPConnection.d.ts +16 -0
  68. package/core/protocol_client/InspectorBackend.d.ts +223 -0
  69. package/core/protocol_client/protocol_client.d.ts +5 -0
  70. package/core/root/DevToolsContext.d.ts +34 -0
  71. package/core/root/ExperimentNames.d.ts +8 -0
  72. package/core/root/Runtime.d.ts +351 -0
  73. package/core/root/root.d.ts +4 -1
  74. package/core/sdk/AccessibilityModel.d.ts +76 -0
  75. package/core/sdk/AnimationModel.d.ts +161 -0
  76. package/core/sdk/AutofillModel.d.ts +23 -0
  77. package/core/sdk/CPUProfilerModel.d.ts +46 -0
  78. package/core/sdk/CPUThrottlingManager.d.ts +47 -0
  79. package/core/sdk/CSSContainerQuery.d.ts +42 -0
  80. package/core/sdk/CSSFontFace.d.ts +10 -0
  81. package/core/sdk/CSSLayer.d.ts +9 -0
  82. package/core/sdk/CSSLocation.d.ts +14 -0
  83. package/core/sdk/CSSMatchedStyles.d.ts +138 -0
  84. package/core/sdk/CSSMedia.d.ts +36 -0
  85. package/core/sdk/CSSMetadata.d.ts +87 -0
  86. package/core/sdk/CSSModel.d.ts +180 -0
  87. package/core/sdk/CSSNavigation.d.ts +10 -0
  88. package/core/sdk/CSSProperty.d.ts +53 -0
  89. package/core/sdk/CSSPropertyParser.d.ts +131 -0
  90. package/core/sdk/CSSPropertyParserMatchers.d.ts +442 -0
  91. package/core/sdk/CSSQuery.d.ts +22 -0
  92. package/core/sdk/CSSRule.d.ts +132 -0
  93. package/core/sdk/CSSScope.d.ts +9 -0
  94. package/core/sdk/CSSStartingStyle.d.ts +9 -0
  95. package/core/sdk/CSSStyleDeclaration.d.ts +38 -0
  96. package/core/sdk/CSSStyleSheetHeader.d.ts +53 -0
  97. package/core/sdk/CSSSupports.d.ts +10 -0
  98. package/core/sdk/CategorizedBreakpoint.d.ts +42 -0
  99. package/core/sdk/ChildTargetManager.d.ts +40 -0
  100. package/core/sdk/CompilerSourceMappingContentProvider.d.ts +12 -0
  101. package/core/sdk/Connections.d.ts +36 -0
  102. package/core/sdk/ConsoleModel.d.ts +127 -0
  103. package/core/sdk/ConsoleModelTypes.d.ts +6 -0
  104. package/core/sdk/Cookie.d.ts +68 -0
  105. package/core/sdk/CookieModel.d.ts +31 -0
  106. package/core/sdk/CookieParser.d.ts +14 -0
  107. package/core/sdk/CrashReportContextModel.d.ts +8 -0
  108. package/core/sdk/DOMDebuggerModel.d.ts +127 -0
  109. package/core/sdk/DOMModel.d.ts +436 -0
  110. package/core/sdk/DOMStorageModel.d.ts +79 -0
  111. package/core/sdk/DebuggerModel.d.ts +272 -0
  112. package/core/sdk/EmulationModel.d.ts +95 -0
  113. package/core/sdk/EnhancedTracesParser.d.ts +105 -0
  114. package/core/sdk/EventBreakpointsModel.d.ts +66 -0
  115. package/core/sdk/FrameAssociated.d.ts +6 -0
  116. package/core/sdk/FrameManager.d.ts +68 -0
  117. package/core/sdk/HeapProfilerModel.d.ts +75 -0
  118. package/core/sdk/HttpReasonPhraseStrings.d.ts +5 -0
  119. package/core/sdk/IOModel.d.ts +10 -0
  120. package/core/sdk/IsolateManager.d.ts +53 -0
  121. package/core/sdk/IssuesModel.d.ts +28 -0
  122. package/core/sdk/LayerTreeBase.d.ts +70 -0
  123. package/core/sdk/LogModel.d.ts +20 -0
  124. package/core/sdk/NetworkManager.d.ts +418 -0
  125. package/core/sdk/NetworkRequest.d.ts +469 -0
  126. package/core/sdk/NetworkRequestAccess.d.ts +91 -0
  127. package/core/sdk/OverlayColorGenerator.d.ts +14 -0
  128. package/core/sdk/OverlayModel.d.ts +186 -0
  129. package/core/sdk/OverlayPersistentHighlighter.d.ts +116 -0
  130. package/core/sdk/PageFunctions.d.ts +22 -0
  131. package/core/sdk/PageLoad.d.ts +14 -0
  132. package/core/sdk/PageResourceLoader.d.ts +111 -0
  133. package/core/sdk/PaintProfiler.d.ts +43 -0
  134. package/core/sdk/PerformanceMetricsModel.d.ts +12 -0
  135. package/core/sdk/PreloadingModel.d.ts +146 -0
  136. package/core/sdk/RehydratingConnection.d.ts +73 -0
  137. package/core/sdk/RehydratingObject.d.ts +59 -0
  138. package/core/sdk/RemoteObject.d.ts +210 -0
  139. package/core/sdk/Resource.d.ts +36 -0
  140. package/core/sdk/ResourceTreeModel.d.ts +278 -0
  141. package/core/sdk/RuntimeModel.d.ts +163 -0
  142. package/core/sdk/SDKModel.d.ts +30 -0
  143. package/core/sdk/SDKSettings.d.ts +53 -0
  144. package/core/sdk/ScopeTreeCache.d.ts +21 -0
  145. package/core/sdk/ScreenCaptureModel.d.ts +69 -0
  146. package/core/sdk/Script.d.ts +134 -0
  147. package/core/sdk/SecurityOrigin.d.ts +108 -0
  148. package/core/sdk/SecurityOriginManager.d.ts +23 -0
  149. package/core/sdk/ServerSentEvents.d.ts +18 -0
  150. package/core/sdk/ServerSentEventsProtocol.d.ts +18 -0
  151. package/core/sdk/ServerTiming.d.ts +24 -0
  152. package/core/sdk/ServiceWorkerCacheModel.d.ts +71 -0
  153. package/core/sdk/ServiceWorkerManager.d.ts +125 -0
  154. package/core/sdk/SourceMap.d.ts +197 -0
  155. package/core/sdk/SourceMapCache.d.ts +12 -0
  156. package/core/sdk/SourceMapFunctionRanges.d.ts +26 -0
  157. package/core/sdk/SourceMapManager.d.ts +46 -0
  158. package/core/sdk/SourceMapRangeMappings.d.ts +15 -0
  159. package/core/sdk/SourceMapScopeChainEntry.d.ts +23 -0
  160. package/core/sdk/SourceMapScopesInfo.d.ts +109 -0
  161. package/core/sdk/StorageBucketsModel.d.ts +48 -0
  162. package/core/sdk/StorageKeyManager.d.ts +38 -0
  163. package/core/sdk/Target.d.ts +79 -0
  164. package/core/sdk/TargetManager.d.ts +92 -0
  165. package/core/sdk/TraceObject.d.ts +43 -0
  166. package/core/sdk/WebAuthnModel.d.ts +29 -0
  167. package/core/sdk/sdk.d.ts +97 -1
  168. package/core/text_utils/CodeMirrorUtils.d.ts +3 -0
  169. package/core/text_utils/ContentData.d.ts +94 -0
  170. package/core/text_utils/ContentProvider.d.ts +42 -0
  171. package/core/text_utils/StaticContentProvider.d.ts +13 -0
  172. package/core/text_utils/StreamingContentData.d.ts +49 -0
  173. package/core/text_utils/Text.d.ts +19 -0
  174. package/core/text_utils/TextCursor.d.ts +9 -0
  175. package/core/text_utils/TextRange.d.ts +81 -0
  176. package/core/text_utils/TextUtils.d.ts +97 -0
  177. package/core/text_utils/WasmDisassembly.d.ts +29 -0
  178. package/core/text_utils/text_utils.d.ts +11 -0
  179. package/entrypoints/formatter_actions/formatter_actions.d.ts +48 -0
  180. package/generated/InspectorBackendCommands.d.ts +14 -0
  181. package/generated/SupportedCSSProperties.d.ts +18 -0
  182. package/generated/protocol-mapping.d.ts +5930 -0
  183. package/generated/protocol-proxy-api.d.ts +5396 -0
  184. package/generated/protocol.d.ts +736 -685
  185. package/index.js +6 -0
  186. package/locales/af.json +80 -62
  187. package/locales/am.json +363 -345
  188. package/locales/ar.json +364 -346
  189. package/locales/as.json +362 -344
  190. package/locales/az.json +353 -335
  191. package/locales/be.json +363 -345
  192. package/locales/bg.json +363 -345
  193. package/locales/bn.json +363 -345
  194. package/locales/bs.json +259 -241
  195. package/locales/ca.json +295 -277
  196. package/locales/cs.json +348 -330
  197. package/locales/cy.json +139 -121
  198. package/locales/da.json +222 -204
  199. package/locales/de.json +234 -216
  200. package/locales/el.json +348 -330
  201. package/locales/en-GB.json +36 -18
  202. package/locales/es-419.json +290 -272
  203. package/locales/es.json +292 -274
  204. package/locales/et.json +251 -233
  205. package/locales/eu.json +29 -11
  206. package/locales/fa.json +363 -345
  207. package/locales/fi.json +295 -277
  208. package/locales/fil.json +29 -11
  209. package/locales/fr-CA.json +320 -302
  210. package/locales/fr.json +317 -299
  211. package/locales/gl.json +276 -258
  212. package/locales/gu.json +364 -346
  213. package/locales/he.json +364 -346
  214. package/locales/hi.json +348 -330
  215. package/locales/hr.json +250 -232
  216. package/locales/hu.json +354 -336
  217. package/locales/hy.json +363 -345
  218. package/locales/id.json +27 -9
  219. package/locales/is.json +317 -299
  220. package/locales/it.json +154 -136
  221. package/locales/ja.json +363 -345
  222. package/locales/ka.json +364 -346
  223. package/locales/kk.json +364 -346
  224. package/locales/km.json +363 -345
  225. package/locales/kn.json +364 -346
  226. package/locales/ko.json +363 -345
  227. package/locales/ky.json +362 -344
  228. package/locales/lo.json +364 -346
  229. package/locales/lt.json +331 -313
  230. package/locales/lv.json +331 -313
  231. package/locales/mk.json +364 -346
  232. package/locales/ml.json +363 -345
  233. package/locales/mn.json +363 -345
  234. package/locales/mr.json +363 -345
  235. package/locales/ms.json +27 -9
  236. package/locales/my.json +362 -344
  237. package/locales/ne.json +348 -330
  238. package/locales/nl.json +84 -66
  239. package/locales/no.json +188 -170
  240. package/locales/or.json +363 -345
  241. package/locales/pa.json +363 -345
  242. package/locales/pl.json +322 -304
  243. package/locales/pt-PT.json +284 -266
  244. package/locales/pt.json +283 -265
  245. package/locales/ro.json +318 -300
  246. package/locales/ru.json +363 -345
  247. package/locales/si.json +364 -346
  248. package/locales/sk.json +345 -327
  249. package/locales/sl.json +231 -213
  250. package/locales/sq.json +329 -311
  251. package/locales/sr-Latn.json +267 -249
  252. package/locales/sr.json +364 -346
  253. package/locales/sv.json +296 -278
  254. package/locales/sw.json +35 -17
  255. package/locales/ta.json +364 -346
  256. package/locales/te.json +362 -344
  257. package/locales/th.json +364 -346
  258. package/locales/tr.json +337 -319
  259. package/locales/uk.json +363 -345
  260. package/locales/ur.json +364 -346
  261. package/locales/uz.json +175 -157
  262. package/locales/vi.json +364 -346
  263. package/locales/zh-HK.json +364 -346
  264. package/locales/zh-TW.json +363 -345
  265. package/locales/zh.json +363 -345
  266. package/locales/zu.json +35 -17
  267. package/models/crux-manager/CrUXManager.d.ts +107 -0
  268. package/models/crux-manager/crux-manager.d.ts +1 -0
  269. package/models/emulation/DeviceModeModel.d.ts +156 -0
  270. package/models/emulation/EmulatedDevices.d.ts +148 -0
  271. package/models/emulation/emulation.d.ts +3 -0
  272. package/models/formatter/FormatterWorkerPool.d.ts +58 -0
  273. package/models/formatter/ScriptFormatter.d.ts +11 -0
  274. package/models/formatter/formatter.d.ts +3 -0
  275. package/models/trace/ModelImpl.d.ts +2 -6
  276. package/models/trace/Processor.d.ts +2 -6
  277. package/models/trace/extras/StackTraceForEvent.d.ts +1 -1
  278. package/models/trace/extras/extras.d.ts +2 -7
  279. package/models/trace/handlers/FramesHandler.d.ts +1 -2
  280. package/models/trace/handlers/LayoutShiftsHandler.d.ts +2 -2
  281. package/models/trace/handlers/MetaHandler.d.ts +2 -3
  282. package/models/trace/handlers/ModelHandlers.d.ts +0 -1
  283. package/models/trace/handlers/PageLoadMetricsHandler.d.ts +2 -0
  284. package/models/trace/handlers/ScriptsHandler.d.ts +2 -2
  285. package/models/trace/handlers/Threads.d.ts +1 -3
  286. package/models/trace/handlers/UserTimingsHandler.d.ts +1 -1
  287. package/models/trace/helpers/Network.d.ts +3 -1
  288. package/models/trace/helpers/SyntheticEvents.d.ts +7 -0
  289. package/models/trace/insights/CLSCulprits.d.ts +6 -3
  290. package/models/trace/insights/Cache.d.ts +2 -1
  291. package/models/trace/insights/CharacterSet.d.ts +5 -4
  292. package/models/trace/insights/Common.d.ts +4 -4
  293. package/models/trace/insights/DOMSize.d.ts +4 -3
  294. package/models/trace/insights/DocumentLatency.d.ts +2 -1
  295. package/models/trace/insights/DuplicatedJavaScript.d.ts +9 -4
  296. package/models/trace/insights/FontDisplay.d.ts +11 -5
  297. package/models/trace/insights/ForcedReflow.d.ts +6 -6
  298. package/models/trace/insights/INPBreakdown.d.ts +5 -5
  299. package/models/trace/insights/ImageDelivery.d.ts +7 -7
  300. package/models/trace/insights/LCPBreakdown.d.ts +4 -3
  301. package/models/trace/insights/LCPDiscovery.d.ts +7 -6
  302. package/models/trace/insights/LegacyJavaScript.d.ts +9 -4
  303. package/models/trace/insights/ModernHTTP.d.ts +6 -6
  304. package/models/trace/insights/NetworkDependencyTree.d.ts +18 -96
  305. package/models/trace/insights/RenderBlocking.d.ts +4 -3
  306. package/models/trace/insights/SlowCSSSelector.d.ts +10 -9
  307. package/models/trace/insights/ThirdParties.d.ts +17 -8
  308. package/models/trace/insights/Viewport.d.ts +6 -4
  309. package/models/trace/insights/types.d.ts +10 -7
  310. package/models/trace/lantern/lantern.js +6 -8
  311. package/models/trace/lantern/simulation/Constants.d.ts +29 -28
  312. package/models/trace/trace.js +529 -18
  313. package/models/trace/types/Configuration.d.ts +12 -1
  314. package/models/trace/types/File.d.ts +6 -5
  315. package/models/trace/types/Overlays.d.ts +13 -3
  316. package/models/trace/types/Timing.js +6 -14
  317. package/models/trace/types/TraceEvents.d.ts +48 -18
  318. package/models/trace/types/TraceEvents.js +187 -884
  319. package/models/trace/types/types.js +6 -8
  320. package/package.json +30 -9
  321. package/third_party/codemirror.next/codemirror.next.d.ts +9196 -0
  322. package/third_party/i18n/i18n-impl.d.ts +25 -0
  323. package/third_party/i18n/i18n.d.ts +3 -0
  324. package/third_party/i18n/localized-string-set.d.ts +49 -0
  325. package/third_party/intl-messageformat/intl-messageformat.d.ts +1 -0
  326. package/third_party/legacy-javascript/legacy-javascript.d.ts +2 -1
  327. package/third_party/legacy-javascript/lib/legacy-javascript.d.ts +18 -0
  328. package/third_party/source-map-scopes-codec/package/src/builder/builder.d.ts +67 -0
  329. package/third_party/source-map-scopes-codec/package/src/builder/safe_builder.d.ts +38 -0
  330. package/third_party/source-map-scopes-codec/package/src/codec.d.ts +48 -0
  331. package/third_party/source-map-scopes-codec/package/src/decode/decode.d.ts +31 -0
  332. package/third_party/source-map-scopes-codec/package/src/encode/encode.d.ts +8 -0
  333. package/third_party/source-map-scopes-codec/package/src/encode/encoder.d.ts +6 -0
  334. package/third_party/source-map-scopes-codec/package/src/mod.d.ts +5 -0
  335. package/third_party/source-map-scopes-codec/package/src/scopes.d.ts +168 -0
  336. package/third_party/source-map-scopes-codec/package/src/util.d.ts +5 -0
  337. package/third_party/source-map-scopes-codec/package/src/vlq.d.ts +14 -0
  338. package/third_party/source-map-scopes-codec/source-map-scopes-codec.d.ts +1 -0
  339. package/third_party/third-party-web/lib/nostats-subset.d.ts +2 -0
  340. package/third_party/third-party-web/package/lib/index.d.ts +34 -0
  341. package/third_party/third-party-web/package/lib/subsets/nostats.d.ts +1 -0
  342. package/third_party/third-party-web/third-party-web.d.ts +2 -1
  343. package/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts +0 -13
  344. package/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts.map +0 -1
  345. package/.tmp/tsbuildinfo/analyze-trace.d.mts +0 -17
  346. package/.tmp/tsbuildinfo/analyze-trace.d.mts.map +0 -1
  347. package/.tmp/tsbuildinfo/models/trace/extras/polyfills.d.ts +0 -4
  348. package/.tmp/tsbuildinfo/models/trace/extras/polyfills.d.ts.map +0 -1
  349. package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts +0 -2
  350. package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts.map +0 -1
  351. package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts +0 -3
  352. package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts.map +0 -1
  353. package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +0 -1
  354. package/analyze-inspector-issues.mjs +0 -60
  355. package/core/common/common.js +0 -1
  356. package/core/host/host.js +0 -1
  357. package/core/platform/ArrayUtilities.js +0 -210
  358. package/core/platform/ArrayUtilities.js.map +0 -1
  359. package/core/platform/Brand.js +0 -5
  360. package/core/platform/Brand.js.map +0 -1
  361. package/core/platform/Constructor.js +0 -5
  362. package/core/platform/Constructor.js.map +0 -1
  363. package/core/platform/DateUtilities.js +0 -14
  364. package/core/platform/DateUtilities.js.map +0 -1
  365. package/core/platform/DevToolsPath.js +0 -28
  366. package/core/platform/DevToolsPath.js.map +0 -1
  367. package/core/platform/HostRuntime.js +0 -31
  368. package/core/platform/HostRuntime.js.map +0 -1
  369. package/core/platform/KeyboardUtilities.js +0 -22
  370. package/core/platform/KeyboardUtilities.js.map +0 -1
  371. package/core/platform/MapUtilities.js +0 -80
  372. package/core/platform/MapUtilities.js.map +0 -1
  373. package/core/platform/MimeType.js +0 -144
  374. package/core/platform/MimeType.js.map +0 -1
  375. package/core/platform/NumberUtilities.js +0 -73
  376. package/core/platform/NumberUtilities.js.map +0 -1
  377. package/core/platform/StringUtilities.js +0 -594
  378. package/core/platform/StringUtilities.js.map +0 -1
  379. package/core/platform/Timing.js +0 -10
  380. package/core/platform/Timing.js.map +0 -1
  381. package/core/platform/TypedArrayUtilities.js +0 -158
  382. package/core/platform/TypedArrayUtilities.js.map +0 -1
  383. package/core/platform/TypescriptUtilities.js +0 -25
  384. package/core/platform/TypescriptUtilities.js.map +0 -1
  385. package/core/platform/UIString.js +0 -5
  386. package/core/platform/UIString.js.map +0 -1
  387. package/core/platform/UserVisibleError.js +0 -23
  388. package/core/platform/UserVisibleError.js.map +0 -1
  389. package/core/platform/api/HostRuntime.js +0 -5
  390. package/core/platform/api/HostRuntime.js.map +0 -1
  391. package/core/platform/api/api-tsconfig.json +0 -43
  392. package/core/platform/api/api.js +0 -6
  393. package/core/platform/api/api.js.map +0 -1
  394. package/core/platform/api/api_node_typecheck-tsconfig.json +0 -48
  395. package/core/platform/api/bundle-tsconfig.json +0 -1
  396. package/core/platform/api/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -48
  397. package/core/platform/browser/HostRuntime.js +0 -75
  398. package/core/platform/browser/HostRuntime.js.map +0 -1
  399. package/core/platform/browser/browser-tsconfig.json +0 -48
  400. package/core/platform/browser/browser.js +0 -6
  401. package/core/platform/browser/browser.js.map +0 -1
  402. package/core/platform/browser/bundle-tsconfig.json +0 -1
  403. package/core/platform/browser/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -48
  404. package/core/platform/bundle-tsconfig.json +0 -1
  405. package/core/platform/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -48
  406. package/core/platform/node/HostRuntime.js +0 -82
  407. package/core/platform/node/HostRuntime.js.map +0 -1
  408. package/core/platform/node/bundle-tsconfig.json +0 -1
  409. package/core/platform/node/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -48
  410. package/core/platform/node/node-tsconfig.json +0 -52
  411. package/core/platform/node/node.js +0 -6
  412. package/core/platform/node/node.js.map +0 -1
  413. package/core/platform/platform-tsconfig.json +0 -69
  414. package/core/platform/platform.js +0 -27
  415. package/core/platform/platform.js.map +0 -1
  416. package/core/platform/platform_node_typecheck-tsconfig.json +0 -74
  417. package/core/root/root.js +0 -1
  418. package/core/sdk/sdk.js +0 -1
  419. package/generated/protocol.js +0 -5
  420. package/locales/en-US.json +0 -1046
  421. package/locales/en-XL.json +0 -1046
  422. package/models/cpu_profile/CPUProfileDataModel.js +0 -517
  423. package/models/cpu_profile/CPUProfileDataModel.js.map +0 -1
  424. package/models/cpu_profile/ProfileTreeModel.js +0 -90
  425. package/models/cpu_profile/ProfileTreeModel.js.map +0 -1
  426. package/models/cpu_profile/bundle-tsconfig.json +0 -1
  427. package/models/cpu_profile/cpu_profile-tsconfig.json +0 -52
  428. package/models/cpu_profile/cpu_profile.js +0 -7
  429. package/models/cpu_profile/cpu_profile.js.map +0 -1
  430. package/models/cpu_profile/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -48
  431. package/models/issues_manager/CheckFormsIssuesTrigger.d.ts +0 -1
  432. package/models/issues_manager/CheckFormsIssuesTrigger.js +0 -1
  433. package/models/issues_manager/ContrastCheckTrigger.d.ts +0 -1
  434. package/models/issues_manager/ContrastCheckTrigger.js +0 -1
  435. package/models/issues_manager/DeprecationIssue.d.ts +0 -1
  436. package/models/issues_manager/DeprecationIssue.js +0 -1
  437. package/models/issues_manager/IssueResolver.d.ts +0 -1
  438. package/models/issues_manager/IssueResolver.js +0 -1
  439. package/models/issues_manager/RelatedIssue.d.ts +0 -1
  440. package/models/issues_manager/RelatedIssue.js +0 -1
  441. package/models/issues_manager/SourceFrameIssuesManager.d.ts +0 -1
  442. package/models/issues_manager/SourceFrameIssuesManager.js +0 -1
  443. package/models/trace/EntityMapper.js +0 -133
  444. package/models/trace/EntityMapper.js.map +0 -1
  445. package/models/trace/EventsSerializer.js +0 -90
  446. package/models/trace/EventsSerializer.js.map +0 -1
  447. package/models/trace/LanternComputationData.js +0 -367
  448. package/models/trace/LanternComputationData.js.map +0 -1
  449. package/models/trace/LegacyTracingModel.d.ts +0 -1
  450. package/models/trace/LegacyTracingModel.js +0 -1
  451. package/models/trace/ModelImpl.js +0 -170
  452. package/models/trace/ModelImpl.js.map +0 -1
  453. package/models/trace/Name.js +0 -115
  454. package/models/trace/Name.js.map +0 -1
  455. package/models/trace/Processor.js +0 -556
  456. package/models/trace/Processor.js.map +0 -1
  457. package/models/trace/Styles.js +0 -824
  458. package/models/trace/Styles.js.map +0 -1
  459. package/models/trace/TracingManager.d.ts +0 -1
  460. package/models/trace/TracingManager.js +0 -1
  461. package/models/trace/bundle-tsconfig.json +0 -1
  462. package/models/trace/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -66
  463. package/models/trace/extras/FilmStrip.js +0 -45
  464. package/models/trace/extras/FilmStrip.js.map +0 -1
  465. package/models/trace/extras/Initiators.js +0 -47
  466. package/models/trace/extras/Initiators.js.map +0 -1
  467. package/models/trace/extras/MainThreadActivity.js +0 -77
  468. package/models/trace/extras/MainThreadActivity.js.map +0 -1
  469. package/models/trace/extras/ScriptDuplication.js +0 -163
  470. package/models/trace/extras/ScriptDuplication.js.map +0 -1
  471. package/models/trace/extras/StackTraceForEvent.js +0 -192
  472. package/models/trace/extras/StackTraceForEvent.js.map +0 -1
  473. package/models/trace/extras/ThirdParties.js +0 -119
  474. package/models/trace/extras/ThirdParties.js.map +0 -1
  475. package/models/trace/extras/TraceFilter.js +0 -51
  476. package/models/trace/extras/TraceFilter.js.map +0 -1
  477. package/models/trace/extras/TraceTree.js +0 -621
  478. package/models/trace/extras/TraceTree.js.map +0 -1
  479. package/models/trace/extras/bundle-tsconfig.json +0 -1
  480. package/models/trace/extras/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -48
  481. package/models/trace/extras/extras-tsconfig.json +0 -70
  482. package/models/trace/extras/extras.js +0 -13
  483. package/models/trace/extras/extras.js.map +0 -1
  484. package/models/trace/handlers/AnimationFramesHandler.js +0 -110
  485. package/models/trace/handlers/AnimationFramesHandler.js.map +0 -1
  486. package/models/trace/handlers/AnimationHandler.js +0 -27
  487. package/models/trace/handlers/AnimationHandler.js.map +0 -1
  488. package/models/trace/handlers/AsyncJSCallsHandler.js +0 -188
  489. package/models/trace/handlers/AsyncJSCallsHandler.js.map +0 -1
  490. package/models/trace/handlers/AuctionWorkletsHandler.d.ts +0 -8
  491. package/models/trace/handlers/AuctionWorkletsHandler.js +0 -163
  492. package/models/trace/handlers/AuctionWorkletsHandler.js.map +0 -1
  493. package/models/trace/handlers/DOMStatsHandler.js +0 -22
  494. package/models/trace/handlers/DOMStatsHandler.js.map +0 -1
  495. package/models/trace/handlers/ExtensionTraceDataHandler.js +0 -264
  496. package/models/trace/handlers/ExtensionTraceDataHandler.js.map +0 -1
  497. package/models/trace/handlers/FlowsHandler.js +0 -149
  498. package/models/trace/handlers/FlowsHandler.js.map +0 -1
  499. package/models/trace/handlers/FramesHandler.js +0 -492
  500. package/models/trace/handlers/FramesHandler.js.map +0 -1
  501. package/models/trace/handlers/GPUHandler.js +0 -36
  502. package/models/trace/handlers/GPUHandler.js.map +0 -1
  503. package/models/trace/handlers/ImagePaintingHandler.js +0 -148
  504. package/models/trace/handlers/ImagePaintingHandler.js.map +0 -1
  505. package/models/trace/handlers/InitiatorsHandler.js +0 -181
  506. package/models/trace/handlers/InitiatorsHandler.js.map +0 -1
  507. package/models/trace/handlers/InvalidationsHandler.js +0 -127
  508. package/models/trace/handlers/InvalidationsHandler.js.map +0 -1
  509. package/models/trace/handlers/LargestImagePaintHandler.js +0 -86
  510. package/models/trace/handlers/LargestImagePaintHandler.js.map +0 -1
  511. package/models/trace/handlers/LargestTextPaintHandler.js +0 -28
  512. package/models/trace/handlers/LargestTextPaintHandler.js.map +0 -1
  513. package/models/trace/handlers/LayerTreeHandler.js +0 -104
  514. package/models/trace/handlers/LayerTreeHandler.js.map +0 -1
  515. package/models/trace/handlers/LayoutShiftsHandler.js +0 -458
  516. package/models/trace/handlers/LayoutShiftsHandler.js.map +0 -1
  517. package/models/trace/handlers/MemoryHandler.js +0 -22
  518. package/models/trace/handlers/MemoryHandler.js.map +0 -1
  519. package/models/trace/handlers/MetaHandler.js +0 -411
  520. package/models/trace/handlers/MetaHandler.js.map +0 -1
  521. package/models/trace/handlers/ModelHandlers.js +0 -34
  522. package/models/trace/handlers/ModelHandlers.js.map +0 -1
  523. package/models/trace/handlers/NetworkRequestsHandler.js +0 -576
  524. package/models/trace/handlers/NetworkRequestsHandler.js.map +0 -1
  525. package/models/trace/handlers/PageFramesHandler.js +0 -43
  526. package/models/trace/handlers/PageFramesHandler.js.map +0 -1
  527. package/models/trace/handlers/PageLoadMetricsHandler.js +0 -423
  528. package/models/trace/handlers/PageLoadMetricsHandler.js.map +0 -1
  529. package/models/trace/handlers/RendererHandler.js +0 -347
  530. package/models/trace/handlers/RendererHandler.js.map +0 -1
  531. package/models/trace/handlers/SamplesHandler.js +0 -261
  532. package/models/trace/handlers/SamplesHandler.js.map +0 -1
  533. package/models/trace/handlers/ScreenshotsHandler.js +0 -98
  534. package/models/trace/handlers/ScreenshotsHandler.js.map +0 -1
  535. package/models/trace/handlers/ScriptsHandler.js +0 -286
  536. package/models/trace/handlers/ScriptsHandler.js.map +0 -1
  537. package/models/trace/handlers/SelectorStatsHandler.js +0 -72
  538. package/models/trace/handlers/SelectorStatsHandler.js.map +0 -1
  539. package/models/trace/handlers/Threads.js +0 -112
  540. package/models/trace/handlers/Threads.js.map +0 -1
  541. package/models/trace/handlers/UserInteractionsHandler.js +0 -319
  542. package/models/trace/handlers/UserInteractionsHandler.js.map +0 -1
  543. package/models/trace/handlers/UserTimingsHandler.js +0 -184
  544. package/models/trace/handlers/UserTimingsHandler.js.map +0 -1
  545. package/models/trace/handlers/WarningsHandler.js +0 -135
  546. package/models/trace/handlers/WarningsHandler.js.map +0 -1
  547. package/models/trace/handlers/WorkersHandler.js +0 -34
  548. package/models/trace/handlers/WorkersHandler.js.map +0 -1
  549. package/models/trace/handlers/bundle-tsconfig.json +0 -1
  550. package/models/trace/handlers/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -48
  551. package/models/trace/handlers/handlers-tsconfig.json +0 -102
  552. package/models/trace/handlers/handlers.js +0 -8
  553. package/models/trace/handlers/handlers.js.map +0 -1
  554. package/models/trace/handlers/helpers.js +0 -164
  555. package/models/trace/handlers/helpers.js.map +0 -1
  556. package/models/trace/handlers/types.js +0 -2
  557. package/models/trace/handlers/types.js.map +0 -1
  558. package/models/trace/helpers/Extensions.js +0 -42
  559. package/models/trace/helpers/Extensions.js.map +0 -1
  560. package/models/trace/helpers/Network.js +0 -103
  561. package/models/trace/helpers/Network.js.map +0 -1
  562. package/models/trace/helpers/SamplesIntegrator.js +0 -496
  563. package/models/trace/helpers/SamplesIntegrator.js.map +0 -1
  564. package/models/trace/helpers/SyntheticEvents.js +0 -75
  565. package/models/trace/helpers/SyntheticEvents.js.map +0 -1
  566. package/models/trace/helpers/Timing.js +0 -194
  567. package/models/trace/helpers/Timing.js.map +0 -1
  568. package/models/trace/helpers/Trace.js +0 -817
  569. package/models/trace/helpers/Trace.js.map +0 -1
  570. package/models/trace/helpers/TreeHelpers.js +0 -255
  571. package/models/trace/helpers/TreeHelpers.js.map +0 -1
  572. package/models/trace/helpers/bundle-tsconfig.json +0 -1
  573. package/models/trace/helpers/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -48
  574. package/models/trace/helpers/helpers-tsconfig.json +0 -69
  575. package/models/trace/helpers/helpers.js +0 -11
  576. package/models/trace/helpers/helpers.js.map +0 -1
  577. package/models/trace/insights/CLSCulprits.js +0 -518
  578. package/models/trace/insights/CLSCulprits.js.map +0 -1
  579. package/models/trace/insights/Cache.js +0 -210
  580. package/models/trace/insights/Cache.js.map +0 -1
  581. package/models/trace/insights/CharacterSet.js +0 -132
  582. package/models/trace/insights/CharacterSet.js.map +0 -1
  583. package/models/trace/insights/Common.js +0 -348
  584. package/models/trace/insights/Common.js.map +0 -1
  585. package/models/trace/insights/DOMSize.js +0 -182
  586. package/models/trace/insights/DOMSize.js.map +0 -1
  587. package/models/trace/insights/DocumentLatency.js +0 -259
  588. package/models/trace/insights/DocumentLatency.js.map +0 -1
  589. package/models/trace/insights/DuplicatedJavaScript.js +0 -95
  590. package/models/trace/insights/DuplicatedJavaScript.js.map +0 -1
  591. package/models/trace/insights/FontDisplay.js +0 -87
  592. package/models/trace/insights/FontDisplay.js.map +0 -1
  593. package/models/trace/insights/ForcedReflow.js +0 -162
  594. package/models/trace/insights/ForcedReflow.js.map +0 -1
  595. package/models/trace/insights/INPBreakdown.js +0 -130
  596. package/models/trace/insights/INPBreakdown.js.map +0 -1
  597. package/models/trace/insights/ImageDelivery.js +0 -264
  598. package/models/trace/insights/ImageDelivery.js.map +0 -1
  599. package/models/trace/insights/LCPBreakdown.js +0 -200
  600. package/models/trace/insights/LCPBreakdown.js.map +0 -1
  601. package/models/trace/insights/LCPDiscovery.js +0 -190
  602. package/models/trace/insights/LCPDiscovery.js.map +0 -1
  603. package/models/trace/insights/LegacyJavaScript.js +0 -95
  604. package/models/trace/insights/LegacyJavaScript.js.map +0 -1
  605. package/models/trace/insights/Models.js +0 -23
  606. package/models/trace/insights/Models.js.map +0 -1
  607. package/models/trace/insights/ModernHTTP.js +0 -201
  608. package/models/trace/insights/ModernHTTP.js.map +0 -1
  609. package/models/trace/insights/NetworkDependencyTree.js +0 -968
  610. package/models/trace/insights/NetworkDependencyTree.js.map +0 -1
  611. package/models/trace/insights/RenderBlocking.js +0 -193
  612. package/models/trace/insights/RenderBlocking.js.map +0 -1
  613. package/models/trace/insights/SlowCSSSelector.js +0 -137
  614. package/models/trace/insights/SlowCSSSelector.js.map +0 -1
  615. package/models/trace/insights/Statistics.js +0 -93
  616. package/models/trace/insights/Statistics.js.map +0 -1
  617. package/models/trace/insights/ThirdParties.js +0 -99
  618. package/models/trace/insights/ThirdParties.js.map +0 -1
  619. package/models/trace/insights/Viewport.js +0 -103
  620. package/models/trace/insights/Viewport.js.map +0 -1
  621. package/models/trace/insights/bundle-tsconfig.json +0 -1
  622. package/models/trace/insights/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -48
  623. package/models/trace/insights/insights-tsconfig.json +0 -103
  624. package/models/trace/insights/insights.js +0 -10
  625. package/models/trace/insights/insights.js.map +0 -1
  626. package/models/trace/insights/types.js +0 -41
  627. package/models/trace/insights/types.js.map +0 -1
  628. package/models/trace/lantern/bundle-tsconfig.json +0 -1
  629. package/models/trace/lantern/core/LanternError.js +0 -7
  630. package/models/trace/lantern/core/LanternError.js.map +0 -1
  631. package/models/trace/lantern/core/NetworkAnalyzer.js +0 -484
  632. package/models/trace/lantern/core/NetworkAnalyzer.js.map +0 -1
  633. package/models/trace/lantern/core/bundle-tsconfig.json +0 -1
  634. package/models/trace/lantern/core/core-tsconfig.json +0 -49
  635. package/models/trace/lantern/core/core.js +0 -6
  636. package/models/trace/lantern/core/core.js.map +0 -1
  637. package/models/trace/lantern/core/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -48
  638. package/models/trace/lantern/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -60
  639. package/models/trace/lantern/graph/BaseNode.js +0 -277
  640. package/models/trace/lantern/graph/BaseNode.js.map +0 -1
  641. package/models/trace/lantern/graph/CPUNode.js +0 -64
  642. package/models/trace/lantern/graph/CPUNode.js.map +0 -1
  643. package/models/trace/lantern/graph/NetworkNode.js +0 -83
  644. package/models/trace/lantern/graph/NetworkNode.js.map +0 -1
  645. package/models/trace/lantern/graph/PageDependencyGraph.js +0 -552
  646. package/models/trace/lantern/graph/PageDependencyGraph.js.map +0 -1
  647. package/models/trace/lantern/graph/bundle-tsconfig.json +0 -1
  648. package/models/trace/lantern/graph/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -48
  649. package/models/trace/lantern/graph/graph-tsconfig.json +0 -54
  650. package/models/trace/lantern/graph/graph.js +0 -8
  651. package/models/trace/lantern/graph/graph.js.map +0 -1
  652. package/models/trace/lantern/lantern.js.map +0 -1
  653. package/models/trace/lantern/metrics/FirstContentfulPaint.js +0 -137
  654. package/models/trace/lantern/metrics/FirstContentfulPaint.js.map +0 -1
  655. package/models/trace/lantern/metrics/Interactive.js +0 -68
  656. package/models/trace/lantern/metrics/Interactive.js.map +0 -1
  657. package/models/trace/lantern/metrics/LargestContentfulPaint.js +0 -69
  658. package/models/trace/lantern/metrics/LargestContentfulPaint.js.map +0 -1
  659. package/models/trace/lantern/metrics/MaxPotentialFID.js +0 -49
  660. package/models/trace/lantern/metrics/MaxPotentialFID.js.map +0 -1
  661. package/models/trace/lantern/metrics/Metric.js +0 -69
  662. package/models/trace/lantern/metrics/Metric.js.map +0 -1
  663. package/models/trace/lantern/metrics/SpeedIndex.js +0 -102
  664. package/models/trace/lantern/metrics/SpeedIndex.js.map +0 -1
  665. package/models/trace/lantern/metrics/TBTUtils.js +0 -65
  666. package/models/trace/lantern/metrics/TBTUtils.js.map +0 -1
  667. package/models/trace/lantern/metrics/TotalBlockingTime.js +0 -79
  668. package/models/trace/lantern/metrics/TotalBlockingTime.js.map +0 -1
  669. package/models/trace/lantern/metrics/bundle-tsconfig.json +0 -1
  670. package/models/trace/lantern/metrics/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -48
  671. package/models/trace/lantern/metrics/metrics-tsconfig.json +0 -64
  672. package/models/trace/lantern/metrics/metrics.js +0 -12
  673. package/models/trace/lantern/metrics/metrics.js.map +0 -1
  674. package/models/trace/lantern/simulation/ConnectionPool.js +0 -116
  675. package/models/trace/lantern/simulation/ConnectionPool.js.map +0 -1
  676. package/models/trace/lantern/simulation/Constants.js +0 -43
  677. package/models/trace/lantern/simulation/Constants.js.map +0 -1
  678. package/models/trace/lantern/simulation/DNSCache.js +0 -48
  679. package/models/trace/lantern/simulation/DNSCache.js.map +0 -1
  680. package/models/trace/lantern/simulation/SimulationTimingMap.js +0 -135
  681. package/models/trace/lantern/simulation/SimulationTimingMap.js.map +0 -1
  682. package/models/trace/lantern/simulation/Simulator.js +0 -451
  683. package/models/trace/lantern/simulation/Simulator.js.map +0 -1
  684. package/models/trace/lantern/simulation/TCPConnection.js +0 -155
  685. package/models/trace/lantern/simulation/TCPConnection.js.map +0 -1
  686. package/models/trace/lantern/simulation/bundle-tsconfig.json +0 -1
  687. package/models/trace/lantern/simulation/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -48
  688. package/models/trace/lantern/simulation/simulation-tsconfig.json +0 -59
  689. package/models/trace/lantern/simulation/simulation.js +0 -10
  690. package/models/trace/lantern/simulation/simulation.js.map +0 -1
  691. package/models/trace/lantern/types/Lantern.js +0 -25
  692. package/models/trace/lantern/types/Lantern.js.map +0 -1
  693. package/models/trace/lantern/types/bundle-tsconfig.json +0 -1
  694. package/models/trace/lantern/types/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -48
  695. package/models/trace/lantern/types/types-tsconfig.json +0 -48
  696. package/models/trace/lantern/types/types.js +0 -5
  697. package/models/trace/lantern/types/types.js.map +0 -1
  698. package/models/trace/trace-tsconfig.json +0 -78
  699. package/models/trace/trace.js.map +0 -1
  700. package/models/trace/types/Configuration.js +0 -18
  701. package/models/trace/types/Configuration.js.map +0 -1
  702. package/models/trace/types/Extensions.js +0 -38
  703. package/models/trace/types/Extensions.js.map +0 -1
  704. package/models/trace/types/File.js +0 -82
  705. package/models/trace/types/File.js.map +0 -1
  706. package/models/trace/types/Overlays.js +0 -5
  707. package/models/trace/types/Overlays.js.map +0 -1
  708. package/models/trace/types/Timing.js.map +0 -1
  709. package/models/trace/types/TraceEvents.js.map +0 -1
  710. package/models/trace/types/bundle-tsconfig.json +0 -1
  711. package/models/trace/types/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -48
  712. package/models/trace/types/types-tsconfig.json +0 -65
  713. package/models/trace/types/types.js.map +0 -1
  714. package/test/invalid-animation-events.json.gz +0 -0
  715. package/test/test-trace-engine.mjs +0 -191
  716. package/third_party/legacy-javascript/legacy-javascript.js +0 -1
  717. package/third_party/marked/marked.d.ts +0 -1
  718. package/third_party/marked/marked.js +0 -1
  719. package/third_party/third-party-web/third-party-web.js +0 -1
  720. package/tsconfig.json +0 -29
@@ -1,90 +0,0 @@
1
- // Copyright 2016 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
- export class ProfileNode {
5
- callFrame;
6
- callUID;
7
- self;
8
- total;
9
- id;
10
- parent;
11
- children;
12
- originalFunctionName = null;
13
- depth;
14
- deoptReason;
15
- constructor(callFrame) {
16
- this.callFrame = callFrame;
17
- this.callUID = `${callFrame.functionName}@${callFrame.scriptId}:${callFrame.lineNumber}:${callFrame.columnNumber}`;
18
- this.self = 0;
19
- this.total = 0;
20
- this.id = 0;
21
- this.parent = null;
22
- this.children = [];
23
- }
24
- get scriptId() {
25
- return String(this.callFrame.scriptId);
26
- }
27
- get url() {
28
- return this.callFrame.url;
29
- }
30
- get lineNumber() {
31
- return this.callFrame.lineNumber;
32
- }
33
- get columnNumber() {
34
- return this.callFrame.columnNumber;
35
- }
36
- get functionName() {
37
- return this.originalFunctionName ?? this.callFrame.functionName;
38
- }
39
- setOriginalFunctionName(name) {
40
- this.originalFunctionName = name;
41
- }
42
- }
43
- export class ProfileTreeModel {
44
- root;
45
- total;
46
- maxDepth;
47
- initialize(root) {
48
- this.root = root;
49
- this.assignDepthsAndParents();
50
- this.total = this.calculateTotals(this.root);
51
- }
52
- assignDepthsAndParents() {
53
- const root = this.root;
54
- root.depth = -1;
55
- root.parent = null;
56
- this.maxDepth = 0;
57
- const nodesToTraverse = [root];
58
- while (nodesToTraverse.length) {
59
- const parent = nodesToTraverse.pop();
60
- const depth = parent.depth + 1;
61
- if (depth > this.maxDepth) {
62
- this.maxDepth = depth;
63
- }
64
- const children = parent.children;
65
- for (const child of children) {
66
- child.depth = depth;
67
- child.parent = parent;
68
- nodesToTraverse.push(child);
69
- }
70
- }
71
- }
72
- calculateTotals(root) {
73
- const nodesToTraverse = [root];
74
- const dfsList = [];
75
- while (nodesToTraverse.length) {
76
- const node = nodesToTraverse.pop();
77
- node.total = node.self;
78
- dfsList.push(node);
79
- nodesToTraverse.push(...node.children);
80
- }
81
- while (dfsList.length > 1) {
82
- const node = dfsList.pop();
83
- if (node.parent) {
84
- node.parent.total += node.total;
85
- }
86
- }
87
- return root.total;
88
- }
89
- }
90
- //# sourceMappingURL=ProfileTreeModel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProfileTreeModel.js","sourceRoot":"","sources":["../../../../../../front_end/models/cpu_profile/ProfileTreeModel.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAK7B,MAAM,OAAO,WAAW;IACtB,SAAS,CAA6B;IACtC,OAAO,CAAS;IAChB,IAAI,CAAS;IACb,KAAK,CAAS;IACd,EAAE,CAAS;IACX,MAAM,CAAmB;IACzB,QAAQ,CAAS;IACjB,oBAAoB,GAAgB,IAAI,CAAC;IACzC,KAAK,CAAU;IACf,WAAW,CAAe;IAC1B,YAAY,SAAqC;QAC/C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,GAAG,SAAS,CAAC,YAAY,IAAI,SAAS,CAAC,QAAQ,IAAI,SAAS,CAAC,UAAU,IAAI,SAAS,CAAC,YAAY,EAAE,CAAC;QACnH,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IACrB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAA8B,CAAC;IACtE,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,SAAS,CAAC,GAAsC,CAAC;IAC/D,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;IACnC,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;IACrC,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAA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AC;IAEO,eAAe,CAAC,IAAiB;QACvC,MAAM,eAAe,GAAG,CAAC,IAAI,CAAC,CAAC;QAC/B,MAAM,OAAO,GAAG,EAAE,CAAC;QACnB,OAAO,eAAe,CAAC,MAAM,EAAE,CAAC;YAC9B,MAAM,IAAI,GAAI,eAAe,CAAC,GAAG,EAAkB,CAAC;YACpD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC;YACvB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnB,eAAe,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,GAAI,OAAO,CAAC,GAAG,EAAkB,CAAC;YAC5C,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC;YAClC,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF","sourcesContent":["// Copyright 2016 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 type * as Platform from '../../core/platform/platform.js';\nimport type * as Protocol from '../../generated/protocol.js';\n\nexport class ProfileNode {\n callFrame: Protocol.Runtime.CallFrame;\n callUID: string;\n self: number;\n total: number;\n id: number;\n parent: ProfileNode|null;\n children: this[];\n originalFunctionName: string|null = null;\n depth!: number;\n deoptReason!: string|null;\n constructor(callFrame: Protocol.Runtime.CallFrame) {\n this.callFrame = callFrame;\n this.callUID = `${callFrame.functionName}@${callFrame.scriptId}:${callFrame.lineNumber}:${callFrame.columnNumber}`;\n this.self = 0;\n this.total = 0;\n this.id = 0;\n this.parent = null;\n this.children = [];\n }\n\n get scriptId(): Protocol.Runtime.ScriptId {\n return String(this.callFrame.scriptId) as Protocol.Runtime.ScriptId;\n }\n\n get url(): Platform.DevToolsPath.UrlString {\n return this.callFrame.url as Platform.DevToolsPath.UrlString;\n }\n\n get lineNumber(): number {\n return this.callFrame.lineNumber;\n }\n\n get columnNumber(): number {\n return this.callFrame.columnNumber;\n }\n\n get functionName(): string {\n return this.originalFunctionName ?? this.callFrame.functionName;\n }\n\n setOriginalFunctionName(name: string|null): void {\n this.originalFunctionName = name;\n }\n}\n\nexport class ProfileTreeModel {\n root!: ProfileNode;\n total!: number;\n maxDepth!: number;\n\n initialize(root: ProfileNode): void {\n this.root = root;\n this.assignDepthsAndParents();\n this.total = this.calculateTotals(this.root);\n }\n\n private assignDepthsAndParents(): void {\n const root = this.root;\n root.depth = -1;\n root.parent = null;\n this.maxDepth = 0;\n const nodesToTraverse = [root];\n while (nodesToTraverse.length) {\n const parent = (nodesToTraverse.pop() as ProfileNode);\n const depth = parent.depth + 1;\n if (depth > this.maxDepth) {\n this.maxDepth = depth;\n }\n const children = parent.children;\n for (const child of children) {\n child.depth = depth;\n child.parent = parent;\n nodesToTraverse.push(child);\n }\n }\n }\n\n private calculateTotals(root: ProfileNode): number {\n const nodesToTraverse = [root];\n const dfsList = [];\n while (nodesToTraverse.length) {\n const node = (nodesToTraverse.pop() as ProfileNode);\n node.total = node.self;\n dfsList.push(node);\n nodesToTraverse.push(...node.children);\n }\n while (dfsList.length > 1) {\n const node = (dfsList.pop() as ProfileNode);\n if (node.parent) {\n node.parent.total += node.total;\n }\n }\n return root.total;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"compilerOptions":{"composite":true,"outDir":".","baseUrl":".","rootDir":"../../../../../../front_end/models/cpu_profile"},"files":["../../../../../../front_end/models/cpu_profile/cpu_profile.ts"],"references":[{"path":"./cpu_profile-tsconfig.json"}]}
@@ -1,52 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "allowJs": true,
4
- "checkJs": true,
5
- "composite": true,
6
- "declaration": true,
7
- "experimentalDecorators": true,
8
- "forceConsistentCasingInFileNames": true,
9
- "inlineSources": true,
10
- "lib": [
11
- "dom",
12
- "dom.iterable",
13
- "ES2023",
14
- "ES2024.Promise",
15
- "ESNext.Iterator",
16
- "ESNext.Collection",
17
- "ESNext.Array"
18
- ],
19
- "module": "esnext",
20
- "noEmitOnError": true,
21
- "noFallthroughCasesInSwitch": true,
22
- "noImplicitOverride": true,
23
- "noImplicitReturns": true,
24
- "noUnusedLocals": false,
25
- "noUnusedParameters": false,
26
- "outDir": ".",
27
- "rootDir": "../../../../../../front_end/models/cpu_profile",
28
- "skipLibCheck": true,
29
- "sourceMap": true,
30
- "strict": true,
31
- "target": "ES2023",
32
- "tsBuildInfoFile": "cpu_profile-tsconfig.json.tsbuildinfo",
33
- "typeRoots": [],
34
- "types": [],
35
- "useUnknownInCatchVariables": false
36
- },
37
- "files": [
38
- "../../../../../../front_end/models/cpu_profile/CPUProfileDataModel.ts",
39
- "../../../../../../front_end/models/cpu_profile/ProfileTreeModel.ts",
40
- "../../../../../../front_end/legacy/legacy-defs.d.ts",
41
- "../../../../../../front_end/global_typings/global_defs.d.ts",
42
- "../../../../../../node_modules/@types/filesystem/index.d.ts"
43
- ],
44
- "references": [
45
- {
46
- "path": "../../core/platform/bundle-tsconfig.json"
47
- },
48
- {
49
- "path": "../../generated/generated-tsconfig.json"
50
- }
51
- ]
52
- }
@@ -1,7 +0,0 @@
1
- // Copyright 2023 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 CPUProfileDataModel from './CPUProfileDataModel.js';
5
- import * as ProfileTreeModel from './ProfileTreeModel.js';
6
- export { CPUProfileDataModel, ProfileTreeModel, };
7
- //# sourceMappingURL=cpu_profile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cpu_profile.js","sourceRoot":"","sources":["../../../../../../front_end/models/cpu_profile/cpu_profile.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,mBAAmB,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EACL,mBAAmB,EACnB,gBAAgB,GACjB,CAAC","sourcesContent":["// Copyright 2023 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 CPUProfileDataModel from './CPUProfileDataModel.js';\nimport * as ProfileTreeModel from './ProfileTreeModel.js';\n\nexport {\n CPUProfileDataModel,\n ProfileTreeModel,\n};\n"]}
@@ -1,48 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "allowJs": true,
4
- "checkJs": true,
5
- "composite": true,
6
- "declaration": true,
7
- "experimentalDecorators": true,
8
- "forceConsistentCasingInFileNames": true,
9
- "inlineSources": true,
10
- "lib": [
11
- "dom",
12
- "dom.iterable",
13
- "ES2023",
14
- "ES2024.Promise",
15
- "ESNext.Iterator",
16
- "ESNext.Collection",
17
- "ESNext.Array"
18
- ],
19
- "module": "esnext",
20
- "noEmitOnError": true,
21
- "noFallthroughCasesInSwitch": true,
22
- "noImplicitOverride": true,
23
- "noImplicitReturns": true,
24
- "noUnusedLocals": false,
25
- "noUnusedParameters": false,
26
- "outDir": ".",
27
- "rootDir": "../../../../../../front_end/models/cpu_profile",
28
- "skipLibCheck": true,
29
- "sourceMap": true,
30
- "strict": true,
31
- "target": "ES2023",
32
- "tsBuildInfoFile": "devtools_entrypoint-bundle-typescript-tsconfig.json.tsbuildinfo",
33
- "typeRoots": [],
34
- "types": [],
35
- "useUnknownInCatchVariables": false
36
- },
37
- "files": [
38
- "../../../../../../front_end/models/cpu_profile/cpu_profile.ts",
39
- "../../../../../../front_end/legacy/legacy-defs.d.ts",
40
- "../../../../../../front_end/global_typings/global_defs.d.ts",
41
- "../../../../../../node_modules/@types/filesystem/index.d.ts"
42
- ],
43
- "references": [
44
- {
45
- "path": "./cpu_profile-tsconfig.json"
46
- }
47
- ]
48
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export const DeprecationIssue = {fromInspectorIssue: () => []};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export const SourceFrameIssuesManager = null;
@@ -1,133 +0,0 @@
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 Handlers from './handlers/handlers.js';
5
- import * as Helpers from './helpers/helpers.js';
6
- const mapperCache = new WeakMap();
7
- export class EntityMapper {
8
- #parsedTrace;
9
- #entityMappings;
10
- #firstPartyEntity;
11
- #thirdPartyEvents = [];
12
- /**
13
- * When resolving urls and updating our entity mapping in the
14
- * SourceMapsResolver, a single call frame can appear multiple times
15
- * as different cpu profile nodes. To avoid duplicate work on the
16
- * same CallFrame, we can keep track of them.
17
- */
18
- #resolvedCallFrames = new Set();
19
- constructor(parsedTrace) {
20
- this.#parsedTrace = parsedTrace;
21
- this.#entityMappings = this.#parsedTrace.data.Renderer.entityMappings;
22
- this.#firstPartyEntity = this.#findFirstPartyEntity();
23
- this.#thirdPartyEvents = this.#getThirdPartyEvents();
24
- }
25
- static getOrCreate(parsedTrace) {
26
- const cached = mapperCache.get(parsedTrace);
27
- if (cached) {
28
- return cached;
29
- }
30
- const instance = new EntityMapper(parsedTrace);
31
- mapperCache.set(parsedTrace, instance);
32
- return instance;
33
- }
34
- #findFirstPartyEntity() {
35
- // As a starting point, we consider the first navigation as the 1P.
36
- const nav = Array.from(this.#parsedTrace.data.Meta.navigationsByNavigationId.values()).sort((a, b) => a.ts - b.ts)[0];
37
- const firstPartyUrl = nav?.args.data?.documentLoaderURL ?? this.#parsedTrace.data.Meta.mainFrameURL;
38
- if (!firstPartyUrl) {
39
- return null;
40
- }
41
- return Handlers.Helpers.getEntityForUrl(firstPartyUrl, this.#entityMappings) ?? null;
42
- }
43
- #getThirdPartyEvents() {
44
- const entries = Array.from(this.#entityMappings.eventsByEntity.entries());
45
- const thirdPartyEvents = entries.flatMap(([entity, events]) => {
46
- return entity !== this.#firstPartyEntity ? events : [];
47
- });
48
- return thirdPartyEvents;
49
- }
50
- /**
51
- * Returns an entity for a given event if any.
52
- */
53
- entityForEvent(event) {
54
- return this.#entityMappings.entityByEvent.get(event) ?? null;
55
- }
56
- /**
57
- * Returns trace events that correspond with a given entity if any.
58
- */
59
- eventsForEntity(entity) {
60
- return this.#entityMappings.eventsByEntity.get(entity) ?? [];
61
- }
62
- firstPartyEntity() {
63
- return this.#firstPartyEntity;
64
- }
65
- thirdPartyEvents() {
66
- return this.#thirdPartyEvents;
67
- }
68
- mappings() {
69
- return this.#entityMappings;
70
- }
71
- /**
72
- * This updates entity mapping given a callFrame and sourceURL (newly resolved),
73
- * updating both eventsByEntity and entityByEvent. The call frame provides us the
74
- * URL and sourcemap source location that events map to. This describes the exact events we
75
- * want to update. We then update the events with the new sourceURL.
76
- *
77
- * compiledURLs -> the actual file's url (e.g. my-big-bundle.min.js)
78
- * sourceURLs -> the resolved urls (e.g. react.development.js, my-app.ts)
79
- * @param callFrame
80
- * @param sourceURL
81
- */
82
- updateSourceMapEntities(callFrame, sourceURL) {
83
- // Avoid the extra work, if we have already resolved this callFrame.
84
- if (this.#resolvedCallFrames.has(callFrame)) {
85
- return;
86
- }
87
- const compiledURL = callFrame.url;
88
- const currentEntity = Handlers.Helpers.getEntityForUrl(compiledURL, this.#entityMappings);
89
- const resolvedEntity = Handlers.Helpers.getEntityForUrl(sourceURL, this.#entityMappings);
90
- // If the entity changed, then we should update our caches. If we don't have a currentEntity,
91
- // we can't do much with that. Additionally without our current entity, we don't have a reference to the related
92
- // events so there are no relationships to be made.
93
- if ((resolvedEntity === currentEntity) || (!currentEntity || !resolvedEntity)) {
94
- return;
95
- }
96
- const currentEntityEvents = (currentEntity && this.#entityMappings.eventsByEntity.get(currentEntity)) ?? [];
97
- // The events of the entity that match said source location.
98
- const sourceLocationEvents = [];
99
- // The events that don't match the source location, but that we should keep mapped to its current entity.
100
- const unrelatedEvents = [];
101
- currentEntityEvents?.forEach(e => {
102
- const cf = Helpers.Trace.getStackTraceTopCallFrameInEventPayload(e);
103
- const matchesCallFrame = cf && Helpers.Trace.isMatchingCallFrame(cf, callFrame);
104
- if (matchesCallFrame) {
105
- sourceLocationEvents.push(e);
106
- }
107
- else {
108
- unrelatedEvents.push(e);
109
- }
110
- });
111
- // Update current entity.
112
- this.#entityMappings.eventsByEntity.set(currentEntity, unrelatedEvents);
113
- // Map the source location events to the new entity.
114
- this.#entityMappings.eventsByEntity.set(resolvedEntity, sourceLocationEvents);
115
- sourceLocationEvents.forEach(e => {
116
- this.#entityMappings.entityByEvent.set(e, resolvedEntity);
117
- });
118
- // Update our CallFrame cache when we've got a resolved entity.
119
- this.#resolvedCallFrames.add(callFrame);
120
- }
121
- // Update entities with proper Chrome Extension names.
122
- updateExtensionEntitiesWithName(executionContextNamesByOrigin) {
123
- const entities = Array.from(this.#entityMappings.eventsByEntity.keys());
124
- for (const [origin, name] of executionContextNamesByOrigin) {
125
- // In makeUpChromeExtensionEntity, the extension origin is set as the only domain for the entity.
126
- const entity = entities.find(e => e.domains[0] === origin);
127
- if (entity) {
128
- entity.name = entity.company = name;
129
- }
130
- }
131
- }
132
- }
133
- //# sourceMappingURL=EntityMapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EntityMapper.js","sourceRoot":"","sources":["../../../../../../front_end/models/trace/EntityMapper.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAK7B,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAIhD,MAAM,WAAW,GAAG,IAAI,OAAO,EAA6B,CAAC;AAE7D,MAA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c,EAAE,oBAAoB,CAAC,CAAC;QAC9E,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YAC/B,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;QACH,+DAA+D;QAC/D,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;IAED,sDAAsD;IACtD,+BAA+B,CAAC,6BAA2E;QACzG,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC;QACxE,KAAK,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,6BAA6B,EAAE,CAAC;YAC3D,iGAAiG;YACjG,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC;YAC3D,IAAI,MAAM,EAAE,CAAC;gBACX,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;YACtC,CAAC;QACH,CAAC;IACH,CAAC;CACF","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.\n\nimport type * as Platform from '../../core/platform/platform.js';\nimport type * as Protocol from '../../generated/protocol.js';\n\nimport * as Handlers from './handlers/handlers.js';\nimport * as Helpers from './helpers/helpers.js';\nimport type {ParsedTrace} from './ModelImpl.js';\nimport type * as Types from './types/types.js';\n\nconst mapperCache = new WeakMap<ParsedTrace, EntityMapper>();\n\nexport class EntityMapper {\n #parsedTrace: ParsedTrace;\n #entityMappings: Handlers.Helpers.EntityMappings;\n #firstPartyEntity: Handlers.Helpers.Entity|null;\n #thirdPartyEvents: Types.Events.Event[] = [];\n /**\n * When resolving urls and updating our entity mapping in the\n * SourceMapsResolver, a single call frame can appear multiple times\n * as different cpu profile nodes. To avoid duplicate work on the\n * same CallFrame, we can keep track of them.\n */\n #resolvedCallFrames = new Set<Protocol.Runtime.CallFrame>();\n\n constructor(parsedTrace: ParsedTrace) {\n this.#parsedTrace = parsedTrace;\n this.#entityMappings = this.#parsedTrace.data.Renderer.entityMappings;\n this.#firstPartyEntity = this.#findFirstPartyEntity();\n this.#thirdPartyEvents = this.#getThirdPartyEvents();\n }\n\n static getOrCreate(parsedTrace: ParsedTrace): EntityMapper {\n const cached = mapperCache.get(parsedTrace);\n if (cached) {\n return cached;\n }\n const instance = new EntityMapper(parsedTrace);\n mapperCache.set(parsedTrace, instance);\n return instance;\n }\n\n #findFirstPartyEntity(): Handlers.Helpers.Entity|null {\n // As a starting point, we consider the first navigation as the 1P.\n const nav =\n Array.from(this.#parsedTrace.data.Meta.navigationsByNavigationId.values()).sort((a, b) => a.ts - b.ts)[0];\n const firstPartyUrl = nav?.args.data?.documentLoaderURL ?? this.#parsedTrace.data.Meta.mainFrameURL;\n if (!firstPartyUrl) {\n return null;\n }\n return Handlers.Helpers.getEntityForUrl(firstPartyUrl, this.#entityMappings) ?? null;\n }\n\n #getThirdPartyEvents(): Types.Events.Event[] {\n const entries = Array.from(this.#entityMappings.eventsByEntity.entries());\n const thirdPartyEvents = entries.flatMap(([entity, events]) => {\n return entity !== this.#firstPartyEntity ? events : [];\n });\n return thirdPartyEvents;\n }\n\n /**\n * Returns an entity for a given event if any.\n */\n entityForEvent(event: Types.Events.Event): Handlers.Helpers.Entity|null {\n return this.#entityMappings.entityByEvent.get(event) ?? null;\n }\n\n /**\n * Returns trace events that correspond with a given entity if any.\n */\n eventsForEntity(entity: Handlers.Helpers.Entity): Types.Events.Event[] {\n return this.#entityMappings.eventsByEntity.get(entity) ?? [];\n }\n\n firstPartyEntity(): Handlers.Helpers.Entity|null {\n return this.#firstPartyEntity;\n }\n\n thirdPartyEvents(): Types.Events.Event[] {\n return this.#thirdPartyEvents;\n }\n\n mappings(): Handlers.Helpers.EntityMappings {\n return this.#entityMappings;\n }\n\n /**\n * This updates entity mapping given a callFrame and sourceURL (newly resolved),\n * updating both eventsByEntity and entityByEvent. The call frame provides us the\n * URL and sourcemap source location that events map to. This describes the exact events we\n * want to update. We then update the events with the new sourceURL.\n *\n * compiledURLs -> the actual file's url (e.g. my-big-bundle.min.js)\n * sourceURLs -> the resolved urls (e.g. react.development.js, my-app.ts)\n * @param callFrame\n * @param sourceURL\n */\n updateSourceMapEntities(callFrame: Protocol.Runtime.CallFrame, sourceURL: string): void {\n // Avoid the extra work, if we have already resolved this callFrame.\n if (this.#resolvedCallFrames.has(callFrame)) {\n return;\n }\n\n const compiledURL = callFrame.url;\n const currentEntity = Handlers.Helpers.getEntityForUrl(compiledURL, this.#entityMappings);\n const resolvedEntity = Handlers.Helpers.getEntityForUrl(sourceURL, this.#entityMappings);\n // If the entity changed, then we should update our caches. If we don't have a currentEntity,\n // we can't do much with that. Additionally without our current entity, we don't have a reference to the related\n // events so there are no relationships to be made.\n if ((resolvedEntity === currentEntity) || (!currentEntity || !resolvedEntity)) {\n return;\n }\n const currentEntityEvents = (currentEntity && this.#entityMappings.eventsByEntity.get(currentEntity)) ?? [];\n // The events of the entity that match said source location.\n const sourceLocationEvents: Types.Events.Event[] = [];\n // The events that don't match the source location, but that we should keep mapped to its current entity.\n const unrelatedEvents: Types.Events.Event[] = [];\n currentEntityEvents?.forEach(e => {\n const cf = Helpers.Trace.getStackTraceTopCallFrameInEventPayload(e);\n\n const matchesCallFrame = cf && Helpers.Trace.isMatchingCallFrame(cf, callFrame);\n if (matchesCallFrame) {\n sourceLocationEvents.push(e);\n } else {\n unrelatedEvents.push(e);\n }\n });\n // Update current entity.\n this.#entityMappings.eventsByEntity.set(currentEntity, unrelatedEvents);\n // Map the source location events to the new entity.\n this.#entityMappings.eventsByEntity.set(resolvedEntity, sourceLocationEvents);\n sourceLocationEvents.forEach(e => {\n this.#entityMappings.entityByEvent.set(e, resolvedEntity);\n });\n // Update our CallFrame cache when we've got a resolved entity.\n this.#resolvedCallFrames.add(callFrame);\n }\n\n // Update entities with proper Chrome Extension names.\n updateExtensionEntitiesWithName(executionContextNamesByOrigin: Map<Platform.DevToolsPath.UrlString, string>): void {\n const entities = Array.from(this.#entityMappings.eventsByEntity.keys());\n for (const [origin, name] of executionContextNamesByOrigin) {\n // In makeUpChromeExtensionEntity, the extension origin is set as the only domain for the entity.\n const entity = entities.find(e => e.domains[0] === origin);\n if (entity) {\n entity.name = entity.company = name;\n }\n }\n }\n}\n"]}
@@ -1,90 +0,0 @@
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
- export class EventsSerializer {
7
- #modifiedProfileCallByKey = new Map();
8
- keyForEvent(event) {
9
- if (Types.Events.isProfileCall(event)) {
10
- return `${Types.File.EventKeyType.PROFILE_CALL}-${event.pid}-${event.tid}-${Types.Events.SampleIndex(event.sampleIndex)}-${event.nodeId}`;
11
- }
12
- if (Types.Events.isLegacyTimelineFrame(event)) {
13
- return `${Types.File.EventKeyType.LEGACY_TIMELINE_FRAME}-${event.index}`;
14
- }
15
- if (Types.Events.isJSSample(event)) {
16
- return null;
17
- }
18
- const rawEvents = Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().getRawTraceEvents();
19
- const isSynthetic = Types.Events.isSyntheticBased(event);
20
- const index = rawEvents.indexOf(isSynthetic ? event.rawSourceEvent : event);
21
- if (index === -1) {
22
- return null;
23
- }
24
- const key = Types.Events.isSyntheticBased(event) ?
25
- `${Types.File.EventKeyType.SYNTHETIC_EVENT}-${index}` :
26
- `${Types.File.EventKeyType.RAW_EVENT}-${index}`;
27
- if (key.length < 3) {
28
- return null;
29
- }
30
- return key;
31
- }
32
- eventForKey(key, parsedTrace) {
33
- const eventValues = Types.File.traceEventKeyToValues(key);
34
- if (EventsSerializer.isProfileCallKey(eventValues)) {
35
- return this.#getModifiedProfileCallByKeyValues(eventValues, parsedTrace);
36
- }
37
- if (EventsSerializer.isLegacyTimelineFrameKey(eventValues)) {
38
- const event = parsedTrace.data.Frames.frames.at(eventValues.rawIndex);
39
- if (!event) {
40
- throw new Error(`Unknown trace event. Could not find frame with index ${eventValues.rawIndex}`);
41
- }
42
- return event;
43
- }
44
- if (EventsSerializer.isSyntheticEventKey(eventValues)) {
45
- const syntheticEvents = Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().getSyntheticTraces();
46
- const syntheticEvent = syntheticEvents.at(eventValues.rawIndex);
47
- if (!syntheticEvent) {
48
- throw new Error(`Unknown trace event. Attempted to get a synthetic event from an unknown raw event index: ${eventValues.rawIndex}`);
49
- }
50
- return syntheticEvent;
51
- }
52
- if (EventsSerializer.isRawEventKey(eventValues)) {
53
- const rawEvents = Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().getRawTraceEvents();
54
- return rawEvents[eventValues.rawIndex];
55
- }
56
- throw new Error(`Unknown trace event. Serializable key values: ${eventValues.join('-')}`);
57
- }
58
- static isProfileCallKey(key) {
59
- return key.type === Types.File.EventKeyType.PROFILE_CALL;
60
- }
61
- static isLegacyTimelineFrameKey(key) {
62
- return key.type === Types.File.EventKeyType.LEGACY_TIMELINE_FRAME;
63
- }
64
- static isRawEventKey(key) {
65
- return key.type === Types.File.EventKeyType.RAW_EVENT;
66
- }
67
- static isSyntheticEventKey(key) {
68
- return key.type === Types.File.EventKeyType.SYNTHETIC_EVENT;
69
- }
70
- #getModifiedProfileCallByKeyValues(key, parsedTrace) {
71
- const cacheResult = this.#modifiedProfileCallByKey.get(key);
72
- if (cacheResult) {
73
- return cacheResult;
74
- }
75
- const profileCallsInThread = parsedTrace.data.Renderer.processes.get(key.processID)?.threads.get(key.threadID)?.profileCalls;
76
- if (!profileCallsInThread) {
77
- throw new Error(`Unknown profile call serializable key: ${(key)}`);
78
- }
79
- const match = profileCallsInThread?.find((e) => {
80
- return e.sampleIndex === key.sampleIndex && e.nodeId === key.protocol;
81
- });
82
- if (!match) {
83
- throw new Error(`Unknown profile call serializable key: ${(JSON.stringify(key))}`);
84
- }
85
- // Cache to avoid looking up in subsequent calls.
86
- this.#modifiedProfileCallByKey.set(key, match);
87
- return match;
88
- }
89
- }
90
- //# sourceMappingURL=EventsSerializer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EventsSerializer.js","sourceRoot":"","sources":["../../../../../../front_end/models/trace/EventsSerializer.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAEhD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAE1C,MAAM,OAAO,gBAAgB;IAC3B,yBAAyB,GAAG,IAAI,GAAG,EAAsE,CAAC;IAE1G,WAAW,CAAC,KAAyB;QACnC,IAAI,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;YACtC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,IAAI,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,IACpE,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACpE,CAAC;QAED,IAAI,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9C,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,qBAAqB,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAC3E,CAAC;QAED,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,sBAAsB,CAAC,gBAAgB,EAA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C,mBAAmB,CAAC,GAAqC;QAC9D,OAAO,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC;IAC9D,CAAC;IAED,kCAAkC,CAAC,GAAoC,EAAE,WAAwB;QAE/F,MAAM,WAAW,GAAG,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5D,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,WAAW,CAAC;QACrB,CAAC;QACD,MAAM,oBAAoB,GACtB,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;QACpG,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACrE,CAAC;QAED,MAAM,KAAK,GAAG,oBAAoB,EAAE,IAAI,CAAC,CAAC,CAAoC,EAAE,EAAE;YAChF,OAAO,CAAC,CAAC,WAAW,KAAK,GAAG,CAAC,WAAW,IAAI,CAAC,CAAC,MAAM,KAAK,GAAG,CAAC,QAAQ,CAAC;QACxE,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACrF,CAAC;QACD,iDAAiD;QACjD,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC/C,OAAO,KAAK,CAAC;IACf,CAAC;CACF","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.\n\nimport * as Helpers from './helpers/helpers.js';\nimport type {ParsedTrace} from './ModelImpl.js';\nimport * as Types from './types/types.js';\n\nexport class EventsSerializer {\n #modifiedProfileCallByKey = new Map<Types.File.ProfileCallKeyValues, Types.Events.SyntheticProfileCall>();\n\n keyForEvent(event: Types.Events.Event): Types.File.SerializableKey|null {\n if (Types.Events.isProfileCall(event)) {\n return `${Types.File.EventKeyType.PROFILE_CALL}-${event.pid}-${event.tid}-${\n Types.Events.SampleIndex(event.sampleIndex)}-${event.nodeId}`;\n }\n\n if (Types.Events.isLegacyTimelineFrame(event)) {\n return `${Types.File.EventKeyType.LEGACY_TIMELINE_FRAME}-${event.index}`;\n }\n\n if (Types.Events.isJSSample(event)) {\n return null;\n }\n\n const rawEvents = Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().getRawTraceEvents();\n const isSynthetic = Types.Events.isSyntheticBased(event);\n const index = rawEvents.indexOf(isSynthetic ? event.rawSourceEvent : event);\n if (index === -1) {\n return null;\n }\n\n const key: Types.File.SyntheticEventKey|Types.File.RawEventKey = Types.Events.isSyntheticBased(event) ?\n `${Types.File.EventKeyType.SYNTHETIC_EVENT}-${index}` :\n `${Types.File.EventKeyType.RAW_EVENT}-${index}`;\n if (key.length < 3) {\n return null;\n }\n return key;\n }\n\n eventForKey(key: Types.File.SerializableKey, parsedTrace: ParsedTrace): Types.Events.Event {\n const eventValues = Types.File.traceEventKeyToValues(key);\n\n if (EventsSerializer.isProfileCallKey(eventValues)) {\n return this.#getModifiedProfileCallByKeyValues(eventValues, parsedTrace);\n }\n\n if (EventsSerializer.isLegacyTimelineFrameKey(eventValues)) {\n const event = parsedTrace.data.Frames.frames.at(eventValues.rawIndex);\n if (!event) {\n throw new Error(`Unknown trace event. Could not find frame with index ${eventValues.rawIndex}`);\n }\n return event;\n }\n\n if (EventsSerializer.isSyntheticEventKey(eventValues)) {\n const syntheticEvents = Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().getSyntheticTraces();\n const syntheticEvent = syntheticEvents.at(eventValues.rawIndex);\n if (!syntheticEvent) {\n throw new Error(`Unknown trace event. Attempted to get a synthetic event from an unknown raw event index: ${\n eventValues.rawIndex}`);\n }\n return syntheticEvent;\n }\n\n if (EventsSerializer.isRawEventKey(eventValues)) {\n const rawEvents = Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().getRawTraceEvents();\n return rawEvents[eventValues.rawIndex];\n }\n throw new Error(`Unknown trace event. Serializable key values: ${(eventValues as unknown[]).join('-')}`);\n }\n\n static isProfileCallKey(key: Types.File.SerializableKeyValues): key is Types.File.ProfileCallKeyValues {\n return key.type === Types.File.EventKeyType.PROFILE_CALL;\n }\n static isLegacyTimelineFrameKey(key: Types.File.SerializableKeyValues):\n key is Types.File.LegacyTimelineFrameKeyValues {\n return key.type === Types.File.EventKeyType.LEGACY_TIMELINE_FRAME;\n }\n\n static isRawEventKey(key: Types.File.SerializableKeyValues): key is Types.File.RawEventKeyValues {\n return key.type === Types.File.EventKeyType.RAW_EVENT;\n }\n static isSyntheticEventKey(key: Types.File.SerializableKeyValues): key is Types.File.SyntheticEventKeyValues {\n return key.type === Types.File.EventKeyType.SYNTHETIC_EVENT;\n }\n\n #getModifiedProfileCallByKeyValues(key: Types.File.ProfileCallKeyValues, parsedTrace: ParsedTrace):\n Types.Events.SyntheticProfileCall {\n const cacheResult = this.#modifiedProfileCallByKey.get(key);\n if (cacheResult) {\n return cacheResult;\n }\n const profileCallsInThread =\n parsedTrace.data.Renderer.processes.get(key.processID)?.threads.get(key.threadID)?.profileCalls;\n if (!profileCallsInThread) {\n throw new Error(`Unknown profile call serializable key: ${(key)}`);\n }\n\n const match = profileCallsInThread?.find((e: Types.Events.SyntheticProfileCall) => {\n return e.sampleIndex === key.sampleIndex && e.nodeId === key.protocol;\n });\n if (!match) {\n throw new Error(`Unknown profile call serializable key: ${(JSON.stringify(key))}`);\n }\n // Cache to avoid looking up in subsequent calls.\n this.#modifiedProfileCallByKey.set(key, match);\n return match;\n }\n}\n"]}