chrome-devtools-frontend 1.0.1657855 → 1.0.1661063

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 (370) hide show
  1. package/.agents/skills/evaluate-ai-css-completion/SKILL.md +133 -0
  2. package/.agents/skills/evaluate-ai-css-completion/scripts/evaluate.js +76 -0
  3. package/.agents/skills/migrate-chromium-test/SKILL.md +15 -70
  4. package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +37 -18
  5. package/.agents/skills/version-control/SKILL.md +8 -1
  6. package/AUTHORS +1 -0
  7. package/SECURITY.md +3 -0
  8. package/docs/get_the_code.md +6 -0
  9. package/eslint.config.mjs +7 -0
  10. package/extension-api/ExtensionAPI.d.ts +88 -0
  11. package/front_end/Tests.js +6 -6
  12. package/front_end/core/common/Gzip.ts +12 -5
  13. package/front_end/core/host/AidaClient.ts +35 -9
  14. package/front_end/core/host/GdpClient.ts +10 -7
  15. package/front_end/core/host/InspectorFrontendHost.ts +1 -0
  16. package/front_end/core/host/InspectorFrontendHostStub.ts +2 -0
  17. package/front_end/core/platform/StringUtilities.ts +55 -4
  18. package/front_end/core/sdk/AccessibilityModel.snapshot.txt +17 -0
  19. package/front_end/core/sdk/AccessibilityModel.ts +132 -2
  20. package/front_end/core/sdk/CPUThrottlingManager.ts +10 -5
  21. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +2 -5
  22. package/front_end/core/sdk/ConsoleModel.ts +5 -5
  23. package/front_end/core/sdk/DOMDebuggerModel.ts +7 -1
  24. package/front_end/core/sdk/DOMModel.ts +33 -18
  25. package/front_end/core/sdk/DebuggerModel.ts +4 -4
  26. package/front_end/core/sdk/EventBreakpointsModel.ts +2 -0
  27. package/front_end/core/sdk/FrameManager.ts +1 -0
  28. package/front_end/core/sdk/IsolateManager.ts +1 -0
  29. package/front_end/core/sdk/NetworkManager.ts +59 -11
  30. package/front_end/core/sdk/NetworkRequest.ts +38 -1
  31. package/front_end/core/sdk/OverlayModel.ts +45 -6
  32. package/front_end/core/sdk/PageResourceLoader.ts +2 -0
  33. package/front_end/core/sdk/ResourceTreeModel.ts +6 -7
  34. package/front_end/core/sdk/ScreenCaptureModel.ts +2 -2
  35. package/front_end/core/sdk/ServerTiming.ts +17 -13
  36. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +4 -2
  37. package/front_end/core/sdk/ServiceWorkerManager.ts +19 -5
  38. package/front_end/core/sdk/SourceMap.ts +5 -5
  39. package/front_end/core/sdk/SourceMapManager.ts +3 -2
  40. package/front_end/core/sdk/TargetManager.ts +14 -1
  41. package/front_end/core/sdk/TraceObject.ts +4 -2
  42. package/front_end/core/sdk/sdk-meta.ts +170 -0
  43. package/front_end/design_system_tokens.css +0 -5
  44. package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +5 -2
  45. package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +26 -4
  46. package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +8 -3
  47. package/front_end/entrypoints/inspector_main/InspectorMain.ts +4 -4
  48. package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +2 -2
  49. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +36 -37
  50. package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +15 -33
  51. package/front_end/entrypoints/js_app/js_app.ts +6 -5
  52. package/front_end/entrypoints/main/GlobalAiButton.ts +4 -4
  53. package/front_end/entrypoints/main/MainImpl.ts +20 -22
  54. package/front_end/entrypoints/main/main-meta.ts +42 -42
  55. package/front_end/entrypoints/node_app/node_app.ts +3 -2
  56. package/front_end/entrypoints/worker_app/WorkerMain.ts +1 -1
  57. package/front_end/foundation/Universe.ts +44 -1
  58. package/front_end/generated/InspectorBackendCommands.ts +2 -2
  59. package/front_end/generated/SupportedCSSProperties.js +19 -12
  60. package/front_end/generated/protocol.ts +3 -1
  61. package/front_end/models/ai_assistance/AiConversation.ts +19 -17
  62. package/front_end/models/ai_assistance/AiHistoryStorage.ts +37 -14
  63. package/front_end/models/ai_assistance/AiUtils.ts +38 -42
  64. package/front_end/models/ai_assistance/agents/AiAgent.ts +5 -1
  65. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +3 -2
  66. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +2 -1
  67. package/front_end/models/ai_assistance/agents/StorageAgent.ts +7 -5
  68. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +270 -286
  69. package/front_end/models/ai_assistance/data_formatters/UnitFormatters.ts +20 -0
  70. package/front_end/models/ai_assistance/performance/AICallTree.ts +3 -1
  71. package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +3 -2
  72. package/front_end/models/autofill_manager/AutofillManager.ts +3 -1
  73. package/front_end/models/bindings/CompilerScriptMapping.ts +7 -7
  74. package/front_end/models/bindings/ContentProviderBasedProject.ts +4 -4
  75. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +5 -5
  76. package/front_end/models/bindings/DefaultScriptMapping.ts +3 -3
  77. package/front_end/models/bindings/NetworkProject.ts +5 -10
  78. package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +2 -1
  79. package/front_end/models/bindings/ResourceMapping.ts +3 -4
  80. package/front_end/models/bindings/ResourceScriptMapping.ts +2 -3
  81. package/front_end/models/bindings/ResourceUtils.ts +1 -1
  82. package/front_end/models/bindings/SASSSourceMapping.ts +11 -9
  83. package/front_end/models/bindings/StylesSourceMapping.ts +3 -3
  84. package/front_end/models/bindings/TempFile.ts +8 -3
  85. package/front_end/models/emulation/EmulatedDevices.ts +389 -8
  86. package/front_end/models/extensions/ExtensionAPI.ts +116 -52
  87. package/front_end/models/extensions/LanguageExtensionEndpoint.ts +13 -12
  88. package/front_end/models/formatter/ScriptFormatter.ts +8 -11
  89. package/front_end/models/issues_manager/BounceTrackingIssue.ts +1 -1
  90. package/front_end/models/issues_manager/ClientHintIssue.ts +1 -1
  91. package/front_end/models/issues_manager/ConnectionAllowlistIssue.ts +1 -1
  92. package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +7 -7
  93. package/front_end/models/issues_manager/CookieDeprecationMetadataIssue.ts +2 -2
  94. package/front_end/models/issues_manager/CookieIssue.ts +27 -16
  95. package/front_end/models/issues_manager/CorsIssue.ts +3 -3
  96. package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +2 -2
  97. package/front_end/models/issues_manager/DeprecationIssue.ts +3 -3
  98. package/front_end/models/issues_manager/EmailVerificationRequestIssue.ts +1 -1
  99. package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +1 -1
  100. package/front_end/models/issues_manager/FederatedAuthUserInfoRequestIssue.ts +1 -1
  101. package/front_end/models/issues_manager/GenericIssue.ts +7 -7
  102. package/front_end/models/issues_manager/HeavyAdIssue.ts +3 -3
  103. package/front_end/models/issues_manager/Issue.ts +11 -12
  104. package/front_end/models/issues_manager/IssueAggregator.ts +0 -9
  105. package/front_end/models/issues_manager/IssueResolver.ts +2 -2
  106. package/front_end/models/issues_manager/IssuesManager.ts +136 -137
  107. package/front_end/models/issues_manager/MixedContentIssue.ts +1 -1
  108. package/front_end/models/issues_manager/PartitioningBlobURLIssue.ts +3 -3
  109. package/front_end/models/issues_manager/QuirksModeIssue.ts +1 -1
  110. package/front_end/models/issues_manager/SRIMessageSignatureIssue.ts +2 -2
  111. package/front_end/models/issues_manager/SelectivePermissionsInterventionIssue.ts +2 -2
  112. package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +2 -2
  113. package/front_end/models/issues_manager/SharedDictionaryIssue.ts +1 -1
  114. package/front_end/models/issues_manager/UnencodedDigestIssue.ts +3 -3
  115. package/front_end/models/issues_manager/issues_manager.ts +0 -2
  116. package/front_end/models/javascript_metadata/NativeFunctions.js +5 -1
  117. package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +5 -0
  118. package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +13 -10
  119. package/front_end/models/stack_trace/StackTraceModel.ts +3 -3
  120. package/front_end/models/text_utils/ContentData.ts +27 -0
  121. package/front_end/models/trace/helpers/SamplesIntegrator.ts +21 -5
  122. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +29 -14
  123. package/front_end/models/web_mcp/WebMCPModel.ts +24 -6
  124. package/front_end/models/workspace/IgnoreListManager.ts +6 -6
  125. package/front_end/models/workspace/UISourceCode.ts +3 -3
  126. package/front_end/models/workspace/WorkspaceImpl.ts +10 -1
  127. package/front_end/models/workspace_diff/WorkspaceDiff.ts +10 -4
  128. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +25 -22
  129. package/front_end/panels/ai_assistance/ExportConversation.ts +3 -4
  130. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +3 -3
  131. package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
  132. package/front_end/panels/ai_assistance/components/ChatMessage.ts +9 -1
  133. package/front_end/panels/ai_assistance/components/DisabledWidget.ts +2 -2
  134. package/front_end/panels/animation/AnimationTimeline.ts +17 -19
  135. package/front_end/panels/animation/AnimationUI.ts +5 -5
  136. package/front_end/panels/animation/animation-meta.ts +2 -2
  137. package/front_end/panels/application/ApplicationPanelSidebar.ts +4 -3
  138. package/front_end/panels/application/DeviceBoundSessionsView.ts +2 -6
  139. package/front_end/panels/application/FrameDetailsView.ts +1 -1
  140. package/front_end/panels/application/IndexedDBViews.ts +220 -266
  141. package/front_end/panels/application/OpenedWindowDetailsView.ts +1 -1
  142. package/front_end/panels/application/ResourcesPanel.ts +9 -2
  143. package/front_end/panels/application/ServiceWorkersView.ts +252 -211
  144. package/front_end/panels/application/StorageView.ts +97 -33
  145. package/front_end/panels/application/WebMCPView.ts +53 -44
  146. package/front_end/panels/application/components/AdsView.ts +201 -30
  147. package/front_end/panels/application/components/adsView.css +25 -0
  148. package/front_end/panels/application/indexedDBViews.css +38 -9
  149. package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +2 -2
  150. package/front_end/panels/application/preloading/helper/PreloadingForward.ts +2 -1
  151. package/front_end/panels/application/storageView.css +26 -9
  152. package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +5 -1
  153. package/front_end/panels/browser_debugger/browser_debugger-meta.ts +8 -6
  154. package/front_end/panels/common/DOMLinkifier.ts +1 -1
  155. package/front_end/panels/common/ExtensionServer.ts +119 -14
  156. package/front_end/panels/console/ConsoleContextSelector.ts +1 -1
  157. package/front_end/panels/console/ConsolePinPane.ts +2 -2
  158. package/front_end/panels/console/ConsolePrompt.ts +2 -2
  159. package/front_end/panels/console/ConsoleView.ts +3 -2
  160. package/front_end/panels/console/PromptBuilder.ts +2 -1
  161. package/front_end/panels/console/SymbolizedErrorWidget.ts +2 -1
  162. package/front_end/panels/console_counters/WarningErrorCounter.ts +2 -2
  163. package/front_end/panels/coverage/CoverageListView.ts +28 -28
  164. package/front_end/panels/coverage/CoverageModel.ts +2 -1
  165. package/front_end/panels/coverage/CoverageView.ts +22 -22
  166. package/front_end/panels/coverage/coverage-meta.ts +5 -5
  167. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +36 -36
  168. package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +1 -1
  169. package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +2 -2
  170. package/front_end/panels/css_overview/CSSOverviewStartView.ts +6 -6
  171. package/front_end/panels/css_overview/CSSOverviewUnusedDeclarations.ts +6 -6
  172. package/front_end/panels/css_overview/css_overview-meta.ts +2 -2
  173. package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +1 -1
  174. package/front_end/panels/elements/AccessibilityTreeUtils.ts +8 -102
  175. package/front_end/panels/elements/AccessibilityTreeView.ts +163 -70
  176. package/front_end/panels/elements/ElementsPanel.ts +17 -11
  177. package/front_end/panels/elements/ElementsTreeElement.ts +4 -1
  178. package/front_end/panels/elements/ElementsTreeOutline.ts +4 -4
  179. package/front_end/panels/elements/LayoutPane.ts +1 -1
  180. package/front_end/panels/elements/MetricsSidebarPane.ts +100 -34
  181. package/front_end/panels/elements/StylePropertiesSection.ts +2 -2
  182. package/front_end/panels/elements/StylePropertyTreeElement.ts +8 -2
  183. package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
  184. package/front_end/panels/elements/components/AccessibilityTreeNode.ts +7 -18
  185. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +2 -2
  186. package/front_end/panels/elements/components/QueryContainer.ts +1 -1
  187. package/front_end/panels/emulation/DeviceModeView.ts +52 -70
  188. package/front_end/panels/issues/AffectedDirectivesView.ts +1 -1
  189. package/front_end/panels/issues/AffectedResourcesView.ts +2 -1
  190. package/front_end/panels/issues/IssueView.ts +0 -2
  191. package/front_end/panels/issues/IssuesPane.ts +1 -8
  192. package/front_end/panels/js_timeline/js_timeline-meta.ts +3 -2
  193. package/front_end/panels/layer_viewer/LayerViewHost.ts +1 -1
  194. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +3 -3
  195. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +5 -5
  196. package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +4 -4
  197. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +2 -2
  198. package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +6 -6
  199. package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +3 -3
  200. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +8 -9
  201. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplayUtils.ts +2 -2
  202. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +1 -1
  203. package/front_end/panels/linear_memory_inspector/linear_memory_inspector-meta.ts +2 -2
  204. package/front_end/panels/network/NetworkDataGridNode.ts +124 -36
  205. package/front_end/panels/network/NetworkLogView.ts +9 -1
  206. package/front_end/panels/network/NetworkLogViewColumns.ts +18 -0
  207. package/front_end/panels/network/NetworkPanel.ts +2 -1
  208. package/front_end/panels/network/RequestPayloadView.ts +68 -20
  209. package/front_end/panels/network/RequestPreviewView.ts +7 -1
  210. package/front_end/panels/network/RequestTimingView.ts +95 -127
  211. package/front_end/panels/network/components/ResponseHeaderSection.ts +1 -1
  212. package/front_end/panels/network/forward/UIFilter.ts +1 -0
  213. package/front_end/panels/network/requestPayloadView.css +10 -0
  214. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +12 -12
  215. package/front_end/panels/performance_monitor/performance_monitor-meta.ts +7 -7
  216. package/front_end/panels/profiler/HeapDetachedElementsView.ts +2 -2
  217. package/front_end/panels/profiler/HeapProfileView.ts +563 -51
  218. package/front_end/panels/profiler/HeapSnapshotView.ts +14 -9
  219. package/front_end/panels/profiler/ProfilesPanel.ts +13 -7
  220. package/front_end/panels/profiler/WritableProfileHeader.ts +152 -0
  221. package/front_end/panels/profiler/profiler.ts +2 -2
  222. package/front_end/panels/recorder/{components/ControlButton.ts → ControlButton.ts} +9 -10
  223. package/front_end/panels/recorder/{components/CreateRecordingView.ts → CreateRecordingView.ts} +59 -58
  224. package/front_end/panels/recorder/ExtensionView.ts +123 -0
  225. package/front_end/panels/recorder/RecorderController.ts +102 -92
  226. package/front_end/panels/recorder/{components/RecordingListView.ts → RecordingListView.ts} +22 -23
  227. package/front_end/panels/recorder/{components/RecordingView.ts → RecordingView.ts} +99 -96
  228. package/front_end/panels/recorder/{components/ReplaySection.ts → ReplaySection.ts} +20 -20
  229. package/front_end/panels/recorder/{components/SelectorPicker.ts → SelectorPicker.ts} +13 -13
  230. package/front_end/panels/recorder/{components/StepEditor.ts → StepEditor.ts} +367 -336
  231. package/front_end/panels/recorder/{components/StepView.ts → StepView.ts} +48 -49
  232. package/front_end/panels/recorder/{components/TimelineSection.ts → TimelineSection.ts} +2 -2
  233. package/front_end/panels/recorder/models/RecorderSettings.ts +2 -2
  234. package/front_end/panels/recorder/recorder-meta.ts +7 -7
  235. package/front_end/panels/recorder/recorder.ts +23 -1
  236. package/front_end/panels/recorder/{components/recordingView.css → recordingView.css} +1 -1
  237. package/front_end/panels/recorder/util/util.ts +113 -0
  238. package/front_end/panels/screencast/ScreencastApp.ts +1 -1
  239. package/front_end/panels/screencast/ScreencastView.ts +12 -12
  240. package/front_end/panels/search/SearchResultsPane.ts +4 -4
  241. package/front_end/panels/search/SearchView.ts +20 -20
  242. package/front_end/panels/security/SecurityModel.ts +7 -7
  243. package/front_end/panels/security/SecurityPanel.ts +99 -107
  244. package/front_end/panels/security/SecurityPanelSidebar.ts +7 -7
  245. package/front_end/panels/security/security-meta.ts +2 -2
  246. package/front_end/panels/sensors/LocationsSettingsTab.ts +19 -19
  247. package/front_end/panels/sensors/SensorsView.ts +27 -27
  248. package/front_end/panels/sensors/sensors-meta.ts +13 -167
  249. package/front_end/panels/settings/AISettingsTab.ts +98 -56
  250. package/front_end/panels/settings/EditFileSystemView.ts +2 -2
  251. package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +20 -20
  252. package/front_end/panels/settings/KeybindsSettingsTab.ts +20 -21
  253. package/front_end/panels/settings/SettingsScreen.ts +11 -11
  254. package/front_end/panels/settings/WorkspaceSettingsTab.ts +5 -5
  255. package/front_end/panels/settings/components/SyncSection.ts +12 -12
  256. package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +13 -13
  257. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +31 -31
  258. package/front_end/panels/settings/emulation/emulation-meta.ts +1 -1
  259. package/front_end/panels/settings/settings-meta.ts +14 -14
  260. package/front_end/panels/sources/InplaceFormatterEditorAction.ts +2 -2
  261. package/front_end/panels/sources/NavigatorView.ts +7 -6
  262. package/front_end/panels/sources/ScopeChainSidebarPane.ts +83 -37
  263. package/front_end/panels/sources/SourcesNavigator.ts +22 -21
  264. package/front_end/panels/sources/SourcesView.ts +10 -1
  265. package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
  266. package/front_end/panels/sources/scopeChainSidebarPane.css +12 -4
  267. package/front_end/panels/sources/sources-meta.ts +4 -4
  268. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +5 -2
  269. package/front_end/panels/timeline/IsolateSelector.ts +10 -8
  270. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +2 -1
  271. package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +2 -1
  272. package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
  273. package/front_end/panels/timeline/TimelinePanel.ts +20 -8
  274. package/front_end/panels/timeline/TimelineUIUtils.ts +149 -131
  275. package/front_end/panels/timeline/components/NetworkRequestDetails.ts +4 -2
  276. package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +4 -2
  277. package/front_end/panels/timeline/components/insights/ImageRef.ts +2 -1
  278. package/front_end/panels/timeline/timeline-meta.ts +3 -2
  279. package/front_end/panels/utils/utils.ts +7 -3
  280. package/front_end/panels/web_audio/WebAudioView.ts +17 -18
  281. package/front_end/panels/web_audio/web_audio-meta.ts +3 -3
  282. package/front_end/panels/whats_new/ReleaseNoteView.ts +1 -1
  283. package/front_end/panels/whats_new/whats_new-meta.ts +11 -11
  284. package/front_end/third_party/chromium/README.chromium +1 -1
  285. package/front_end/third_party/lit/lib/async-directive.d.ts +2 -1
  286. package/front_end/third_party/lit/lib/async-directive.js +1 -1
  287. package/front_end/third_party/lit/lib/async-directive.js.map +1 -1
  288. package/front_end/third_party/lit/lib/decorators.d.ts +2 -1
  289. package/front_end/third_party/lit/lib/decorators.js.map +1 -1
  290. package/front_end/third_party/lit/lib/directive.d.ts +2 -1
  291. package/front_end/third_party/lit/lib/directive.js.map +1 -1
  292. package/front_end/third_party/lit/lib/directives.d.ts +2 -1
  293. package/front_end/third_party/lit/lib/directives.js +8 -8
  294. package/front_end/third_party/lit/lib/directives.js.map +1 -1
  295. package/front_end/third_party/lit/lib/lit.d.ts +2 -1
  296. package/front_end/third_party/lit/lib/lit.js +1 -1
  297. package/front_end/third_party/lit/lib/lit.js.map +1 -1
  298. package/front_end/third_party/lit/lib/static-html.d.ts +2 -1
  299. package/front_end/third_party/lit/lib/static-html.js +1 -1
  300. package/front_end/third_party/lit/lib/static-html.js.map +1 -1
  301. package/front_end/third_party/lit/package.json +2 -2
  302. package/front_end/third_party/lit/rebuild.sh +1 -1
  303. package/front_end/third_party/lit/src/async-directive.ts +5 -0
  304. package/front_end/ui/components/dialogs/Dialog.ts +1 -1
  305. package/front_end/ui/components/dialogs/ShortcutDialog.ts +1 -1
  306. package/front_end/ui/components/diff_view/DiffView.ts +2 -2
  307. package/front_end/ui/components/issue_counter/IssueCounter.ts +3 -3
  308. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +5 -5
  309. package/front_end/ui/components/lists/List.ts +2 -2
  310. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
  311. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +5 -5
  312. package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
  313. package/front_end/ui/components/snackbars/Snackbar.ts +1 -1
  314. package/front_end/ui/components/survey_link/SurveyLink.ts +3 -3
  315. package/front_end/ui/components/text_editor/config.ts +2 -2
  316. package/front_end/ui/components/tree_outline/TreeOutline.ts +34 -1
  317. package/front_end/ui/legacy/ReportView.ts +5 -0
  318. package/front_end/ui/legacy/Treeoutline.ts +6 -0
  319. package/front_end/ui/legacy/View.ts +1 -1
  320. package/front_end/ui/legacy/Widget.ts +14 -15
  321. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +2 -0
  322. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +8 -3
  323. package/front_end/ui/legacy/components/data_grid/data_grid.ts +1 -0
  324. package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +1 -1
  325. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +106 -38
  326. package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +7 -1
  327. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -1
  328. package/front_end/ui/legacy/components/utils/ImagePreview.ts +4 -2
  329. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +10 -1
  330. package/front_end/ui/legacy/inspectorCommon.css +5 -0
  331. package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
  332. package/mcp/mcp.ts +2 -0
  333. package/package.json +4 -4
  334. package/front_end/models/issues_manager/AttributionReportingIssue.ts +0 -247
  335. package/front_end/models/issues_manager/descriptions/arInsecureContext.md +0 -7
  336. package/front_end/models/issues_manager/descriptions/arInvalidInfoHeader.md +0 -5
  337. package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsSourceHeader.md +0 -5
  338. package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsTriggerHeader.md +0 -5
  339. package/front_end/models/issues_manager/descriptions/arInvalidRegisterSourceHeader.md +0 -5
  340. package/front_end/models/issues_manager/descriptions/arInvalidRegisterTriggerHeader.md +0 -5
  341. package/front_end/models/issues_manager/descriptions/arNavigationRegistrationUniqueScopeAlreadySet.md +0 -5
  342. package/front_end/models/issues_manager/descriptions/arNavigationRegistrationWithoutTransientUserActivation.md +0 -6
  343. package/front_end/models/issues_manager/descriptions/arNoRegisterOsSourceHeader.md +0 -5
  344. package/front_end/models/issues_manager/descriptions/arNoRegisterOsTriggerHeader.md +0 -5
  345. package/front_end/models/issues_manager/descriptions/arNoRegisterSourceHeader.md +0 -5
  346. package/front_end/models/issues_manager/descriptions/arNoRegisterTriggerHeader.md +0 -5
  347. package/front_end/models/issues_manager/descriptions/arNoWebOrOsSupport.md +0 -4
  348. package/front_end/models/issues_manager/descriptions/arOsSourceIgnored.md +0 -18
  349. package/front_end/models/issues_manager/descriptions/arOsTriggerIgnored.md +0 -19
  350. package/front_end/models/issues_manager/descriptions/arPermissionPolicyDisabled.md +0 -8
  351. package/front_end/models/issues_manager/descriptions/arSourceAndTriggerHeaders.md +0 -9
  352. package/front_end/models/issues_manager/descriptions/arSourceIgnored.md +0 -13
  353. package/front_end/models/issues_manager/descriptions/arTriggerIgnored.md +0 -12
  354. package/front_end/models/issues_manager/descriptions/arUntrustworthyReportingOrigin.md +0 -10
  355. package/front_end/models/issues_manager/descriptions/arWebAndOsHeaders.md +0 -11
  356. package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +0 -182
  357. package/front_end/panels/profiler/ProfileView.ts +0 -611
  358. package/front_end/panels/recorder/components/ExtensionView.ts +0 -132
  359. package/front_end/panels/recorder/components/components.ts +0 -25
  360. package/front_end/panels/recorder/components/util.ts +0 -116
  361. /package/front_end/panels/recorder/{components/controlButton.css → controlButton.css} +0 -0
  362. /package/front_end/panels/recorder/{components/createRecordingView.css → createRecordingView.css} +0 -0
  363. /package/front_end/panels/recorder/{components/extensionView.css → extensionView.css} +0 -0
  364. /package/front_end/panels/recorder/{components/recordingListView.css → recordingListView.css} +0 -0
  365. /package/front_end/panels/recorder/{components/replaySection.css → replaySection.css} +0 -0
  366. /package/front_end/panels/recorder/{components/selectorPicker.css → selectorPicker.css} +0 -0
  367. /package/front_end/panels/recorder/{components/startView.css → startView.css} +0 -0
  368. /package/front_end/panels/recorder/{components/stepEditor.css → stepEditor.css} +0 -0
  369. /package/front_end/panels/recorder/{components/stepView.css → stepView.css} +0 -0
  370. /package/front_end/panels/recorder/{components/timelineSection.css → timelineSection.css} +0 -0
@@ -1,611 +0,0 @@
1
- // Copyright 2016 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
- /* eslint-disable @devtools/no-imperative-dom-api */
5
-
6
- import * as Common from '../../core/common/common.js';
7
- import * as Host from '../../core/host/host.js';
8
- import * as i18n from '../../core/i18n/i18n.js';
9
- import * as Platform from '../../core/platform/platform.js';
10
- import type * as SDK from '../../core/sdk/sdk.js';
11
- import type * as Protocol from '../../generated/protocol.js';
12
- import * as Bindings from '../../models/bindings/bindings.js';
13
- import type * as CPUProfile from '../../models/cpu_profile/cpu_profile.js';
14
- import * as Workspace from '../../models/workspace/workspace.js';
15
- import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
16
- import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';
17
- import * as Components from '../../ui/legacy/components/utils/utils.js';
18
- import * as UI from '../../ui/legacy/legacy.js';
19
-
20
- import {BottomUpProfileDataGridTree} from './BottomUpProfileDataGrid.js';
21
- import {type Formatter, type ProfileDataGridNode, ProfileDataGridTree} from './ProfileDataGrid.js';
22
- import {ProfileFlameChart, type ProfileFlameChartDataProvider} from './ProfileFlameChartDataProvider.js';
23
- import {ProfileHeader, type ProfileType} from './ProfileHeader.js';
24
- import {TopDownProfileDataGridTree} from './TopDownProfileDataGrid.js';
25
-
26
- const UIStrings = {
27
- /**
28
- * @description Text in Profile View of a profiler tool
29
- */
30
- profile: 'Profile',
31
- /**
32
- * @description Placeholder text in the search box of the JavaScript profiler tool. Users can search
33
- *the results by the cost in milliseconds, the name of the function, or the file name.
34
- */
35
- findByCostMsNameOrFile: 'Find by cost (>50ms), name or file',
36
- /**
37
- * @description Text for a programming function
38
- */
39
- function: 'Function',
40
- /**
41
- * @description Title of the Profiler tool
42
- */
43
- profiler: 'Profiler',
44
- /**
45
- * @description Aria-label for profiles view combobox in memory tool
46
- */
47
- profileViewMode: 'Profile view mode',
48
- /**
49
- * @description Tooltip text that appears when hovering over the largeicon visibility button in the Profile View of a profiler tool
50
- */
51
- focusSelectedFunction: 'Focus selected function',
52
- /**
53
- * @description Tooltip text that appears when hovering over the largeicon delete button in the Profile View of a profiler tool
54
- */
55
- excludeSelectedFunction: 'Exclude selected function',
56
- /**
57
- * @description Tooltip text that appears when hovering over the largeicon refresh button in the Profile View of a profiler tool
58
- */
59
- restoreAllFunctions: 'Restore all functions',
60
- /**
61
- * @description Text in Profile View of a profiler tool
62
- */
63
- chart: 'Chart',
64
- /**
65
- * @description Text in Profile View of a profiler tool
66
- */
67
- heavyBottomUp: 'Heavy (Bottom Up)',
68
- /**
69
- * @description Text for selecting different profile views in the JS profiler tool. This option is a tree view.
70
- */
71
- treeTopDown: 'Tree (Top Down)',
72
- /**
73
- * @description Name of a profile
74
- * @example {2} PH1
75
- */
76
- profileD: 'Profile {PH1}',
77
- /**
78
- * @description Text in Profile View of a profiler tool
79
- * @example {4 MB} PH1
80
- */
81
- loadingD: 'Loading… {PH1}%',
82
- /**
83
- * @description Text in Profile View of a profiler tool
84
- * @example {example.file} PH1
85
- * @example {cannot open file} PH2
86
- */
87
- fileSReadErrorS: 'File \'\'{PH1}\'\' read error: {PH2}',
88
- /**
89
- * @description Text when something is loading
90
- */
91
- loading: 'Loading…',
92
- /**
93
- * @description Text in Profile View of a profiler tool
94
- */
95
- failedToReadFile: 'Failed to read file',
96
- /**
97
- * @description Text in Profile View of a profiler tool
98
- */
99
- parsing: 'Parsing…',
100
- /**
101
- * @description Status indicator in the JS Profiler to show that a file has been successfully loaded
102
- * from file, as opposed to a profile that has been captured locally.
103
- */
104
- loaded: 'Loaded',
105
- } as const;
106
- const str_ = i18n.i18n.registerUIStrings('panels/profiler/ProfileView.ts', UIStrings);
107
- const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
108
- export class ProfileView extends UI.View.SimpleView implements UI.SearchableView.Searchable {
109
- profileInternal: CPUProfile.ProfileTreeModel.ProfileTreeModel|null;
110
- searchableViewInternal: UI.SearchableView.SearchableView;
111
- dataGrid: DataGrid.DataGrid.DataGridImpl<unknown>;
112
- viewSelectComboBox: UI.Toolbar.ToolbarComboBox;
113
- focusButton: UI.Toolbar.ToolbarButton;
114
- excludeButton: UI.Toolbar.ToolbarButton;
115
- resetButton: UI.Toolbar.ToolbarButton;
116
- readonly linkifierInternal: Components.Linkifier.Linkifier;
117
- nodeFormatter!: Formatter;
118
- viewType!: Common.Settings.Setting<ViewTypes>;
119
- adjustedTotal!: number;
120
- profileHeader!: WritableProfileHeader;
121
- bottomUpProfileDataGridTree?: BottomUpProfileDataGridTree|null;
122
- topDownProfileDataGridTree?: TopDownProfileDataGridTree|null;
123
- currentSearchResultIndex?: number;
124
- dataProvider?: ProfileFlameChartDataProvider;
125
- flameChart?: ProfileFlameChart;
126
- visibleView?: ProfileFlameChart|DataGrid.DataGrid.DataGridWidget<unknown>;
127
- searchableElement?: ProfileDataGridTree|ProfileFlameChart;
128
- profileDataGridTree?: ProfileDataGridTree;
129
- constructor() {
130
- super({
131
- title: i18nString(UIStrings.profile),
132
- viewId: 'profile',
133
- });
134
-
135
- this.profileInternal = null;
136
-
137
- this.searchableViewInternal = new UI.SearchableView.SearchableView(this, null);
138
- this.searchableViewInternal.setPlaceholder(i18nString(UIStrings.findByCostMsNameOrFile));
139
- this.searchableViewInternal.show(this.element);
140
-
141
- const columns: DataGrid.DataGrid.ColumnDescriptor[] = [];
142
- columns.push({
143
- id: 'self',
144
- title: this.columnHeader('self'),
145
- width: '120px',
146
- fixedWidth: true,
147
- sortable: true,
148
- sort: DataGrid.DataGrid.Order.Descending,
149
- });
150
- columns.push({
151
- id: 'total',
152
- title: this.columnHeader('total'),
153
- width: '120px',
154
- fixedWidth: true,
155
- sortable: true,
156
- });
157
- columns.push({
158
- id: 'function',
159
- title: i18nString(UIStrings.function),
160
- disclosure: true,
161
- sortable: true,
162
- });
163
-
164
- this.dataGrid = new DataGrid.DataGrid.DataGridImpl({
165
- displayName: i18nString(UIStrings.profiler),
166
- columns,
167
- });
168
- this.dataGrid.addEventListener(DataGrid.DataGrid.Events.SORTING_CHANGED, this.sortProfile, this);
169
- this.dataGrid.addEventListener(DataGrid.DataGrid.Events.SELECTED_NODE, this.nodeSelected.bind(this, true));
170
- this.dataGrid.addEventListener(DataGrid.DataGrid.Events.DESELECTED_NODE, this.nodeSelected.bind(this, false));
171
- this.dataGrid.setRowContextMenuCallback(this.populateContextMenu.bind(this));
172
-
173
- this.viewSelectComboBox = new UI.Toolbar.ToolbarComboBox(
174
- this.changeView.bind(this), i18nString(UIStrings.profileViewMode), undefined, 'profile-view.selected-view');
175
-
176
- this.focusButton = new UI.Toolbar.ToolbarButton(
177
- i18nString(UIStrings.focusSelectedFunction), 'eye', undefined, 'profile-view.focus-selected-function');
178
- this.focusButton.setEnabled(false);
179
- this.focusButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, this.focusClicked, this);
180
-
181
- this.excludeButton = new UI.Toolbar.ToolbarButton(
182
- i18nString(UIStrings.excludeSelectedFunction), 'cross', undefined, 'profile-view.exclude-selected-function');
183
- this.excludeButton.setEnabled(false);
184
- this.excludeButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, this.excludeClicked, this);
185
-
186
- this.resetButton = new UI.Toolbar.ToolbarButton(
187
- i18nString(UIStrings.restoreAllFunctions), 'refresh', undefined, 'profile-view.restore-all-functions');
188
- this.resetButton.setEnabled(false);
189
- this.resetButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, this.resetClicked, this);
190
-
191
- this.linkifierInternal = new Components.Linkifier.Linkifier(maxLinkLength);
192
- }
193
-
194
- static buildPopoverTable(popoverInfo: Array<{
195
- title: string,
196
- value: string,
197
- }>): Element {
198
- const table = document.createElement('table');
199
- for (const entry of popoverInfo) {
200
- const row = table.createChild('tr');
201
- row.createChild('td').textContent = entry.title;
202
- row.createChild('td').textContent = entry.value;
203
- }
204
- return table;
205
- }
206
-
207
- setProfile(profile: CPUProfile.ProfileTreeModel.ProfileTreeModel): void {
208
- this.profileInternal = profile;
209
- this.bottomUpProfileDataGridTree = null;
210
- this.topDownProfileDataGridTree = null;
211
- this.changeView();
212
- this.refresh();
213
- }
214
-
215
- profile(): CPUProfile.ProfileTreeModel.ProfileTreeModel|null {
216
- return this.profileInternal;
217
- }
218
-
219
- initialize(nodeFormatter: Formatter): void {
220
- this.nodeFormatter = nodeFormatter;
221
-
222
- this.viewType = Common.Settings.Settings.instance().createSetting('profile-view', ViewTypes.HEAVY);
223
- const viewTypes = [ViewTypes.FLAME, ViewTypes.HEAVY, ViewTypes.TREE];
224
-
225
- const optionNames = new Map([
226
- [ViewTypes.FLAME, i18nString(UIStrings.chart)],
227
- [ViewTypes.HEAVY, i18nString(UIStrings.heavyBottomUp)],
228
- [ViewTypes.TREE, i18nString(UIStrings.treeTopDown)],
229
- ]);
230
-
231
- const options = new Map(
232
- viewTypes.map(type => [type, this.viewSelectComboBox.createOption((optionNames.get(type) as string), type)]));
233
- const optionName = this.viewType.get() || viewTypes[0];
234
- const option = options.get(optionName) || options.get(viewTypes[0]);
235
- this.viewSelectComboBox.select((option as Element));
236
-
237
- this.changeView();
238
- if (this.flameChart) {
239
- this.flameChart.update();
240
- }
241
- }
242
-
243
- override focus(): void {
244
- if (this.flameChart) {
245
- this.flameChart.focus();
246
- } else {
247
- super.focus();
248
- }
249
- }
250
-
251
- columnHeader(_columnId: string): Common.UIString.LocalizedString {
252
- throw new Error('Not implemented');
253
- }
254
-
255
- selectRange(timeLeft: number, timeRight: number): void {
256
- if (!this.flameChart) {
257
- return;
258
- }
259
- this.flameChart.selectRange(timeLeft, timeRight);
260
- }
261
-
262
- override async toolbarItems(): Promise<UI.Toolbar.ToolbarItem[]> {
263
- return [this.viewSelectComboBox, this.focusButton, this.excludeButton, this.resetButton];
264
- }
265
-
266
- getBottomUpProfileDataGridTree(): ProfileDataGridTree {
267
- if (!this.bottomUpProfileDataGridTree) {
268
- this.bottomUpProfileDataGridTree = new BottomUpProfileDataGridTree(
269
- this.nodeFormatter, this.searchableViewInternal,
270
- (this.profileInternal as CPUProfile.ProfileTreeModel.ProfileTreeModel).root, this.adjustedTotal);
271
- }
272
- return this.bottomUpProfileDataGridTree;
273
- }
274
-
275
- getTopDownProfileDataGridTree(): ProfileDataGridTree {
276
- if (!this.topDownProfileDataGridTree) {
277
- this.topDownProfileDataGridTree = new TopDownProfileDataGridTree(
278
- this.nodeFormatter, this.searchableViewInternal,
279
- (this.profileInternal as CPUProfile.ProfileTreeModel.ProfileTreeModel).root, this.adjustedTotal);
280
- }
281
- return this.topDownProfileDataGridTree;
282
- }
283
-
284
- populateContextMenu(contextMenu: UI.ContextMenu.ContextMenu, gridNode: DataGrid.DataGrid.DataGridNode<unknown>):
285
- void {
286
- const node = (gridNode as ProfileDataGridNode);
287
- if (node.linkElement) {
288
- contextMenu.appendApplicableItems(node.linkElement);
289
- }
290
- }
291
-
292
- override willHide(): void {
293
- super.willHide();
294
- this.currentSearchResultIndex = -1;
295
- }
296
-
297
- refresh(): void {
298
- if (!this.profileDataGridTree) {
299
- return;
300
- }
301
- this.dataGrid.rootNode().removeChildren();
302
-
303
- const children = this.profileDataGridTree.children;
304
- const count = children.length;
305
-
306
- for (let index = 0; index < count; ++index) {
307
- this.dataGrid.rootNode().appendChild(children[index]);
308
- }
309
- }
310
-
311
- refreshVisibleData(): void {
312
- let child: (DataGrid.DataGrid.DataGridNode<unknown>|null) = this.dataGrid.rootNode().children[0];
313
- while (child) {
314
- child.refresh();
315
- child = child.traverseNextNode(false, null, true);
316
- }
317
- }
318
-
319
- searchableView(): UI.SearchableView.SearchableView {
320
- return this.searchableViewInternal;
321
- }
322
-
323
- supportsCaseSensitiveSearch(): boolean {
324
- return true;
325
- }
326
-
327
- supportsWholeWordSearch(): boolean {
328
- return false;
329
- }
330
-
331
- supportsRegexSearch(): boolean {
332
- return false;
333
- }
334
-
335
- onSearchCanceled(): void {
336
- if (this.searchableElement) {
337
- this.searchableElement.onSearchCanceled();
338
- }
339
- }
340
-
341
- performSearch(searchConfig: UI.SearchableView.SearchConfig, shouldJump: boolean, jumpBackwards?: boolean): void {
342
- if (this.searchableElement) {
343
- this.searchableElement.performSearch(searchConfig, shouldJump, jumpBackwards);
344
- }
345
- }
346
-
347
- jumpToNextSearchResult(): void {
348
- if (this.searchableElement) {
349
- this.searchableElement.jumpToNextSearchResult();
350
- }
351
- }
352
-
353
- jumpToPreviousSearchResult(): void {
354
- if (this.searchableElement) {
355
- this.searchableElement.jumpToPreviousSearchResult();
356
- }
357
- }
358
-
359
- linkifier(): Components.Linkifier.Linkifier {
360
- return this.linkifierInternal;
361
- }
362
-
363
- createFlameChartDataProvider(): ProfileFlameChartDataProvider {
364
- throw new Error('Not implemented');
365
- }
366
-
367
- ensureFlameChartCreated(): void {
368
- if (this.flameChart) {
369
- return;
370
- }
371
- this.dataProvider = this.createFlameChartDataProvider();
372
- this.flameChart = new ProfileFlameChart(this.searchableViewInternal, this.dataProvider);
373
- this.flameChart.addEventListener(PerfUI.FlameChart.Events.ENTRY_INVOKED, event => {
374
- void this.onEntryInvoked(event);
375
- });
376
- }
377
-
378
- async onEntryInvoked(event: Common.EventTarget.EventTargetEvent<number>): Promise<void> {
379
- if (!this.dataProvider) {
380
- return;
381
- }
382
- const entryIndex = event.data;
383
- const node = this.dataProvider.entryNodes[entryIndex];
384
- const debuggerModel = this.profileHeader.debuggerModel;
385
- if (!node || !node.scriptId || !debuggerModel) {
386
- return;
387
- }
388
- const script = debuggerModel.scriptForId(node.scriptId);
389
- if (!script) {
390
- return;
391
- }
392
- const location = (debuggerModel.createRawLocation(script, node.lineNumber, node.columnNumber));
393
- const uiLocation =
394
- await Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().rawLocationToUILocation(location);
395
- void Common.Revealer.reveal(uiLocation);
396
- }
397
-
398
- changeView(): void {
399
- if (!this.profileInternal) {
400
- return;
401
- }
402
-
403
- this.searchableViewInternal.closeSearch();
404
-
405
- if (this.visibleView) {
406
- this.visibleView.detach();
407
- }
408
- this.viewType.set((this.viewSelectComboBox.selectedOption() as HTMLOptionElement).value as ViewTypes);
409
- switch (this.viewType.get()) {
410
- case ViewTypes.FLAME:
411
- this.ensureFlameChartCreated();
412
- this.visibleView = this.flameChart;
413
- this.searchableElement = this.flameChart;
414
- break;
415
- case ViewTypes.TREE:
416
- this.profileDataGridTree = this.getTopDownProfileDataGridTree();
417
- this.sortProfile();
418
- this.visibleView = this.dataGrid.asWidget();
419
- this.searchableElement = this.profileDataGridTree;
420
- break;
421
- case ViewTypes.HEAVY:
422
- this.profileDataGridTree = this.getBottomUpProfileDataGridTree();
423
- this.sortProfile();
424
- this.visibleView = this.dataGrid.asWidget();
425
- this.searchableElement = this.profileDataGridTree;
426
- break;
427
- }
428
-
429
- const isFlame = this.viewType.get() === ViewTypes.FLAME;
430
- this.focusButton.setVisible(!isFlame);
431
- this.excludeButton.setVisible(!isFlame);
432
- this.resetButton.setVisible(!isFlame);
433
-
434
- if (this.visibleView) {
435
- this.visibleView.show(this.searchableViewInternal.element);
436
- }
437
- }
438
-
439
- nodeSelected(selected: boolean): void {
440
- this.focusButton.setEnabled(selected);
441
- this.excludeButton.setEnabled(selected);
442
- }
443
-
444
- focusClicked(): void {
445
- if (!this.dataGrid.selectedNode) {
446
- return;
447
- }
448
-
449
- this.resetButton.setEnabled(true);
450
- (this.resetButton.element as HTMLElement).focus();
451
- if (this.profileDataGridTree) {
452
- this.profileDataGridTree.focus((this.dataGrid.selectedNode as ProfileDataGridNode));
453
- }
454
- this.refresh();
455
- this.refreshVisibleData();
456
- Host.userMetrics.actionTaken(Host.UserMetrics.Action.CpuProfileNodeFocused);
457
- }
458
-
459
- excludeClicked(): void {
460
- const selectedNode = this.dataGrid.selectedNode;
461
-
462
- if (!selectedNode) {
463
- return;
464
- }
465
-
466
- this.resetButton.setEnabled(true);
467
- (this.resetButton.element as HTMLElement).focus();
468
-
469
- selectedNode.deselect();
470
-
471
- if (this.profileDataGridTree) {
472
- this.profileDataGridTree.exclude((selectedNode as ProfileDataGridNode));
473
- }
474
- this.refresh();
475
- this.refreshVisibleData();
476
- Host.userMetrics.actionTaken(Host.UserMetrics.Action.CpuProfileNodeExcluded);
477
- }
478
-
479
- resetClicked(): void {
480
- this.viewSelectComboBox.element.focus();
481
- this.resetButton.setEnabled(false);
482
- if (this.profileDataGridTree) {
483
- this.profileDataGridTree.restore();
484
- }
485
- this.linkifierInternal.reset();
486
- this.refresh();
487
- this.refreshVisibleData();
488
- }
489
-
490
- sortProfile(): void {
491
- if (!this.profileDataGridTree) {
492
- return;
493
- }
494
- const sortAscending = this.dataGrid.isSortOrderAscending();
495
- const sortColumnId = this.dataGrid.sortColumnId();
496
- const sortProperty = sortColumnId === 'function' ? 'functionName' : sortColumnId || '';
497
- this.profileDataGridTree.sort(ProfileDataGridTree.propertyComparator(sortProperty, sortAscending), false);
498
-
499
- this.refresh();
500
- }
501
- }
502
-
503
- export const maxLinkLength = 30;
504
-
505
- export const enum ViewTypes {
506
- FLAME = 'Flame',
507
- TREE = 'Tree',
508
- HEAVY = 'Heavy',
509
- }
510
-
511
- export class WritableProfileHeader extends ProfileHeader implements Common.StringOutputStream.OutputStream {
512
- readonly debuggerModel: SDK.DebuggerModel.DebuggerModel|null;
513
- fileName?: Platform.DevToolsPath.RawPathString;
514
- jsonifiedProfile?: string|null;
515
- profile?: Protocol.Profiler.Profile;
516
- protocolProfileInternal?: Protocol.Profiler.Profile;
517
- #profileReceivedPromise = Promise.withResolvers<void>();
518
-
519
- constructor(debuggerModel: SDK.DebuggerModel.DebuggerModel|null, type: ProfileType, title?: string) {
520
- super(type, title || i18nString(UIStrings.profileD, {PH1: type.nextProfileUid()}));
521
- this.debuggerModel = debuggerModel;
522
- }
523
-
524
- onChunkTransferred(_reader: Bindings.FileUtils.ChunkedReader): void {
525
- if (this.jsonifiedProfile) {
526
- // TODO(l10n): Is the '%' at the end of this string correct? 4MB% looks wrong
527
- this.updateStatus(
528
- i18nString(UIStrings.loadingD, {PH1: i18n.ByteUtilities.bytesToString(this.jsonifiedProfile.length)}));
529
- }
530
- }
531
-
532
- onError(reader: Bindings.FileUtils.ChunkedReader): void {
533
- const error = (reader.error() as Error);
534
- if (error) {
535
- this.updateStatus(i18nString(UIStrings.fileSReadErrorS, {PH1: reader.fileName(), PH2: error.message}));
536
- }
537
- }
538
-
539
- async write(text: string): Promise<void> {
540
- this.jsonifiedProfile += text;
541
- }
542
-
543
- async close(): Promise<void> {
544
- }
545
-
546
- override dispose(): void {
547
- this.removeTempFile();
548
- }
549
-
550
- override canSaveToFile(): boolean {
551
- return !this.fromFile();
552
- }
553
-
554
- override async saveToFile(): Promise<void> {
555
- await this.#profileReceivedPromise.promise;
556
- const fileOutputStream = new Bindings.FileUtils.FileOutputStream(Workspace.FileManager.FileManager.instance());
557
- if (!this.fileName) {
558
- const now = Platform.DateUtilities.toISO8601Compact(new Date());
559
- const fileExtension = this.profileType().fileExtension();
560
-
561
- this.fileName = `${this.profileType().typeName()}-${now}${fileExtension}` as Platform.DevToolsPath.RawPathString;
562
- }
563
-
564
- const accepted = await fileOutputStream.open(this.fileName);
565
- if (!accepted || !this.tempFile) {
566
- return;
567
- }
568
- const data = await this.tempFile.read();
569
- if (data) {
570
- await fileOutputStream.write(data);
571
- }
572
- void fileOutputStream.close();
573
- }
574
-
575
- override async loadFromFile(file: File): Promise<Error|null> {
576
- this.updateStatus(i18nString(UIStrings.loading), true);
577
- const fileReader = new Bindings.FileUtils.ChunkedFileReader(file, 10000000, this.onChunkTransferred.bind(this));
578
- this.jsonifiedProfile = '';
579
-
580
- const success = await fileReader.read(this);
581
- if (!success) {
582
- this.onError(fileReader);
583
- return new Error(i18nString(UIStrings.failedToReadFile));
584
- }
585
-
586
- this.updateStatus(i18nString(UIStrings.parsing), true);
587
- let error = null;
588
- try {
589
- this.profile = (JSON.parse(this.jsonifiedProfile) as Protocol.Profiler.Profile);
590
- this.setProfile((this.profile));
591
- this.updateStatus(i18nString(UIStrings.loaded), false);
592
- } catch (e) {
593
- error = e;
594
- this.profileType().removeProfile(this);
595
- }
596
- this.jsonifiedProfile = null;
597
-
598
- if (this.profileType().profileBeingRecorded() === this) {
599
- this.profileType().setProfileBeingRecorded(null);
600
- }
601
- return error;
602
- }
603
-
604
- setProtocolProfile(profile: Protocol.Profiler.Profile): void {
605
- this.setProfile(profile);
606
- this.protocolProfileInternal = profile;
607
- this.tempFile = new Bindings.TempFile.TempFile();
608
- this.tempFile.write([JSON.stringify(profile)]);
609
- this.#profileReceivedPromise.resolve();
610
- }
611
- }