@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,103 +0,0 @@
1
- // Important: we purposefully treat `potentially_blocking` as
2
- // non-render-blocking here because:
3
- // 1. An async script can run on the main thread at any point, including before
4
- // the page is loaded
5
- // 2. An async script will never block the parsing and rendering process of the
6
- // browser.
7
- // 3. Therefore, from a developer's point of view, there is nothing more they
8
- // can do if they've put `async` on, and within the context of Insights, we
9
- // shouldn't report an async script as render-blocking.
10
- // In the future we may want to consider suggesting the use of `defer` over
11
- // `async`, as it doesn't have this concern, but for now we'll allow `async`
12
- // and not report it as an issue.
13
- const NON_RENDER_BLOCKING_VALUES = new Set([
14
- 'non_blocking',
15
- 'dynamically_injected_non_blocking',
16
- 'potentially_blocking',
17
- ]);
18
- export function isSyntheticNetworkRequestEventRenderBlocking(event) {
19
- return !NON_RENDER_BLOCKING_VALUES.has(event.args.data.renderBlocking);
20
- }
21
- const HIGH_NETWORK_PRIORITIES = new Set([
22
- "VeryHigh" /* Protocol.Network.ResourcePriority.VeryHigh */,
23
- "High" /* Protocol.Network.ResourcePriority.High */,
24
- "Medium" /* Protocol.Network.ResourcePriority.Medium */,
25
- ]);
26
- export function isSyntheticNetworkRequestHighPriority(event) {
27
- return HIGH_NETWORK_PRIORITIES.has(event.args.data.priority);
28
- }
29
- export const CACHEABLE_STATUS_CODES = new Set([200, 203, 206]);
30
- /** @type {Set<LH.Crdp.Network.ResourceType>} */
31
- export const STATIC_RESOURCE_TYPES = new Set([
32
- "Font" /* Protocol.Network.ResourceType.Font */,
33
- "Image" /* Protocol.Network.ResourceType.Image */,
34
- "Media" /* Protocol.Network.ResourceType.Media */,
35
- "Script" /* Protocol.Network.ResourceType.Script */,
36
- "Stylesheet" /* Protocol.Network.ResourceType.Stylesheet */,
37
- ]);
38
- export const NON_NETWORK_SCHEMES = [
39
- 'blob', // @see https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
40
- 'data', // @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
41
- 'intent', // @see https://developer.chrome.com/docs/multidevice/android/intents/
42
- 'file', // @see https://en.wikipedia.org/wiki/File_URI_scheme
43
- 'filesystem', // @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystem
44
- 'chrome-extension',
45
- ];
46
- /**
47
- * Parses Cache-Control directives based on https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
48
- * eg. 'no-cache, no-store, max-age=0, no-transform, private' will return
49
- * {no-cache: true, no-store: true, max-age: 0, no-transform: true, private: true}
50
- */
51
- export function parseCacheControl(header) {
52
- if (!header) {
53
- return null;
54
- }
55
- const directives = header.split(',').map(directive => directive.trim());
56
- const cacheControlOptions = {};
57
- for (const directive of directives) {
58
- const [key, value] = directive.split('=').map(part => part.trim());
59
- switch (key) {
60
- case 'max-age': {
61
- const maxAge = parseInt(value, 10);
62
- if (!isNaN(maxAge)) {
63
- cacheControlOptions['max-age'] = maxAge;
64
- }
65
- break;
66
- }
67
- case 'no-cache':
68
- cacheControlOptions['no-cache'] = true;
69
- break;
70
- case 'no-store':
71
- cacheControlOptions['no-store'] = true;
72
- break;
73
- case 'must-revalidate':
74
- cacheControlOptions['must-revalidate'] = true;
75
- break;
76
- case 'private':
77
- cacheControlOptions['private'] = true;
78
- break;
79
- default:
80
- // Ignore unknown directives
81
- break;
82
- }
83
- }
84
- return cacheControlOptions;
85
- }
86
- const SECURE_LOCALHOST_DOMAINS = ['localhost', '127.0.0.1'];
87
- /**
88
- * Is the host localhost-enough to satisfy the "secure context" definition
89
- * https://github.com/GoogleChrome/lighthouse/pull/11766#discussion_r582340683
90
- */
91
- export function isSyntheticNetworkRequestLocalhost(event) {
92
- try {
93
- const hostname = new URL(event.args.data.url).hostname;
94
- // Any hostname terminating in `.localhost` is considered to be local.
95
- // https://w3c.github.io/webappsec-secure-contexts/#localhost
96
- // This method doesn't consider IPs that resolve to loopback, IPv6 or other loopback edgecases
97
- return SECURE_LOCALHOST_DOMAINS.includes(hostname) || hostname.endsWith('.localhost');
98
- }
99
- catch {
100
- return false;
101
- }
102
- }
103
- //# sourceMappingURL=Network.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Network.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/helpers/Network.ts"],"names":[],"mappings":"AAMA,6DAA6D;AAC7D,oCAAoC;AACpC,+EAA+E;AAC/E,wBAAwB;AACxB,+EAA+E;AAC/E,cAAc;AACd,6EAA6E;AAC7E,8EAA8E;AAC9E,0DAA0D;AAC1D,2EAA2E;AAC3E,4EAA4E;AAC5E,iCAAiC;AACjC,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAiB;IACzD,cAAc;IACd,mCAAmC;IACnC,sBAAsB;CACvB,CAAC,CAAC;AAEH,MAAM,UAAU,4CAA4C,CAAC,KAA8B;IACzF,OAAO,CAAC,0BAA0B,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAoC;;;;CAI1E,CAAC,CAAC;AAEH,MAAM,UAAU,qCAAqC,CAAC,KAA8B;IAClF,OAAO,uBAAuB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC/D,CAAC;AAWD,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAE/D,gDAAgD;AAChD,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;;;;;;CAM5C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,MAAM,EAAS,4EAA4E;IAC3F,MAAM,EAAS,kFAAkF;IACjG,QAAQ,EAAO,sEAAsE;IACrF,MAAM,EAAS,qDAAqD;IACpE,YAAY,EAAG,mEAAmE;IAClF,kBAAkB;CACnB,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAmB;IACnD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;IACxE,MAAM,mBAAmB,GAAiB,EAAE,CAAC;IAE7C,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAEnE,QAAQ,GAAG,EAAE,CAAC;YACZ,KAAK,SAAS,CAAC,CAAC,CAAC;gBACf,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBACnC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;oBACnB,mBAAmB,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;gBAC1C,CAAC;gBACD,MAAM;YACR,CAAC;YACD,KAAK,UAAU;gBACb,mBAAmB,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;gBACvC,MAAM;YACR,KAAK,UAAU;gBACb,mBAAmB,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;gBACvC,MAAM;YACR,KAAK,iBAAiB;gBACpB,mBAAmB,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;gBAC9C,MAAM;YACR,KAAK,SAAS;gBACZ,mBAAmB,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;gBACtC,MAAM;YACR;gBACE,4BAA4B;gBAC5B,MAAM;QACV,CAAC;IACH,CAAC;IAED,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAED,MAAM,wBAAwB,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAE5D;;;GAGG;AACH,MAAM,UAAU,kCAAkC,CAAC,KAA8B;IAC/E,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;QACvD,sEAAsE;QACtE,6DAA6D;QAC7D,8FAA8F;QAC9F,OAAO,wBAAwB,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IACxF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,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 Protocol from '../../../generated/protocol.js';\nimport type {RenderBlocking, SyntheticNetworkRequest} from '../types/TraceEvents.js';\n\n// Important: we purposefully treat `potentially_blocking` as\n// non-render-blocking here because:\n// 1. An async script can run on the main thread at any point, including before\n// the page is loaded\n// 2. An async script will never block the parsing and rendering process of the\n// browser.\n// 3. Therefore, from a developer's point of view, there is nothing more they\n// can do if they've put `async` on, and within the context of Insights, we\n// shouldn't report an async script as render-blocking.\n// In the future we may want to consider suggesting the use of `defer` over\n// `async`, as it doesn't have this concern, but for now we'll allow `async`\n// and not report it as an issue.\nconst NON_RENDER_BLOCKING_VALUES = new Set<RenderBlocking>([\n 'non_blocking',\n 'dynamically_injected_non_blocking',\n 'potentially_blocking',\n]);\n\nexport function isSyntheticNetworkRequestEventRenderBlocking(event: SyntheticNetworkRequest): boolean {\n return !NON_RENDER_BLOCKING_VALUES.has(event.args.data.renderBlocking);\n}\n\nconst HIGH_NETWORK_PRIORITIES = new Set<Protocol.Network.ResourcePriority>([\n Protocol.Network.ResourcePriority.VeryHigh,\n Protocol.Network.ResourcePriority.High,\n Protocol.Network.ResourcePriority.Medium,\n]);\n\nexport function isSyntheticNetworkRequestHighPriority(event: SyntheticNetworkRequest): boolean {\n return HIGH_NETWORK_PRIORITIES.has(event.args.data.priority);\n}\n\nexport interface CacheControl {\n 'max-age'?: number;\n 'no-cache'?: boolean;\n 'no-store'?: boolean;\n 'must-revalidate'?: boolean;\n // eslint-disable-next-line @stylistic/quote-props\n 'private'?: boolean;\n}\n\nexport const CACHEABLE_STATUS_CODES = new Set([200, 203, 206]);\n\n/** @type {Set<LH.Crdp.Network.ResourceType>} */\nexport const STATIC_RESOURCE_TYPES = new Set([\n Protocol.Network.ResourceType.Font,\n Protocol.Network.ResourceType.Image,\n Protocol.Network.ResourceType.Media,\n Protocol.Network.ResourceType.Script,\n Protocol.Network.ResourceType.Stylesheet,\n]);\n\nexport const NON_NETWORK_SCHEMES = [\n 'blob', // @see https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL\n 'data', // @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\n 'intent', // @see https://developer.chrome.com/docs/multidevice/android/intents/\n 'file', // @see https://en.wikipedia.org/wiki/File_URI_scheme\n 'filesystem', // @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystem\n 'chrome-extension',\n];\n\n/**\n * Parses Cache-Control directives based on https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control\n * eg. 'no-cache, no-store, max-age=0, no-transform, private' will return\n * {no-cache: true, no-store: true, max-age: 0, no-transform: true, private: true}\n */\nexport function parseCacheControl(header: string|null): CacheControl|null {\n if (!header) {\n return null;\n }\n\n const directives = header.split(',').map(directive => directive.trim());\n const cacheControlOptions: CacheControl = {};\n\n for (const directive of directives) {\n const [key, value] = directive.split('=').map(part => part.trim());\n\n switch (key) {\n case 'max-age': {\n const maxAge = parseInt(value, 10);\n if (!isNaN(maxAge)) {\n cacheControlOptions['max-age'] = maxAge;\n }\n break;\n }\n case 'no-cache':\n cacheControlOptions['no-cache'] = true;\n break;\n case 'no-store':\n cacheControlOptions['no-store'] = true;\n break;\n case 'must-revalidate':\n cacheControlOptions['must-revalidate'] = true;\n break;\n case 'private':\n cacheControlOptions['private'] = true;\n break;\n default:\n // Ignore unknown directives\n break;\n }\n }\n\n return cacheControlOptions;\n}\n\nconst SECURE_LOCALHOST_DOMAINS = ['localhost', '127.0.0.1'];\n\n/**\n * Is the host localhost-enough to satisfy the \"secure context\" definition\n * https://github.com/GoogleChrome/lighthouse/pull/11766#discussion_r582340683\n */\nexport function isSyntheticNetworkRequestLocalhost(event: SyntheticNetworkRequest): boolean {\n try {\n const hostname = new URL(event.args.data.url).hostname;\n // Any hostname terminating in `.localhost` is considered to be local.\n // https://w3c.github.io/webappsec-secure-contexts/#localhost\n // This method doesn't consider IPs that resolve to loopback, IPv6 or other loopback edgecases\n return SECURE_LOCALHOST_DOMAINS.includes(hostname) || hostname.endsWith('.localhost');\n } catch {\n return false;\n }\n}\n"]}
@@ -1,496 +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
- var _a;
5
- import * as Types from '../types/types.js';
6
- import { milliToMicro } from './Timing.js';
7
- import { extractSampleTraceId, makeProfileCall, mergeEventsInOrder, sortTraceEventsInPlace } from './Trace.js';
8
- /**
9
- * This is a helper that integrates CPU profiling data coming in the
10
- * shape of samples, with trace events. Samples indicate what the JS
11
- * stack trace looked at a given point in time, but they don't have
12
- * duration. The SamplesIntegrator task is to make an approximation
13
- * of what the duration of each JS call was, given the sample data and
14
- * given the trace events profiled during that time. At the end of its
15
- * execution, the SamplesIntegrator returns an array of ProfileCalls
16
- * (under SamplesIntegrator::buildProfileCalls()), which
17
- * represent JS calls, with a call frame and duration. These calls have
18
- * the shape of a complete trace events and can be treated as flame
19
- * chart entries in the timeline.
20
- *
21
- * The approach to build the profile calls consists in tracking the
22
- * current stack as the following events happen (in order):
23
- * 1. A sample was done.
24
- * 2. A trace event started.
25
- * 3. A trace event ended.
26
- * Depending on the event and on the data that's coming with it the
27
- * stack is updated by adding or removing JS calls to it and updating
28
- * the duration of the calls in the tracking stack.
29
- *
30
- * note: Although this approach has been implemented since long ago, and
31
- * is relatively efficient (adds a complexity over the trace parsing of
32
- * O(n) where n is the number of samples) it has proven to be faulty.
33
- * It might be worthwhile experimenting with improvements or with a
34
- * completely different approach. Improving the approach is tracked in
35
- * crbug.com/1417439
36
- */
37
- export class SamplesIntegrator {
38
- /**
39
- * The result of running the samples integrator. Holds the JS calls
40
- * with their approximated duration after integrating samples into the
41
- * trace event tree.
42
- */
43
- #constructedProfileCalls = [];
44
- /**
45
- * tracks the state of the JS stack at each point in time to update
46
- * the profile call durations as new events arrive. This doesn't only
47
- * happen with new profile calls (in which case we would compare the
48
- * stack in them) but also with trace events (in which case we would
49
- * update the duration of the events we are tracking at the moment).
50
- */
51
- #currentJSStack = [];
52
- /**
53
- * Process holding the CPU profile and trace events.
54
- */
55
- #processId;
56
- /**
57
- * Thread holding the CPU profile and trace events.
58
- */
59
- #threadId;
60
- /**
61
- * Tracks the depth of the JS stack at the moment a trace event starts
62
- * or ends. It is assumed that for the duration of a trace event, the
63
- * JS stack's depth cannot decrease, since JS calls that started
64
- * before a trace event cannot end during the trace event. So as trace
65
- * events arrive, we store the "locked" amount of JS frames that were
66
- * in the stack before the event came.
67
- */
68
- #lockedJsStackDepth = [];
69
- /**
70
- * Used to keep track when samples should be integrated even if they
71
- * are not children of invocation trace events. This is useful in
72
- * cases where we can be missing the start of JS invocation events if
73
- * we start tracing half-way through.
74
- */
75
- #fakeJSInvocation = false;
76
- /**
77
- * The parsed CPU profile, holding the tree hierarchy of JS frames and
78
- * the sample data.
79
- */
80
- #profileModel;
81
- /**
82
- * Because GC nodes don't have a stack, we artificially add a stack to
83
- * them which corresponds to that of the previous sample. This map
84
- * tracks which node is used for the stack of a GC call.
85
- * Note that GC samples are not shown in the flamechart, however they
86
- * are used during the construction of for profile calls, as we can
87
- * infer information about the duration of the executed code when a
88
- * GC node is sampled.
89
- */
90
- #nodeForGC = new Map();
91
- #engineConfig;
92
- #profileId;
93
- /**
94
- * Keeps track of the individual samples from the CPU Profile.
95
- * Only used with Debug Mode experiment enabled.
96
- */
97
- jsSampleEvents = [];
98
- constructor(profileModel, profileId, pid, tid, configuration) {
99
- this.#profileModel = profileModel;
100
- this.#threadId = tid;
101
- this.#processId = pid;
102
- this.#engineConfig = configuration || Types.Configuration.defaults();
103
- this.#profileId = profileId;
104
- }
105
- buildProfileCalls(traceEvents) {
106
- const mergedEvents = mergeEventsInOrder(traceEvents, this.callsFromProfileSamples());
107
- const stack = [];
108
- for (let i = 0; i < mergedEvents.length; i++) {
109
- const event = mergedEvents[i];
110
- // Because instant trace events have no duration, they don't provide
111
- // useful information for possible changes in the duration of calls
112
- // in the JS stack.
113
- if (event.ph === Types.Events.Phase.INSTANT && !extractSampleTraceId(event)) {
114
- continue;
115
- }
116
- if (stack.length === 0) {
117
- if (Types.Events.isProfileCall(event)) {
118
- this.#onProfileCall(event);
119
- continue;
120
- }
121
- stack.push(event);
122
- this.#onTraceEventStart(event);
123
- continue;
124
- }
125
- const parentEvent = stack.at(-1);
126
- if (parentEvent === undefined) {
127
- continue;
128
- }
129
- const begin = event.ts;
130
- const parentBegin = parentEvent.ts;
131
- const parentDuration = parentEvent.dur || 0;
132
- const parentEnd = parentBegin + parentDuration;
133
- const startsAfterParent = begin >= parentEnd;
134
- if (startsAfterParent) {
135
- this.#onTraceEventEnd(parentEvent);
136
- stack.pop();
137
- i--;
138
- continue;
139
- }
140
- if (Types.Events.isProfileCall(event)) {
141
- this.#onProfileCall(event, parentEvent);
142
- continue;
143
- }
144
- this.#onTraceEventStart(event);
145
- stack.push(event);
146
- }
147
- while (stack.length) {
148
- const last = stack.pop();
149
- if (last) {
150
- this.#onTraceEventEnd(last);
151
- }
152
- }
153
- sortTraceEventsInPlace(this.jsSampleEvents);
154
- return this.#constructedProfileCalls;
155
- }
156
- #onTraceEventStart(event) {
157
- // Top level events cannot be nested into JS frames so we reset
158
- // the stack when we find one.
159
- if (event.name === Types.Events.Name.RUN_MICROTASKS || event.name === Types.Events.Name.RUN_TASK) {
160
- this.#lockedJsStackDepth = [];
161
- this.#truncateJSStack(0, event.ts);
162
- this.#fakeJSInvocation = false;
163
- }
164
- if (this.#fakeJSInvocation) {
165
- this.#truncateJSStack(this.#lockedJsStackDepth.pop() || 0, event.ts);
166
- this.#fakeJSInvocation = false;
167
- }
168
- this.#extractStackTrace(event);
169
- // Keep track of the call frames in the stack before the event
170
- // happened. For the duration of this event, these frames cannot
171
- // change (none can be terminated before this event finishes).
172
- //
173
- // Also, every frame that is opened after this event, is considered
174
- // to be a descendant of the event. So once the event finishes, the
175
- // frames that were opened after it, need to be closed (see
176
- // onEndEvent).
177
- //
178
- // TODO(crbug.com/1417439):
179
- // The assumption that every frame opened after an event is a
180
- // descendant of the event is incorrect. For example, a JS call that
181
- // parents a trace event might have been sampled after the event was
182
- // dispatched. In this case the JS call would be discarded if this
183
- // event isn't an invocation event, otherwise the call will be
184
- // considered a child of the event. In both cases, the result would
185
- // be incorrect.
186
- this.#lockedJsStackDepth.push(this.#currentJSStack.length);
187
- }
188
- #onProfileCall(event, parent) {
189
- if ((parent && Types.Events.isJSInvocationEvent(parent)) || this.#fakeJSInvocation) {
190
- this.#extractStackTrace(event);
191
- }
192
- else if (Types.Events.isProfileCall(event) && this.#currentJSStack.length === 0) {
193
- // Force JS Samples to show up even if we are not inside a JS
194
- // invocation event, because we can be missing the start of JS
195
- // invocation events if we start tracing half-way through. Pretend
196
- // we have a top-level JS invocation event.
197
- this.#fakeJSInvocation = true;
198
- const stackDepthBefore = this.#currentJSStack.length;
199
- this.#extractStackTrace(event);
200
- this.#lockedJsStackDepth.push(stackDepthBefore);
201
- }
202
- }
203
- #onTraceEventEnd(event) {
204
- // Because the event has ended, any frames that happened after
205
- // this event are terminated. Frames that are ancestors to this
206
- // event are extended to cover its ending.
207
- const endTime = Types.Timing.Micro(event.ts + (event.dur ?? 0));
208
- this.#truncateJSStack(this.#lockedJsStackDepth.pop() || 0, endTime);
209
- }
210
- /**
211
- * Builds the initial calls with no duration from samples. Their
212
- * purpose is to be merged with the trace event array being parsed so
213
- * that they can be traversed in order with them and their duration
214
- * can be updated as the SampleIntegrator callbacks are invoked.
215
- */
216
- callsFromProfileSamples() {
217
- const samples = this.#profileModel.samples;
218
- const timestamps = this.#profileModel.timestamps;
219
- if (!samples) {
220
- return [];
221
- }
222
- const calls = [];
223
- let prevNode;
224
- for (let i = 0; i < samples.length; i++) {
225
- const node = this.#profileModel.nodeByIndex(i);
226
- const timestamp = milliToMicro(Types.Timing.Milli(timestamps[i]));
227
- if (!node) {
228
- continue;
229
- }
230
- const call = makeProfileCall(node, this.#profileId, i, timestamp, this.#processId, this.#threadId);
231
- calls.push(call);
232
- if (this.#engineConfig.debugMode) {
233
- const traceId = this.#profileModel.traceIds?.[i];
234
- this.jsSampleEvents.push(this.#makeJSSampleEvent(call, timestamp, traceId));
235
- }
236
- if (node.id === this.#profileModel.gcNode?.id && prevNode) {
237
- // GC samples have no stack, so we just put GC node on top of the
238
- // last recorded sample. Cache the previous sample for future
239
- // reference.
240
- this.#nodeForGC.set(call, prevNode);
241
- continue;
242
- }
243
- prevNode = node;
244
- }
245
- return calls;
246
- }
247
- /**
248
- * Given a synthetic profile call, returns an array of profile calls
249
- * representing the stack trace that profile call belongs to based on
250
- * its nodeId. The input profile call will be at the top of the
251
- * returned stack (last position), meaning that any other frames that
252
- * were effectively above it are omitted.
253
- * @param profileCall
254
- * @param overrideTimeStamp a custom timestamp to use for the returned
255
- * profile calls. If not defined, the timestamp of the input
256
- * profileCall is used instead. This param is useful for example when
257
- * creating the profile calls for a sample with a trace id, since the
258
- * timestamp of the corresponding trace event should be used instead
259
- * of the sample's.
260
- */
261
- #makeProfileCallsForStack(profileCall, overrideTimeStamp) {
262
- let node = this.#profileModel.nodeById(profileCall.nodeId);
263
- const isGarbageCollection = node?.id === this.#profileModel.gcNode?.id;
264
- if (isGarbageCollection) {
265
- // Because GC don't have a stack, we use the stack of the previous
266
- // sample.
267
- node = this.#nodeForGC.get(profileCall) || null;
268
- }
269
- if (!node) {
270
- return [];
271
- }
272
- // `node.depth` is 0 based, so to set the size of the array we need
273
- // to add 1 to its value.
274
- const callFrames = new Array(node.depth + 1 + Number(isGarbageCollection));
275
- // Add the stack trace in reverse order (bottom first).
276
- let i = callFrames.length - 1;
277
- if (isGarbageCollection) {
278
- // Place the garbage collection call frame on top of the stack.
279
- callFrames[i--] = profileCall;
280
- }
281
- // Many of these ProfileCalls will be GC'd later when we estimate the frame
282
- // durations
283
- while (node) {
284
- callFrames[i--] = makeProfileCall(node, profileCall.profileId, profileCall.sampleIndex, overrideTimeStamp ?? profileCall.ts, this.#processId, this.#threadId);
285
- node = node.parent;
286
- }
287
- return callFrames;
288
- }
289
- #getStackForSampleTraceId(traceId, timestamp) {
290
- const nodeId = this.#profileModel.traceIds?.[traceId];
291
- const node = nodeId && this.#profileModel.nodeById(nodeId);
292
- const maybeCallForTraceId = node && makeProfileCall(node, this.#profileId, -1, timestamp, this.#processId, this.#threadId);
293
- if (!maybeCallForTraceId) {
294
- return null;
295
- }
296
- if (this.#engineConfig.debugMode) {
297
- this.jsSampleEvents.push(this.#makeJSSampleEvent(maybeCallForTraceId, timestamp, traceId));
298
- }
299
- return this.#makeProfileCallsForStack(maybeCallForTraceId);
300
- }
301
- /**
302
- * Update tracked stack using this event's call stack.
303
- */
304
- #extractStackTrace(event) {
305
- let stackTrace = this.#currentJSStack;
306
- if (Types.Events.isProfileCall(event)) {
307
- stackTrace = this.#makeProfileCallsForStack(event);
308
- }
309
- const traceId = extractSampleTraceId(event);
310
- const maybeCallForTraceId = traceId && this.#getStackForSampleTraceId(traceId, event.ts);
311
- if (maybeCallForTraceId) {
312
- stackTrace = maybeCallForTraceId;
313
- }
314
- _a.filterStackFrames(stackTrace, this.#engineConfig);
315
- const endTime = event.ts + (event.dur || 0);
316
- const minFrames = Math.min(stackTrace.length, this.#currentJSStack.length);
317
- let i;
318
- // Merge a sample's stack frames with the stack frames we have
319
- // so far if we detect they are equivalent.
320
- // Graphically
321
- // This:
322
- // Current stack trace Sample
323
- // [-------A------] [A]
324
- // [-------B------] [B]
325
- // [-------C------] [C]
326
- // ^ t = x1 ^ t = x2
327
- // Becomes this:
328
- // New stack trace after merge
329
- // [--------A-------]
330
- // [--------B-------]
331
- // [--------C-------]
332
- // ^ t = x2
333
- for (i = this.#lockedJsStackDepth.at(-1) || 0; i < minFrames; ++i) {
334
- const newFrame = stackTrace[i].callFrame;
335
- const oldFrame = this.#currentJSStack[i].callFrame;
336
- if (!_a.framesAreEqual(newFrame, oldFrame)) {
337
- break;
338
- }
339
- // Scoot the right edge of this callFrame to the right
340
- this.#currentJSStack[i].dur =
341
- Types.Timing.Micro(Math.max(this.#currentJSStack[i].dur || 0, endTime - this.#currentJSStack[i].ts));
342
- }
343
- // If there are call frames in the sample that differ with the stack
344
- // we have, update the stack, but keeping the common frames in place
345
- // Graphically
346
- // This:
347
- // Current stack trace Sample
348
- // [-------A------] [A]
349
- // [-------B------] [B]
350
- // [-------C------] [C]
351
- // [-------D------] [E]
352
- // ^ t = x1 ^ t = x2
353
- // Becomes this:
354
- // New stack trace after merge
355
- // [--------A-------]
356
- // [--------B-------]
357
- // [--------C-------]
358
- // [E]
359
- // ^ t = x2
360
- this.#truncateJSStack(i, event.ts);
361
- for (; i < stackTrace.length; ++i) {
362
- const call = stackTrace[i];
363
- if (call.nodeId === this.#profileModel.programNode?.id || call.nodeId === this.#profileModel.root?.id ||
364
- call.nodeId === this.#profileModel.idleNode?.id || call.nodeId === this.#profileModel.gcNode?.id) {
365
- // Skip (root), (program) and (idle) frames, since this are not
366
- // relevant for web profiling and we don't want to show them in
367
- // the timeline.
368
- continue;
369
- }
370
- this.#currentJSStack.push(call);
371
- this.#constructedProfileCalls.push(call);
372
- }
373
- }
374
- /**
375
- * When a call stack that differs from the one we are tracking has
376
- * been detected in the samples, the latter is "truncated" by
377
- * setting the ending time of its call frames and removing the top
378
- * call frames that aren't shared with the new call stack. This way,
379
- * we can update the tracked stack with the new call frames on top.
380
- * @param depth the amount of call frames from bottom to top that
381
- * should be kept in the tracking stack trace. AKA amount of shared
382
- * call frames between two stacks.
383
- * @param time the new end of the call frames in the stack.
384
- */
385
- #truncateJSStack(depth, time) {
386
- if (this.#lockedJsStackDepth.length) {
387
- const lockedDepth = this.#lockedJsStackDepth.at(-1);
388
- if (lockedDepth && depth < lockedDepth) {
389
- console.error(`Child stack is shallower (${depth}) than the parent stack (${lockedDepth}) at ${time}`);
390
- depth = lockedDepth;
391
- }
392
- }
393
- if (this.#currentJSStack.length < depth) {
394
- console.error(`Trying to truncate higher than the current stack size at ${time}`);
395
- depth = this.#currentJSStack.length;
396
- }
397
- for (let k = 0; k < this.#currentJSStack.length; ++k) {
398
- this.#currentJSStack[k].dur = Types.Timing.Micro(Math.max(time - this.#currentJSStack[k].ts, 0));
399
- }
400
- this.#currentJSStack.length = depth;
401
- }
402
- #makeJSSampleEvent(call, timestamp, traceId) {
403
- const JSSampleEvent = {
404
- name: Types.Events.Name.JS_SAMPLE,
405
- cat: 'devtools.timeline',
406
- args: {
407
- data: { traceId, stackTrace: this.#makeProfileCallsForStack(call).map(e => e.callFrame) },
408
- },
409
- ph: Types.Events.Phase.INSTANT,
410
- ts: timestamp,
411
- dur: Types.Timing.Micro(0),
412
- pid: this.#processId,
413
- tid: this.#threadId,
414
- };
415
- return JSSampleEvent;
416
- }
417
- static framesAreEqual(frame1, frame2) {
418
- return frame1.scriptId === frame2.scriptId && frame1.functionName === frame2.functionName &&
419
- frame1.lineNumber === frame2.lineNumber;
420
- }
421
- static showNativeName(name, runtimeCallStatsEnabled) {
422
- return runtimeCallStatsEnabled && Boolean(_a.nativeGroup(name));
423
- }
424
- static nativeGroup(nativeName) {
425
- if (nativeName.startsWith('Parse')) {
426
- return _a.NativeGroups.PARSE;
427
- }
428
- if (nativeName.startsWith('Compile') || nativeName.startsWith('Recompile')) {
429
- return _a.NativeGroups.COMPILE;
430
- }
431
- return null;
432
- }
433
- static isNativeRuntimeFrame(frame) {
434
- return frame.url === 'native V8Runtime';
435
- }
436
- static filterStackFrames(stack, engineConfig) {
437
- const showAllEvents = engineConfig.showAllEvents;
438
- if (showAllEvents) {
439
- return;
440
- }
441
- let j = 0;
442
- for (let i = 0; i < stack.length; ++i) {
443
- const frame = stack[i].callFrame;
444
- const nativeRuntimeFrame = _a.isNativeRuntimeFrame(frame);
445
- if (nativeRuntimeFrame) {
446
- continue;
447
- }
448
- stack[j++] = stack[i];
449
- }
450
- stack.length = j;
451
- }
452
- static createFakeTraceFromCpuProfile(profile, tid) {
453
- if (!profile) {
454
- return { traceEvents: [], metadata: {} };
455
- }
456
- // The |Name.CPU_PROFILE| will let MetaHandler to set |traceIsGeneric| to false
457
- // The start time and duration is important here because we'll use them to determine the traceBounds
458
- // We use the start and end time of the profile (which is longer than all samples), so the Performance
459
- // panel won't truncate this time period.
460
- const cpuProfileEvent = {
461
- cat: 'disabled-by-default-devtools.timeline',
462
- name: Types.Events.Name.CPU_PROFILE,
463
- ph: Types.Events.Phase.COMPLETE,
464
- pid: Types.Events.ProcessID(1),
465
- tid,
466
- ts: Types.Timing.Micro(profile.startTime),
467
- dur: Types.Timing.Micro(profile.endTime - profile.startTime),
468
- args: { data: { cpuProfile: profile } },
469
- // Create an arbitrary profile id.
470
- id: '0x1',
471
- };
472
- return {
473
- traceEvents: [cpuProfileEvent],
474
- metadata: {
475
- dataOrigin: Types.File.DataOrigin.CPU_PROFILE,
476
- }
477
- };
478
- }
479
- static extractCpuProfileFromFakeTrace(traceEvents) {
480
- const profileEvent = traceEvents.find(e => Types.Events.isSyntheticCpuProfile(e));
481
- const profile = profileEvent?.args.data.cpuProfile;
482
- if (!profile) {
483
- throw new Error('Missing cpuProfile data');
484
- }
485
- return profile;
486
- }
487
- }
488
- _a = SamplesIntegrator;
489
- (function (SamplesIntegrator) {
490
- let NativeGroups;
491
- (function (NativeGroups) {
492
- NativeGroups["COMPILE"] = "Compile";
493
- NativeGroups["PARSE"] = "Parse";
494
- })(NativeGroups = SamplesIntegrator.NativeGroups || (SamplesIntegrator.NativeGroups = {}));
495
- })(SamplesIntegrator || (SamplesIntegrator = {}));
496
- //# sourceMappingURL=SamplesIntegrator.js.map