devtools-tracing 1.0.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 (397) hide show
  1. package/generate.ts +643 -0
  2. package/index.ts +16 -0
  3. package/lib/front_end/core/common/App.ts +7 -0
  4. package/lib/front_end/core/common/AppProvider.ts +32 -0
  5. package/lib/front_end/core/common/Base64.ts +47 -0
  6. package/lib/front_end/core/common/CharacterIdMap.ts +30 -0
  7. package/lib/front_end/core/common/Color.ts +2506 -0
  8. package/lib/front_end/core/common/ColorConverter.ts +402 -0
  9. package/lib/front_end/core/common/ColorUtils.ts +252 -0
  10. package/lib/front_end/core/common/Console.ts +114 -0
  11. package/lib/front_end/core/common/Debouncer.ts +15 -0
  12. package/lib/front_end/core/common/EventTarget.ts +52 -0
  13. package/lib/front_end/core/common/Gzip.ts +74 -0
  14. package/lib/front_end/core/common/JavaScriptMetaData.ts +29 -0
  15. package/lib/front_end/core/common/Lazy.ts +31 -0
  16. package/lib/front_end/core/common/Linkifier.ts +55 -0
  17. package/lib/front_end/core/common/MapWithDefault.ts +26 -0
  18. package/lib/front_end/core/common/Mutex.ts +55 -0
  19. package/lib/front_end/core/common/Object.ts +145 -0
  20. package/lib/front_end/core/common/ParsedURL.ts +554 -0
  21. package/lib/front_end/core/common/Progress.ts +180 -0
  22. package/lib/front_end/core/common/QueryParamHandler.ts +7 -0
  23. package/lib/front_end/core/common/ResolverBase.ts +85 -0
  24. package/lib/front_end/core/common/ResourceType.ts +588 -0
  25. package/lib/front_end/core/common/ReturnToPanel.ts +17 -0
  26. package/lib/front_end/core/common/Revealer.ts +192 -0
  27. package/lib/front_end/core/common/Runnable.ts +41 -0
  28. package/lib/front_end/core/common/SegmentedRange.ts +87 -0
  29. package/lib/front_end/core/common/SettingRegistration.ts +339 -0
  30. package/lib/front_end/core/common/Settings.ts +1497 -0
  31. package/lib/front_end/core/common/SimpleHistoryManager.ts +124 -0
  32. package/lib/front_end/core/common/StringOutputStream.ts +26 -0
  33. package/lib/front_end/core/common/TextDictionary.ts +48 -0
  34. package/lib/front_end/core/common/Throttler.ts +99 -0
  35. package/lib/front_end/core/common/Trie.ts +152 -0
  36. package/lib/front_end/core/common/Worker.ts +60 -0
  37. package/lib/front_end/core/common/common.ts +81 -0
  38. package/lib/front_end/core/host/AidaClient.ts +733 -0
  39. package/lib/front_end/core/host/GdpClient.ts +316 -0
  40. package/lib/front_end/core/host/InspectorFrontendHost.ts +648 -0
  41. package/lib/front_end/core/host/InspectorFrontendHostAPI.ts +551 -0
  42. package/lib/front_end/core/host/Platform.ts +76 -0
  43. package/lib/front_end/core/host/ResourceLoader.ts +282 -0
  44. package/lib/front_end/core/host/UserMetrics.ts +1230 -0
  45. package/lib/front_end/core/host/host.ts +23 -0
  46. package/lib/front_end/core/i18n/ByteUtilities.ts +82 -0
  47. package/lib/front_end/core/i18n/DevToolsLocale.ts +87 -0
  48. package/lib/front_end/core/i18n/NumberFormatter.ts +82 -0
  49. package/lib/front_end/core/i18n/i18n.ts +17 -0
  50. package/lib/front_end/core/i18n/i18nImpl.ts +204 -0
  51. package/lib/front_end/core/i18n/i18nTypes.ts +10 -0
  52. package/lib/front_end/core/i18n/locales.js +14 -0
  53. package/lib/front_end/core/i18n/time-utilities.ts +174 -0
  54. package/lib/front_end/core/platform/ArrayUtilities.ts +271 -0
  55. package/lib/front_end/core/platform/Brand.ts +23 -0
  56. package/lib/front_end/core/platform/Constructor.ts +10 -0
  57. package/lib/front_end/core/platform/DOMUtilities.ts +138 -0
  58. package/lib/front_end/core/platform/DateUtilities.ts +15 -0
  59. package/lib/front_end/core/platform/DevToolsPath.ts +53 -0
  60. package/lib/front_end/core/platform/KeyboardUtilities.ts +38 -0
  61. package/lib/front_end/core/platform/MapUtilities.ts +95 -0
  62. package/lib/front_end/core/platform/MimeType.ts +175 -0
  63. package/lib/front_end/core/platform/NumberUtilities.ts +80 -0
  64. package/lib/front_end/core/platform/StringUtilities.ts +588 -0
  65. package/lib/front_end/core/platform/Timing.ts +17 -0
  66. package/lib/front_end/core/platform/TypedArrayUtilities.ts +189 -0
  67. package/lib/front_end/core/platform/TypescriptUtilities.ts +86 -0
  68. package/lib/front_end/core/platform/UIString.ts +39 -0
  69. package/lib/front_end/core/platform/UserVisibleError.ts +28 -0
  70. package/lib/front_end/core/platform/platform.ts +45 -0
  71. package/lib/front_end/core/protocol_client/ConnectionTransport.ts +26 -0
  72. package/lib/front_end/core/protocol_client/InspectorBackend.ts +1050 -0
  73. package/lib/front_end/core/protocol_client/NodeURL.ts +42 -0
  74. package/lib/front_end/core/protocol_client/protocol_client.ts +13 -0
  75. package/lib/front_end/core/root/Runtime.ts +609 -0
  76. package/lib/front_end/core/root/root.ts +6 -0
  77. package/lib/front_end/core/sdk/AccessibilityModel.ts +353 -0
  78. package/lib/front_end/core/sdk/AnimationModel.ts +1041 -0
  79. package/lib/front_end/core/sdk/AutofillModel.ts +184 -0
  80. package/lib/front_end/core/sdk/CPUProfilerModel.ts +148 -0
  81. package/lib/front_end/core/sdk/CPUThrottlingManager.ts +282 -0
  82. package/lib/front_end/core/sdk/CSSContainerQuery.ts +139 -0
  83. package/lib/front_end/core/sdk/CSSFontFace.ts +40 -0
  84. package/lib/front_end/core/sdk/CSSLayer.ts +30 -0
  85. package/lib/front_end/core/sdk/CSSMatchedStyles.ts +1646 -0
  86. package/lib/front_end/core/sdk/CSSMedia.ts +121 -0
  87. package/lib/front_end/core/sdk/CSSMetadata.ts +1647 -0
  88. package/lib/front_end/core/sdk/CSSModel.ts +1128 -0
  89. package/lib/front_end/core/sdk/CSSProperty.ts +384 -0
  90. package/lib/front_end/core/sdk/CSSPropertyParser.ts +681 -0
  91. package/lib/front_end/core/sdk/CSSPropertyParserMatchers.ts +1395 -0
  92. package/lib/front_end/core/sdk/CSSQuery.ts +72 -0
  93. package/lib/front_end/core/sdk/CSSRule.ts +465 -0
  94. package/lib/front_end/core/sdk/CSSScope.ts +30 -0
  95. package/lib/front_end/core/sdk/CSSStartingStyle.ts +29 -0
  96. package/lib/front_end/core/sdk/CSSStyleDeclaration.ts +313 -0
  97. package/lib/front_end/core/sdk/CSSStyleSheetHeader.ts +196 -0
  98. package/lib/front_end/core/sdk/CSSSupports.ts +33 -0
  99. package/lib/front_end/core/sdk/CategorizedBreakpoint.ts +64 -0
  100. package/lib/front_end/core/sdk/ChildTargetManager.ts +314 -0
  101. package/lib/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +62 -0
  102. package/lib/front_end/core/sdk/Connections.ts +293 -0
  103. package/lib/front_end/core/sdk/ConsoleModel.ts +808 -0
  104. package/lib/front_end/core/sdk/ConsoleModelTypes.ts +15 -0
  105. package/lib/front_end/core/sdk/Cookie.ts +319 -0
  106. package/lib/front_end/core/sdk/CookieModel.ts +239 -0
  107. package/lib/front_end/core/sdk/CookieParser.ts +185 -0
  108. package/lib/front_end/core/sdk/DOMDebuggerModel.ts +787 -0
  109. package/lib/front_end/core/sdk/DOMModel.ts +1961 -0
  110. package/lib/front_end/core/sdk/DebuggerModel.ts +1605 -0
  111. package/lib/front_end/core/sdk/EmulationModel.ts +648 -0
  112. package/lib/front_end/core/sdk/EnhancedTracesParser.ts +515 -0
  113. package/lib/front_end/core/sdk/EventBreakpointsModel.ts +183 -0
  114. package/lib/front_end/core/sdk/FrameAssociated.ts +11 -0
  115. package/lib/front_end/core/sdk/FrameManager.ts +259 -0
  116. package/lib/front_end/core/sdk/HeapProfilerModel.ts +225 -0
  117. package/lib/front_end/core/sdk/HttpReasonPhraseStrings.ts +77 -0
  118. package/lib/front_end/core/sdk/IOModel.ts +91 -0
  119. package/lib/front_end/core/sdk/IsolateManager.ts +257 -0
  120. package/lib/front_end/core/sdk/IssuesModel.ts +70 -0
  121. package/lib/front_end/core/sdk/LayerTreeBase.ts +169 -0
  122. package/lib/front_end/core/sdk/LogModel.ts +56 -0
  123. package/lib/front_end/core/sdk/NetworkManager.ts +2823 -0
  124. package/lib/front_end/core/sdk/NetworkRequest.ts +2253 -0
  125. package/lib/front_end/core/sdk/OverlayColorGenerator.ts +52 -0
  126. package/lib/front_end/core/sdk/OverlayModel.ts +1011 -0
  127. package/lib/front_end/core/sdk/OverlayPersistentHighlighter.ts +522 -0
  128. package/lib/front_end/core/sdk/PageLoad.ts +35 -0
  129. package/lib/front_end/core/sdk/PageResourceLoader.ts +435 -0
  130. package/lib/front_end/core/sdk/PaintProfiler.ts +110 -0
  131. package/lib/front_end/core/sdk/PerformanceMetricsModel.ts +84 -0
  132. package/lib/front_end/core/sdk/PreloadingModel.ts +863 -0
  133. package/lib/front_end/core/sdk/RehydratingConnection.ts +386 -0
  134. package/lib/front_end/core/sdk/RehydratingObject.ts +66 -0
  135. package/lib/front_end/core/sdk/RemoteObject.ts +1160 -0
  136. package/lib/front_end/core/sdk/Resource.ts +232 -0
  137. package/lib/front_end/core/sdk/ResourceTreeModel.ts +1160 -0
  138. package/lib/front_end/core/sdk/RuntimeModel.ts +732 -0
  139. package/lib/front_end/core/sdk/SDKModel.ts +65 -0
  140. package/lib/front_end/core/sdk/ScopeTreeCache.ts +45 -0
  141. package/lib/front_end/core/sdk/ScreenCaptureModel.ts +255 -0
  142. package/lib/front_end/core/sdk/Script.ts +534 -0
  143. package/lib/front_end/core/sdk/SecurityOriginManager.ts +76 -0
  144. package/lib/front_end/core/sdk/ServerSentEvents.ts +80 -0
  145. package/lib/front_end/core/sdk/ServerSentEventsProtocol.ts +122 -0
  146. package/lib/front_end/core/sdk/ServerTiming.ts +260 -0
  147. package/lib/front_end/core/sdk/ServiceWorkerCacheModel.ts +377 -0
  148. package/lib/front_end/core/sdk/ServiceWorkerManager.ts +605 -0
  149. package/lib/front_end/core/sdk/SourceMap.ts +867 -0
  150. package/lib/front_end/core/sdk/SourceMapCache.ts +54 -0
  151. package/lib/front_end/core/sdk/SourceMapFunctionRanges.ts +156 -0
  152. package/lib/front_end/core/sdk/SourceMapManager.ts +239 -0
  153. package/lib/front_end/core/sdk/SourceMapScopeChainEntry.ts +189 -0
  154. package/lib/front_end/core/sdk/SourceMapScopesInfo.ts +508 -0
  155. package/lib/front_end/core/sdk/StorageBucketsModel.ts +204 -0
  156. package/lib/front_end/core/sdk/StorageKeyManager.ts +98 -0
  157. package/lib/front_end/core/sdk/Target.ts +332 -0
  158. package/lib/front_end/core/sdk/TargetManager.ts +453 -0
  159. package/lib/front_end/core/sdk/TraceObject.ts +61 -0
  160. package/lib/front_end/core/sdk/WebAuthnModel.ts +104 -0
  161. package/lib/front_end/core/sdk/sdk.ts +174 -0
  162. package/lib/front_end/entrypoints/formatter_worker/FormatterActions.ts +59 -0
  163. package/lib/front_end/generated/InspectorBackendCommands.js +1617 -0
  164. package/lib/front_end/generated/SupportedCSSProperties.js +7512 -0
  165. package/lib/front_end/generated/protocol-proxy-api.d.ts +5022 -0
  166. package/lib/front_end/generated/protocol.ts +22014 -0
  167. package/lib/front_end/models/cpu_profile/CPUProfileDataModel.ts +571 -0
  168. package/lib/front_end/models/cpu_profile/ProfileTreeModel.ts +103 -0
  169. package/lib/front_end/models/cpu_profile/cpu_profile.ts +11 -0
  170. package/lib/front_end/models/formatter/FormatterWorkerPool.ts +219 -0
  171. package/lib/front_end/models/formatter/ScriptFormatter.ts +112 -0
  172. package/lib/front_end/models/formatter/formatter.ts +8 -0
  173. package/lib/front_end/models/text_utils/CodeMirrorUtils.ts +37 -0
  174. package/lib/front_end/models/text_utils/ContentData.ts +199 -0
  175. package/lib/front_end/models/text_utils/ContentProvider.ts +68 -0
  176. package/lib/front_end/models/text_utils/StaticContentProvider.ts +49 -0
  177. package/lib/front_end/models/text_utils/StreamingContentData.ts +108 -0
  178. package/lib/front_end/models/text_utils/Text.ts +90 -0
  179. package/lib/front_end/models/text_utils/TextCursor.ts +44 -0
  180. package/lib/front_end/models/text_utils/TextRange.ts +266 -0
  181. package/lib/front_end/models/text_utils/TextUtils.ts +401 -0
  182. package/lib/front_end/models/text_utils/WasmDisassembly.ts +87 -0
  183. package/lib/front_end/models/text_utils/text_utils.ts +27 -0
  184. package/lib/front_end/models/trace/EntityMapper.ts +141 -0
  185. package/lib/front_end/models/trace/EventsSerializer.ts +101 -0
  186. package/lib/front_end/models/trace/LanternComputationData.ts +438 -0
  187. package/lib/front_end/models/trace/ModelImpl.ts +236 -0
  188. package/lib/front_end/models/trace/Name.ts +136 -0
  189. package/lib/front_end/models/trace/Processor.ts +652 -0
  190. package/lib/front_end/models/trace/Styles.ts +1138 -0
  191. package/lib/front_end/models/trace/extras/FilmStrip.ts +78 -0
  192. package/lib/front_end/models/trace/extras/MainThreadActivity.ts +86 -0
  193. package/lib/front_end/models/trace/extras/ScriptDuplication.ts +236 -0
  194. package/lib/front_end/models/trace/extras/StackTraceForEvent.ts +203 -0
  195. package/lib/front_end/models/trace/extras/ThirdParties.ts +164 -0
  196. package/lib/front_end/models/trace/extras/TraceFilter.ts +62 -0
  197. package/lib/front_end/models/trace/extras/TraceTree.ts +701 -0
  198. package/lib/front_end/models/trace/extras/extras.ts +11 -0
  199. package/lib/front_end/models/trace/handlers/AnimationFramesHandler.ts +128 -0
  200. package/lib/front_end/models/trace/handlers/AnimationHandler.ts +36 -0
  201. package/lib/front_end/models/trace/handlers/AsyncJSCallsHandler.ts +239 -0
  202. package/lib/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +183 -0
  203. package/lib/front_end/models/trace/handlers/DOMStatsHandler.ts +31 -0
  204. package/lib/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +306 -0
  205. package/lib/front_end/models/trace/handlers/FlowsHandler.ts +175 -0
  206. package/lib/front_end/models/trace/handlers/FramesHandler.ts +571 -0
  207. package/lib/front_end/models/trace/handlers/GPUHandler.ts +50 -0
  208. package/lib/front_end/models/trace/handlers/ImagePaintingHandler.ts +183 -0
  209. package/lib/front_end/models/trace/handlers/InitiatorsHandler.ts +193 -0
  210. package/lib/front_end/models/trace/handlers/InvalidationsHandler.ts +168 -0
  211. package/lib/front_end/models/trace/handlers/LargestImagePaintHandler.ts +109 -0
  212. package/lib/front_end/models/trace/handlers/LargestTextPaintHandler.ts +35 -0
  213. package/lib/front_end/models/trace/handlers/LayerTreeHandler.ts +123 -0
  214. package/lib/front_end/models/trace/handlers/LayoutShiftsHandler.ts +573 -0
  215. package/lib/front_end/models/trace/handlers/MemoryHandler.ts +31 -0
  216. package/lib/front_end/models/trace/handlers/MetaHandler.ts +525 -0
  217. package/lib/front_end/models/trace/handlers/ModelHandlers.ts +34 -0
  218. package/lib/front_end/models/trace/handlers/NetworkRequestsHandler.ts +672 -0
  219. package/lib/front_end/models/trace/handlers/PageFramesHandler.ts +52 -0
  220. package/lib/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +460 -0
  221. package/lib/front_end/models/trace/handlers/RendererHandler.ts +428 -0
  222. package/lib/front_end/models/trace/handlers/SamplesHandler.ts +271 -0
  223. package/lib/front_end/models/trace/handlers/ScreenshotsHandler.ts +122 -0
  224. package/lib/front_end/models/trace/handlers/ScriptsHandler.ts +336 -0
  225. package/lib/front_end/models/trace/handlers/SelectorStatsHandler.ts +110 -0
  226. package/lib/front_end/models/trace/handlers/Threads.ts +139 -0
  227. package/lib/front_end/models/trace/handlers/UserInteractionsHandler.ts +400 -0
  228. package/lib/front_end/models/trace/handlers/UserTimingsHandler.ts +233 -0
  229. package/lib/front_end/models/trace/handlers/WarningsHandler.ts +162 -0
  230. package/lib/front_end/models/trace/handlers/WorkersHandler.ts +45 -0
  231. package/lib/front_end/models/trace/handlers/handlers.ts +8 -0
  232. package/lib/front_end/models/trace/handlers/helpers.ts +196 -0
  233. package/lib/front_end/models/trace/handlers/types.ts +75 -0
  234. package/lib/front_end/models/trace/helpers/Extensions.ts +54 -0
  235. package/lib/front_end/models/trace/helpers/Network.ts +129 -0
  236. package/lib/front_end/models/trace/helpers/SamplesIntegrator.ts +544 -0
  237. package/lib/front_end/models/trace/helpers/SyntheticEvents.ts +87 -0
  238. package/lib/front_end/models/trace/helpers/Timing.ts +248 -0
  239. package/lib/front_end/models/trace/helpers/Trace.ts +928 -0
  240. package/lib/front_end/models/trace/helpers/TreeHelpers.ts +320 -0
  241. package/lib/front_end/models/trace/helpers/helpers.ts +11 -0
  242. package/lib/front_end/models/trace/insights/CLSCulprits.ts +668 -0
  243. package/lib/front_end/models/trace/insights/Cache.ts +269 -0
  244. package/lib/front_end/models/trace/insights/Common.ts +453 -0
  245. package/lib/front_end/models/trace/insights/DOMSize.ts +223 -0
  246. package/lib/front_end/models/trace/insights/DocumentLatency.ts +319 -0
  247. package/lib/front_end/models/trace/insights/DuplicatedJavaScript.ts +126 -0
  248. package/lib/front_end/models/trace/insights/FontDisplay.ts +119 -0
  249. package/lib/front_end/models/trace/insights/ForcedReflow.ts +220 -0
  250. package/lib/front_end/models/trace/insights/INPBreakdown.ts +171 -0
  251. package/lib/front_end/models/trace/insights/ImageDelivery.ts +348 -0
  252. package/lib/front_end/models/trace/insights/LCPBreakdown.ts +268 -0
  253. package/lib/front_end/models/trace/insights/LCPDiscovery.ts +237 -0
  254. package/lib/front_end/models/trace/insights/LegacyJavaScript.ts +138 -0
  255. package/lib/front_end/models/trace/insights/Models.ts +22 -0
  256. package/lib/front_end/models/trace/insights/ModernHTTP.ts +257 -0
  257. package/lib/front_end/models/trace/insights/NetworkDependencyTree.ts +726 -0
  258. package/lib/front_end/models/trace/insights/RenderBlocking.ts +257 -0
  259. package/lib/front_end/models/trace/insights/SlowCSSSelector.ts +175 -0
  260. package/lib/front_end/models/trace/insights/Statistics.ts +101 -0
  261. package/lib/front_end/models/trace/insights/ThirdParties.ts +130 -0
  262. package/lib/front_end/models/trace/insights/Viewport.ts +138 -0
  263. package/lib/front_end/models/trace/insights/insights.ts +10 -0
  264. package/lib/front_end/models/trace/insights/types.ts +157 -0
  265. package/lib/front_end/models/trace/lantern/core/LanternError.ts +7 -0
  266. package/lib/front_end/models/trace/lantern/core/NetworkAnalyzer.ts +619 -0
  267. package/lib/front_end/models/trace/lantern/core/core.ts +6 -0
  268. package/lib/front_end/models/trace/lantern/graph/BaseNode.ts +345 -0
  269. package/lib/front_end/models/trace/lantern/graph/CPUNode.ts +80 -0
  270. package/lib/front_end/models/trace/lantern/graph/NetworkNode.ts +101 -0
  271. package/lib/front_end/models/trace/lantern/graph/PageDependencyGraph.ts +636 -0
  272. package/lib/front_end/models/trace/lantern/graph/graph.ts +8 -0
  273. package/lib/front_end/models/trace/lantern/lantern.ts +17 -0
  274. package/lib/front_end/models/trace/lantern/metrics/FirstContentfulPaint.ts +187 -0
  275. package/lib/front_end/models/trace/lantern/metrics/Interactive.ts +88 -0
  276. package/lib/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +92 -0
  277. package/lib/front_end/models/trace/lantern/metrics/MaxPotentialFID.ts +72 -0
  278. package/lib/front_end/models/trace/lantern/metrics/Metric.ts +126 -0
  279. package/lib/front_end/models/trace/lantern/metrics/SpeedIndex.ts +126 -0
  280. package/lib/front_end/models/trace/lantern/metrics/TBTUtils.ts +82 -0
  281. package/lib/front_end/models/trace/lantern/metrics/TotalBlockingTime.ts +112 -0
  282. package/lib/front_end/models/trace/lantern/metrics/metrics.ts +12 -0
  283. package/lib/front_end/models/trace/lantern/simulation/ConnectionPool.ts +150 -0
  284. package/lib/front_end/models/trace/lantern/simulation/Constants.ts +46 -0
  285. package/lib/front_end/models/trace/lantern/simulation/DNSCache.ts +61 -0
  286. package/lib/front_end/models/trace/lantern/simulation/SimulationTimingMap.ts +196 -0
  287. package/lib/front_end/models/trace/lantern/simulation/Simulator.ts +556 -0
  288. package/lib/front_end/models/trace/lantern/simulation/TCPConnection.ts +192 -0
  289. package/lib/front_end/models/trace/lantern/simulation/simulation.ts +10 -0
  290. package/lib/front_end/models/trace/lantern/types/Lantern.ts +220 -0
  291. package/lib/front_end/models/trace/lantern/types/types.ts +5 -0
  292. package/lib/front_end/models/trace/trace.ts +33 -0
  293. package/lib/front_end/models/trace/types/Configuration.ts +110 -0
  294. package/lib/front_end/models/trace/types/Extensions.ts +136 -0
  295. package/lib/front_end/models/trace/types/File.ts +281 -0
  296. package/lib/front_end/models/trace/types/Overlays.ts +138 -0
  297. package/lib/front_end/models/trace/types/Timing.ts +30 -0
  298. package/lib/front_end/models/trace/types/TraceEvents.ts +3277 -0
  299. package/lib/front_end/models/trace/types/types.ts +10 -0
  300. package/lib/front_end/third_party/i18n/LICENSE +202 -0
  301. package/lib/front_end/third_party/i18n/README.chromium +15 -0
  302. package/lib/front_end/third_party/i18n/i18n-impl.ts +61 -0
  303. package/lib/front_end/third_party/i18n/i18n.ts +11 -0
  304. package/lib/front_end/third_party/i18n/localized-string-set.ts +129 -0
  305. package/lib/front_end/third_party/intl-messageformat/LICENSE +33 -0
  306. package/lib/front_end/third_party/intl-messageformat/README.chromium +24 -0
  307. package/lib/front_end/third_party/intl-messageformat/intl-messageformat-tsconfig.json +16 -0
  308. package/lib/front_end/third_party/intl-messageformat/intl-messageformat.ts +6 -0
  309. package/lib/front_end/third_party/intl-messageformat/package/LICENSE.md +33 -0
  310. package/lib/front_end/third_party/intl-messageformat/package/README.md +3 -0
  311. package/lib/front_end/third_party/intl-messageformat/package/index.d.ts +6 -0
  312. package/lib/front_end/third_party/intl-messageformat/package/index.d.ts.map +1 -0
  313. package/lib/front_end/third_party/intl-messageformat/package/index.js +13 -0
  314. package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.d.ts +5 -0
  315. package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.js +1710 -0
  316. package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.iife.js +1815 -0
  317. package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts +6 -0
  318. package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts.map +1 -0
  319. package/lib/front_end/third_party/intl-messageformat/package/lib/index.js +10 -0
  320. package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts +34 -0
  321. package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts.map +1 -0
  322. package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.js +229 -0
  323. package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts +28 -0
  324. package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts.map +1 -0
  325. package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.js +48 -0
  326. package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts +34 -0
  327. package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts.map +1 -0
  328. package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.js +179 -0
  329. package/lib/front_end/third_party/intl-messageformat/package/package.json +42 -0
  330. package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts +34 -0
  331. package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts.map +1 -0
  332. package/lib/front_end/third_party/intl-messageformat/package/src/core.js +230 -0
  333. package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts +28 -0
  334. package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts.map +1 -0
  335. package/lib/front_end/third_party/intl-messageformat/package/src/error.js +51 -0
  336. package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts +34 -0
  337. package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts.map +1 -0
  338. package/lib/front_end/third_party/intl-messageformat/package/src/formatters.js +182 -0
  339. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/error.d.ts +79 -0
  340. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/index.d.ts +15 -0
  341. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/parser.d.ts +153 -0
  342. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/types.d.ts +139 -0
  343. package/lib/front_end/third_party/legacy-javascript/LICENSE +202 -0
  344. package/lib/front_end/third_party/legacy-javascript/README.chromium +13 -0
  345. package/lib/front_end/third_party/legacy-javascript/legacy-javascript-tsconfig.json +8 -0
  346. package/lib/front_end/third_party/legacy-javascript/legacy-javascript.ts +3 -0
  347. package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.d.ts +18 -0
  348. package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.js +943 -0
  349. package/lib/front_end/third_party/legacy-javascript/package.json +8 -0
  350. package/lib/front_end/third_party/legacy-javascript/rebuild.sh +9 -0
  351. package/lib/front_end/third_party/third-party-web/LICENSE +20 -0
  352. package/lib/front_end/third_party/third-party-web/README.chromium +13 -0
  353. package/lib/front_end/third_party/third-party-web/lib/nostats-subset.d.ts +2 -0
  354. package/lib/front_end/third_party/third-party-web/lib/nostats-subset.js +149 -0
  355. package/lib/front_end/third_party/third-party-web/package/LICENSE +20 -0
  356. package/lib/front_end/third_party/third-party-web/package/README.md +929 -0
  357. package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive-nostats.json +1 -0
  358. package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive.json +1 -0
  359. package/lib/front_end/third_party/third-party-web/package/dist/entities-nostats.json +1 -0
  360. package/lib/front_end/third_party/third-party-web/package/dist/entities.json +1 -0
  361. package/lib/front_end/third_party/third-party-web/package/facades.md +46 -0
  362. package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.d.ts +1 -0
  363. package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.js +1 -0
  364. package/lib/front_end/third_party/third-party-web/package/httparchive-subset.d.ts +1 -0
  365. package/lib/front_end/third_party/third-party-web/package/httparchive-subset.js +1 -0
  366. package/lib/front_end/third_party/third-party-web/package/lib/__snapshots__/index.test.js.snap +1006 -0
  367. package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.js +139 -0
  368. package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.test.js +44 -0
  369. package/lib/front_end/third_party/third-party-web/package/lib/entities.test.js +27 -0
  370. package/lib/front_end/third_party/third-party-web/package/lib/index.d.ts +34 -0
  371. package/lib/front_end/third_party/third-party-web/package/lib/index.js +3 -0
  372. package/lib/front_end/third_party/third-party-web/package/lib/index.test.js +246 -0
  373. package/lib/front_end/third_party/third-party-web/package/lib/markdown/faqs.partial.md +36 -0
  374. package/lib/front_end/third_party/third-party-web/package/lib/markdown/goals.partial.md +9 -0
  375. package/lib/front_end/third_party/third-party-web/package/lib/markdown/methodology.partial.md +5 -0
  376. package/lib/front_end/third_party/third-party-web/package/lib/markdown/template.md +151 -0
  377. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-02-01.md +1 -0
  378. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-03-01.md +1 -0
  379. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-06.md +1 -0
  380. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-13.md +14 -0
  381. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2021-01-01.md +1 -0
  382. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2024-07-01.md +3 -0
  383. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.d.ts +1 -0
  384. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.js +3 -0
  385. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.d.ts +1 -0
  386. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.js +3 -0
  387. package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.d.ts +1 -0
  388. package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.js +3 -0
  389. package/lib/front_end/third_party/third-party-web/package/nostats-subset.d.ts +1 -0
  390. package/lib/front_end/third_party/third-party-web/package/nostats-subset.js +1 -0
  391. package/lib/front_end/third_party/third-party-web/package/package.json +46 -0
  392. package/lib/front_end/third_party/third-party-web/package.json +8 -0
  393. package/lib/front_end/third_party/third-party-web/rebuild.sh +13 -0
  394. package/lib/front_end/third_party/third-party-web/third-party-web-tsconfig.json +8 -0
  395. package/lib/front_end/third_party/third-party-web/third-party-web.ts +3 -0
  396. package/package.json +24 -0
  397. package/patches/chrome-devtools-frontend+1.0.1533544.patch +187 -0
@@ -0,0 +1,136 @@
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
+
5
+ import type * as Platform from '../../../core/platform/platform.js';
6
+
7
+ import type {
8
+ ConsoleTimeStamp, Event, PerformanceMark, PerformanceMeasureBegin, Phase, SyntheticBased} from './TraceEvents.js';
9
+
10
+ export type ExtensionEntryType = 'track-entry'|'marker';
11
+
12
+ export const extensionPalette = [
13
+ 'primary',
14
+ 'primary-light',
15
+ 'primary-dark',
16
+ 'secondary',
17
+ 'secondary-light',
18
+ 'secondary-dark',
19
+ 'tertiary',
20
+ 'tertiary-light',
21
+ 'tertiary-dark',
22
+ 'error',
23
+ 'warning',
24
+ ] as const;
25
+
26
+ export type ExtensionColorFromPalette = typeof extensionPalette[number];
27
+
28
+ /**
29
+ * Represents any valid value that can be produced by JSON.parse()
30
+ * without a reviver.
31
+ */
32
+ export type JsonValue = string|number|boolean|null|JsonValue[]|{[key: string]: JsonValue};
33
+
34
+ export interface DevToolsObjBase {
35
+ color?: ExtensionColorFromPalette;
36
+ /**
37
+ * We document to users that we support only string values here, but because
38
+ * this is coming from user code the values could be anything, so we ensure we
39
+ * deal with bad data by typing this as unknown.
40
+ */
41
+ properties?: Array<[string, JsonValue]>;
42
+ tooltipText?: string;
43
+ }
44
+
45
+ export type DevToolsObj = DevToolsObjEntry|DevToolsObjMarker;
46
+
47
+ export interface ExtensionTrackEntryPayloadDeeplink {
48
+ // The URL (deep-link) to show in the summary for the track.
49
+ url: Platform.DevToolsPath.UrlString;
50
+ // The label to show in front of the URL when the deep-link is shown in the
51
+ // graph.
52
+ description: string;
53
+ }
54
+
55
+ export interface DevToolsObjEntry extends DevToolsObjBase {
56
+ // Typed as possibly undefined since when no data type is provided
57
+ // the entry is defaulted to a track entry
58
+ dataType?: 'track-entry';
59
+ // The name of the track the entry will be displayed in.
60
+ // Entries intended to be displayed in the same track must contain the
61
+ // same value in this property.
62
+ // If undefined, measurement is added to the Timings track
63
+ track: string;
64
+ // The track group an entry’s track belongs to.
65
+ // Entries intended to be displayed in the same track must contain the
66
+ // same value in this property as well as the same value in the track
67
+ // property.
68
+ trackGroup?: string;
69
+ // Additional data (e.g. deep-link URL) that can be shown in the summary
70
+ // In perf.mark/measure, it's anything in the `detail` object that's not the `devtools` object
71
+ // In console.timestamp, it's the 7th argument to console.timeStamp().
72
+ userDetail?: JsonValue;
73
+ }
74
+
75
+ export interface DevToolsObjMarker extends DevToolsObjBase {
76
+ dataType: 'marker';
77
+ }
78
+
79
+ /**
80
+ * Synthetic events created for extension tracks.
81
+ */
82
+ export interface SyntheticExtensionTrackEntry extends
83
+ SyntheticBased<Phase.COMPLETE, PerformanceMeasureBegin|PerformanceMark|ConsoleTimeStamp> {
84
+ devtoolsObj: DevToolsObjEntry;
85
+ userDetail: JsonValue|null;
86
+ }
87
+
88
+ /**
89
+ * Synthetic events created for extension marks.
90
+ */
91
+ export interface SyntheticExtensionMarker extends SyntheticBased<Phase.INSTANT, PerformanceMark> {
92
+ devtoolsObj: DevToolsObjMarker;
93
+ userDetail: JsonValue|null;
94
+ }
95
+
96
+ export type SyntheticExtensionEntry = SyntheticExtensionTrackEntry|SyntheticExtensionMarker;
97
+
98
+ /** Returns true if this is a devtoolsObj for a marker */
99
+ export function isExtensionPayloadMarker(payload: {dataType?: string}): payload is DevToolsObjMarker {
100
+ return payload.dataType === 'marker';
101
+ }
102
+
103
+ /** Returns true if this is a devtoolsObj for an entry (non-instant) */
104
+ export function isExtensionEntryObj(payload: {track?: string, dataType?: string}): payload is DevToolsObjEntry {
105
+ const hasTrack = 'track' in payload && Boolean(payload.track);
106
+ const validEntryType = payload.dataType === 'track-entry' || payload.dataType === undefined;
107
+ return validEntryType && hasTrack;
108
+ }
109
+
110
+ /** Returns true if this is a devtoolsObj for a console.timeStamp */
111
+ export function isConsoleTimestampPayloadTrackEntry(payload: {description?: string, url?: string}):
112
+ payload is ExtensionTrackEntryPayloadDeeplink {
113
+ return payload.url !== undefined && payload.description !== undefined;
114
+ }
115
+
116
+ export function isValidExtensionPayload(
117
+ payload: {track?: string, dataType?: string, description?: string, url?: string}): payload is DevToolsObj|
118
+ ExtensionTrackEntryPayloadDeeplink {
119
+ return isExtensionPayloadMarker(payload) || isExtensionEntryObj(payload) ||
120
+ isConsoleTimestampPayloadTrackEntry(payload);
121
+ }
122
+
123
+ export function isSyntheticExtensionEntry(entry: Event): entry is SyntheticExtensionEntry {
124
+ return entry.cat === 'devtools.extension';
125
+ }
126
+
127
+ export interface ExtensionTrackData {
128
+ // Name of the top level track. If it's a track group then this value
129
+ // has the name of the group, otherwise it has the name of the track.
130
+ name: string;
131
+ isTrackGroup: boolean;
132
+ // If this contains the data of a track group, this property contains
133
+ // the entries of each of the tracks in the the group. If this is a
134
+ // standalone track, then this contains that track's entries only.
135
+ entriesByTrack: Record<string, SyntheticExtensionTrackEntry[]>;
136
+ }
@@ -0,0 +1,281 @@
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
+
5
+ import type * as SDK from '../../../core/sdk/sdk.js';
6
+ import type * as Protocol from '../../../generated/protocol.js';
7
+ import type * as CrUXManager from '../../../models/crux-manager/crux-manager.js';
8
+
9
+ import type {TraceWindowMicro} from './Timing.js';
10
+ import type {Event, LegacyTimelineFrame, ProcessID, SampleIndex, ThreadID} from './TraceEvents.js';
11
+
12
+ export interface TraceFile {
13
+ traceEvents: readonly Event[];
14
+ metadata: MetaData;
15
+ }
16
+
17
+ export interface Breadcrumb {
18
+ window: TraceWindowMicro;
19
+ child: Breadcrumb|null;
20
+ }
21
+
22
+ export const enum DataOrigin {
23
+ CPU_PROFILE = 'CPUProfile',
24
+ TRACE_EVENTS = 'TraceEvents',
25
+ }
26
+
27
+ /**
28
+ * The Entries link can have 3 stated:
29
+ * 1. The Link creation is not started yet, meaning only the button that needs to be clicked to start creating the link is visible.
30
+ * 2. Pending to event - the creation is started, but the entry that the link points to has not been chosen yet
31
+ * 3. Link connected - final state, both entries present
32
+ */
33
+ export const enum EntriesLinkState {
34
+ CREATION_NOT_STARTED = 'creation_not_started',
35
+ PENDING_TO_EVENT = 'pending_to_event',
36
+ CONNECTED = 'connected',
37
+ }
38
+
39
+ export const enum EventKeyType {
40
+ RAW_EVENT = 'r',
41
+ SYNTHETIC_EVENT = 's',
42
+ PROFILE_CALL = 'p',
43
+ LEGACY_TIMELINE_FRAME = 'l',
44
+ }
45
+
46
+ /**
47
+ * Represents an object that is saved in the file when user created annotations in the timeline.
48
+ *
49
+ * Expected to add more annotations.
50
+ */
51
+ export interface SerializedAnnotations {
52
+ entryLabels: EntryLabelAnnotationSerialized[];
53
+ labelledTimeRanges: TimeRangeAnnotationSerialized[];
54
+ linksBetweenEntries: EntriesLinkAnnotationSerialized[];
55
+ }
56
+
57
+ /**
58
+ * Represents an object that is used to store the Entry Label annotation that is created when a user creates a label for an entry in the timeline.
59
+ */
60
+ export interface EntryLabelAnnotation {
61
+ type: 'ENTRY_LABEL';
62
+ entry: Event|LegacyTimelineFrame;
63
+ label: string;
64
+ }
65
+
66
+ /**
67
+ * Represents an object that is used to store the Labelled Time Range Annotation that is created when a user creates a Time Range Selection in the timeline.
68
+ */
69
+ export interface TimeRangeAnnotation {
70
+ type: 'TIME_RANGE';
71
+ label: string;
72
+ bounds: TraceWindowMicro;
73
+ }
74
+
75
+ export interface EntriesLinkAnnotation {
76
+ type: 'ENTRIES_LINK';
77
+ state: EntriesLinkState;
78
+ entryFrom: Event;
79
+ entryTo?: Event;
80
+ }
81
+
82
+ /**
83
+ * Represents an object that is saved in the file when a user creates a label for an entry in the timeline.
84
+ */
85
+ export interface EntryLabelAnnotationSerialized {
86
+ entry: SerializableKey;
87
+ label: string;
88
+ }
89
+
90
+ /**
91
+ * Represents an object that is saved in the file when a user creates a time range with a label in the timeline.
92
+ */
93
+ export interface TimeRangeAnnotationSerialized {
94
+ bounds: TraceWindowMicro;
95
+ label: string;
96
+ }
97
+
98
+ /**
99
+ * Represents an object that is saved in the file when a user creates a link between entries in the timeline.
100
+ */
101
+ export interface EntriesLinkAnnotationSerialized {
102
+ entryFrom: SerializableKey;
103
+ entryTo: SerializableKey;
104
+ }
105
+
106
+ /**
107
+ * `Annotation` are the user-created annotations that are saved into the metadata.
108
+ * Those annotations are rendered on the timeline by `Overlays.ts`
109
+ *
110
+ * TODO: Implement other OverlayAnnotations (annotated time ranges, links between entries).
111
+ * TODO: Save/load overlay annotations to/from the trace file.
112
+ */
113
+ export type Annotation = EntryLabelAnnotation|TimeRangeAnnotation|EntriesLinkAnnotation;
114
+
115
+ export function isTimeRangeAnnotation(annotation: Annotation): annotation is TimeRangeAnnotation {
116
+ return annotation.type === 'TIME_RANGE';
117
+ }
118
+
119
+ export function isEntryLabelAnnotation(annotation: Annotation): annotation is EntryLabelAnnotation {
120
+ return annotation.type === 'ENTRY_LABEL';
121
+ }
122
+
123
+ export function isEntriesLinkAnnotation(annotation: Annotation): annotation is EntriesLinkAnnotation {
124
+ return annotation.type === 'ENTRIES_LINK';
125
+ }
126
+
127
+ /**
128
+ * Serializable keys are created for trace events to be able to save
129
+ * references to timeline events in a trace file. These keys enable
130
+ * user modifications that can be saved. See go/cpq:event-data-json for
131
+ * more details on the key format.
132
+ **/
133
+ export type RawEventKey = `${EventKeyType.RAW_EVENT}-${number}`;
134
+ export type SyntheticEventKey = `${EventKeyType.SYNTHETIC_EVENT}-${number}`;
135
+ export type ProfileCallKey = `${EventKeyType.PROFILE_CALL}-${ProcessID}-${ThreadID}-${SampleIndex}-${Protocol.integer}`;
136
+ export type LegacyTimelineFrameKey = `${EventKeyType.LEGACY_TIMELINE_FRAME}-${number}`;
137
+ export type SerializableKey = RawEventKey|ProfileCallKey|SyntheticEventKey|LegacyTimelineFrameKey;
138
+
139
+ /** Serializable keys values objects contain data that maps the keys to original Trace Events **/
140
+ export interface RawEventKeyValues {
141
+ type: EventKeyType.RAW_EVENT;
142
+ rawIndex: number;
143
+ }
144
+
145
+ export interface SyntheticEventKeyValues {
146
+ type: EventKeyType.SYNTHETIC_EVENT;
147
+ rawIndex: number;
148
+ }
149
+
150
+ export interface ProfileCallKeyValues {
151
+ type: EventKeyType.PROFILE_CALL;
152
+ processID: ProcessID;
153
+ threadID: ThreadID;
154
+ sampleIndex: SampleIndex;
155
+ protocol: Protocol.integer;
156
+ }
157
+
158
+ export interface LegacyTimelineFrameKeyValues {
159
+ type: EventKeyType.LEGACY_TIMELINE_FRAME;
160
+ rawIndex: number;
161
+ }
162
+
163
+ export type SerializableKeyValues =
164
+ RawEventKeyValues|ProfileCallKeyValues|SyntheticEventKeyValues|LegacyTimelineFrameKeyValues;
165
+
166
+ export interface Modifications {
167
+ entriesModifications: {
168
+ // Entries hidden by the user
169
+ hiddenEntries: SerializableKey[],
170
+ // Entries that parent a hiddenEntry
171
+ expandableEntries: SerializableKey[],
172
+ };
173
+ initialBreadcrumb: Breadcrumb;
174
+ annotations: SerializedAnnotations;
175
+ }
176
+
177
+ /**
178
+ * IMPORTANT: this is the same as PerfUI.FlameChart.PersistedGroupConfig
179
+ * However, the PerfUI code should not depend on the model/trace, and similarly
180
+ * this model cannot depend on that code, so we duplicate it.
181
+ **/
182
+ export interface TrackVisualConfig {
183
+ hidden: boolean;
184
+ expanded: boolean;
185
+ originalIndex: number;
186
+ visualIndex: number;
187
+ trackName: string;
188
+ }
189
+
190
+ /**
191
+ * Stores the visual config if the user has modified it. Split into "main" and
192
+ * "network" so we can pass the relevant config into the right data provider.
193
+ * NOTE: as of August 2025 (M141) we currently do not export this in new
194
+ * traces, or use it if an existing trace is imported with it.
195
+ */
196
+ export interface PersistedTraceVisualConfig {
197
+ main: TrackVisualConfig[]|null;
198
+ network: TrackVisualConfig[]|null;
199
+ }
200
+
201
+ /**
202
+ * Trace metadata that we persist to the file. This will allow us to
203
+ * store specifics for the trace, e.g., which tracks should be visible
204
+ * on load.
205
+ */
206
+ export interface MetaData {
207
+ source?: 'DevTools';
208
+ startTime?: string;
209
+ emulatedDeviceTitle?: string;
210
+ // Only set if network throttling is active.
211
+ networkThrottling?: string;
212
+ // Only set if network throttling is active.
213
+ networkThrottlingConditions?: Omit<SDK.NetworkManager.Conditions, 'title'>;
214
+ // Only set if CPU throttling is active.
215
+ cpuThrottling?: number;
216
+ dataOrigin?: DataOrigin;
217
+ enhancedTraceVersion?: number;
218
+ modifications?: Modifications;
219
+ cruxFieldData?: CrUXManager.PageResult[];
220
+ /** Currently only stores JS maps, not CSS. This never stores data url source maps. */
221
+ sourceMaps?: MetadataSourceMap[];
222
+ visualTrackConfig?: PersistedTraceVisualConfig;
223
+ hostDPR?: number;
224
+ }
225
+
226
+ export interface MetadataSourceMap {
227
+ url: string;
228
+ /** If not defined, then this was a data url. */
229
+ sourceMapUrl?: string;
230
+ sourceMap: SDK.SourceMap.SourceMapV3;
231
+ }
232
+
233
+ export type Contents = TraceFile|Event[];
234
+
235
+ export function traceEventKeyToValues(key: SerializableKey): SerializableKeyValues {
236
+ const parts = key.split('-');
237
+ const type = parts[0];
238
+
239
+ switch (type) {
240
+ case EventKeyType.PROFILE_CALL:
241
+ if (parts.length !== 5 ||
242
+ !(parts.every((part, i) => i === 0 || typeof part === 'number' || !isNaN(parseInt(part, 10))))) {
243
+ throw new Error(`Invalid ProfileCallKey: ${key}`);
244
+ }
245
+ return {
246
+ type: parts[0],
247
+ processID: parseInt(parts[1], 10),
248
+ threadID: parseInt(parts[2], 10),
249
+ sampleIndex: parseInt(parts[3], 10),
250
+ protocol: parseInt(parts[4], 10),
251
+ } as ProfileCallKeyValues;
252
+ case EventKeyType.RAW_EVENT:
253
+ if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {
254
+ throw new Error(`Invalid RawEvent Key: ${key}`);
255
+ }
256
+ return {
257
+ type: parts[0],
258
+ rawIndex: parseInt(parts[1], 10),
259
+ } as RawEventKeyValues;
260
+ case EventKeyType.SYNTHETIC_EVENT:
261
+ if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {
262
+ throw new Error(`Invalid SyntheticEvent Key: ${key}`);
263
+ }
264
+ return {
265
+ type: parts[0],
266
+ rawIndex: parseInt(parts[1], 10),
267
+ } as SyntheticEventKeyValues;
268
+ case EventKeyType.LEGACY_TIMELINE_FRAME: {
269
+ if (parts.length !== 2 || Number.isNaN(parseInt(parts[1], 10))) {
270
+ throw new Error(`Invalid LegacyTimelineFrame Key: ${key}`);
271
+ }
272
+ return {
273
+ type,
274
+ rawIndex: parseInt(parts[1], 10),
275
+ };
276
+ }
277
+
278
+ default:
279
+ throw new Error(`Unknown trace event key: ${key}`);
280
+ }
281
+ }
@@ -0,0 +1,138 @@
1
+ // Copyright 2025 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import type {EntriesLinkState} from './File.js';
6
+ import type {Micro, TraceWindowMicro} from './Timing.js';
7
+ import type {Event, LegacyTimelineFrame, PageLoadEvent} from './TraceEvents.js';
8
+
9
+ /**
10
+ * Represents which flamechart an entry is rendered in.
11
+ * We need to know this because when we place an overlay for an entry we need
12
+ * to adjust its Y value if it's in the main chart which is drawn below the
13
+ * network chart
14
+ */
15
+ export type EntryChartLocation = 'main'|'network';
16
+
17
+ /**
18
+ * You can add overlays to trace events, but also right now frames are drawn on
19
+ * the timeline but they are not trace events, so we need to allow for that.
20
+ * In the future when the frames track has been migrated to be powered by
21
+ * animation frames (crbug.com/345144583), we can remove the requirement to
22
+ * support TimelineFrame instances (which themselves will be removed from the
23
+ * codebase.)
24
+ */
25
+ export type OverlayEntry = Event|LegacyTimelineFrame;
26
+
27
+ /**
28
+ * Represents when a user has selected an entry in the timeline
29
+ */
30
+ export interface EntrySelected {
31
+ type: 'ENTRY_SELECTED';
32
+ entry: OverlayEntry;
33
+ }
34
+
35
+ /**
36
+ * Drawn around an entry when we want to highlight it to the user.
37
+ */
38
+ export interface EntryOutline {
39
+ type: 'ENTRY_OUTLINE';
40
+ entry: OverlayEntry;
41
+ outlineReason: 'ERROR'|'INFO';
42
+ }
43
+
44
+ /**
45
+ * Represents an object created when a user creates a label for an entry in the timeline.
46
+ */
47
+ export interface EntryLabel {
48
+ type: 'ENTRY_LABEL';
49
+ entry: OverlayEntry;
50
+ label: string;
51
+ }
52
+
53
+ export interface EntriesLink {
54
+ type: 'ENTRIES_LINK';
55
+ state: EntriesLinkState;
56
+ entryFrom: OverlayEntry;
57
+ entryTo?: OverlayEntry;
58
+ }
59
+
60
+ /**
61
+ * Represents a time range on the trace. Also used when the user shift+clicks
62
+ * and drags to create a time range.
63
+ */
64
+ export interface TimeRangeLabel {
65
+ type: 'TIME_RANGE';
66
+ bounds: TraceWindowMicro;
67
+ label: string;
68
+ showDuration: boolean;
69
+ }
70
+
71
+ /**
72
+ * Used to highlight with a red-candy stripe a time range. It takes an entry
73
+ * because this entry is the row that will be used to place the candy stripe,
74
+ * and its height will be set to the height of that row.
75
+ */
76
+ export interface CandyStripedTimeRange {
77
+ type: 'CANDY_STRIPED_TIME_RANGE';
78
+ bounds: TraceWindowMicro;
79
+ entry: Event;
80
+ }
81
+
82
+ /**
83
+ * An EntryBreakdown, or section, that makes up a TimespanBreakdown.
84
+ */
85
+ export interface TimespanBreakdownEntryBreakdown {
86
+ bounds: TraceWindowMicro;
87
+ label: string|HTMLElement;
88
+ showDuration: boolean;
89
+ }
90
+
91
+ /**
92
+ * Represents a timespan on a trace broken down into parts. Each part has a label to it.
93
+ * If an entry is defined, the breakdown will be vertically positioned based on it.
94
+ */
95
+ export interface TimespanBreakdown {
96
+ type: 'TIMESPAN_BREAKDOWN';
97
+ sections: TimespanBreakdownEntryBreakdown[];
98
+ entry?: Event;
99
+ renderLocation?: 'BOTTOM_OF_TIMELINE'|'BELOW_EVENT'|'ABOVE_EVENT';
100
+ }
101
+
102
+ export interface TimestampMarker {
103
+ type: 'TIMESTAMP_MARKER';
104
+ timestamp: Micro;
105
+ }
106
+
107
+ /**
108
+ * Represents a timings marker. This has a line that runs up the whole canvas.
109
+ * We can hold an array of entries, in the case we want to hold more than one with the same timestamp.
110
+ * The adjusted timestamp being the timestamp for the event adjusted by closest navigation.
111
+ */
112
+ export interface TimingsMarker {
113
+ type: 'TIMINGS_MARKER';
114
+ entries: PageLoadEvent[];
115
+ entryToFieldResult: Map<PageLoadEvent, TimingsMarkerFieldResult>;
116
+ adjustedTimestamp: Micro;
117
+ }
118
+
119
+ export interface TimingsMarkerFieldResult {
120
+ value: Micro;
121
+ pageScope: 'url'|'origin';
122
+ }
123
+
124
+ export interface BottomInfoBar {
125
+ type: 'BOTTOM_INFO_BAR';
126
+ // In DevTools, this infobar is a UI.Infobar.Infobar but we can't refer to
127
+ // the type here.
128
+ infobar: {
129
+ element: HTMLElement,
130
+ dispose: () => void,
131
+ };
132
+ }
133
+
134
+ /**
135
+ * All supported overlay types.
136
+ */
137
+ export type Overlay = EntrySelected|EntryOutline|TimeRangeLabel|EntryLabel|EntriesLink|TimespanBreakdown|
138
+ TimestampMarker|CandyStripedTimeRange|TimingsMarker|BottomInfoBar;
@@ -0,0 +1,30 @@
1
+ // Copyright 2022 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ export type Micro = number&{_tag: 'MicroSeconds'};
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
+ export function Micro(value: number): Micro {
8
+ return value as Micro;
9
+ }
10
+
11
+ export type Milli = number&{_tag: 'MilliSeconds'};
12
+ // eslint-disable-next-line @typescript-eslint/naming-convention
13
+ export function Milli(value: number): Milli {
14
+ return value as Milli;
15
+ }
16
+ export type Seconds = number&{_tag: 'Seconds'};
17
+ // eslint-disable-next-line @typescript-eslint/naming-convention
18
+ export function Seconds(value: number): Seconds {
19
+ return value as Seconds;
20
+ }
21
+
22
+ export interface TraceWindow<TimeFormat extends Micro|Milli> {
23
+ min: TimeFormat;
24
+ max: TimeFormat;
25
+ range: TimeFormat;
26
+ }
27
+
28
+ /** See front_end/models/trace/helpers/Timing.ts for helpful utility functions like traceWindowFromMicroSeconds **/
29
+ export type TraceWindowMicro = TraceWindow<Micro>;
30
+ export type TraceWindowMilli = TraceWindow<Milli>;