chrome-devtools-frontend 1.0.951410 → 1.0.952713

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 (214) hide show
  1. package/config/gni/devtools_grd_files.gni +3 -0
  2. package/extension-api/ExtensionAPI.d.ts +1 -1
  3. package/front_end/.eslintrc.js +6 -0
  4. package/front_end/Tests.js +10 -0
  5. package/front_end/core/common/App.ts +0 -3
  6. package/front_end/core/common/AppProvider.ts +0 -3
  7. package/front_end/core/common/JavaScriptMetaData.ts +0 -3
  8. package/front_end/core/common/QueryParamHandler.ts +0 -3
  9. package/front_end/core/common/Runnable.ts +0 -3
  10. package/front_end/core/common/SimpleHistoryManager.ts +0 -3
  11. package/front_end/core/host/UserMetrics.ts +2 -1
  12. package/front_end/core/i18n/locales/en-US.json +3 -0
  13. package/front_end/core/i18n/locales/en-XL.json +3 -0
  14. package/front_end/core/root/Runtime.ts +4 -12
  15. package/front_end/core/sdk/OverlayPersistentHighlighter.ts +0 -12
  16. package/front_end/core/sdk/PageResourceLoader.ts +2 -1
  17. package/front_end/core/sdk/TracingManager.ts +0 -3
  18. package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +39 -39
  19. package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +54 -54
  20. package/front_end/entrypoints/formatter_worker/ESTreeWalker.ts +20 -20
  21. package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +54 -54
  22. package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +145 -144
  23. package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +40 -40
  24. package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +64 -69
  25. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +203 -203
  26. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +109 -108
  27. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +17 -17
  28. package/front_end/entrypoints/inspector_main/InspectorMain.ts +30 -30
  29. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +25 -25
  30. package/front_end/entrypoints/main/ExecutionContextSelector.ts +52 -55
  31. package/front_end/entrypoints/main/MainImpl.ts +49 -49
  32. package/front_end/entrypoints/node_app/NodeConnectionsPanel.ts +43 -43
  33. package/front_end/entrypoints/node_app/NodeMain.ts +38 -38
  34. package/front_end/generated/InspectorBackendCommands.js +5 -1
  35. package/front_end/generated/protocol.d.ts +16 -0
  36. package/front_end/legacy/legacy-defs.d.ts +0 -21
  37. package/front_end/models/bindings/CSSWorkspaceBinding.ts +0 -3
  38. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -3
  39. package/front_end/models/bindings/FileUtils.ts +0 -3
  40. package/front_end/models/extensions/ExtensionAPI.ts +2 -1
  41. package/front_end/models/extensions/ExtensionTraceProvider.ts +0 -3
  42. package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +1 -1
  43. package/front_end/models/issues_manager/ClientHintIssue.ts +95 -0
  44. package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +6 -6
  45. package/front_end/models/issues_manager/ContrastCheckTrigger.ts +15 -15
  46. package/front_end/models/issues_manager/CorsIssue.ts +9 -9
  47. package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +5 -5
  48. package/front_end/models/issues_manager/DeprecationIssue.ts +7 -7
  49. package/front_end/models/issues_manager/GenericIssue.ts +5 -5
  50. package/front_end/models/issues_manager/HeavyAdIssue.ts +5 -5
  51. package/front_end/models/issues_manager/Issue.ts +10 -10
  52. package/front_end/models/issues_manager/IssueResolver.ts +11 -10
  53. package/front_end/models/issues_manager/IssuesManager.ts +61 -56
  54. package/front_end/models/issues_manager/LowTextContrastIssue.ts +4 -4
  55. package/front_end/models/issues_manager/MixedContentIssue.ts +7 -7
  56. package/front_end/models/issues_manager/NavigatorUserAgentIssue.ts +7 -7
  57. package/front_end/models/issues_manager/QuirksModeIssue.ts +4 -4
  58. package/front_end/models/issues_manager/SameSiteCookieIssue.ts +16 -16
  59. package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +5 -5
  60. package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +32 -31
  61. package/front_end/models/issues_manager/TrustedWebActivityIssue.ts +5 -5
  62. package/front_end/models/issues_manager/WasmCrossOriginModuleSharingIssue.ts +5 -5
  63. package/front_end/models/issues_manager/descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
  64. package/front_end/models/issues_manager/descriptions/clientHintMetaTagModifiedHTML.md +4 -0
  65. package/front_end/models/issues_manager/issues_manager.ts +2 -0
  66. package/front_end/models/timeline_model/TimelineModel.ts +1 -1
  67. package/front_end/panels/application/components/BackForwardCacheView.ts +33 -33
  68. package/front_end/panels/application/components/EndpointsGrid.ts +12 -12
  69. package/front_end/panels/application/components/FrameDetailsView.ts +108 -110
  70. package/front_end/panels/application/components/OriginTrialTreeView.ts +45 -45
  71. package/front_end/panels/application/components/PermissionsPolicySection.ts +19 -19
  72. package/front_end/panels/application/components/ReportsGrid.ts +30 -30
  73. package/front_end/panels/application/components/StackTrace.ts +48 -47
  74. package/front_end/panels/application/components/TrustTokensView.ts +31 -31
  75. package/front_end/panels/console/ConsoleView.ts +1 -1
  76. package/front_end/panels/console/ConsoleViewMessage.ts +1 -25
  77. package/front_end/panels/console/consoleView.css +5 -0
  78. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +41 -52
  79. package/front_end/panels/css_overview/CSSOverviewController.ts +2 -2
  80. package/front_end/panels/css_overview/CSSOverviewPanel.ts +18 -27
  81. package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +2 -2
  82. package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +6 -6
  83. package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +4 -4
  84. package/front_end/panels/elements/ElementsTreeElement.ts +2 -6
  85. package/front_end/panels/elements/components/AccessibilityTreeNode.ts +17 -17
  86. package/front_end/panels/elements/components/AdornerManager.ts +21 -21
  87. package/front_end/panels/elements/components/AdornerSettingsPane.ts +14 -14
  88. package/front_end/panels/elements/components/CSSQuery.ts +16 -16
  89. package/front_end/panels/elements/components/ComputedStyleProperty.ts +14 -14
  90. package/front_end/panels/elements/components/ComputedStyleTrace.ts +15 -15
  91. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +78 -78
  92. package/front_end/panels/elements/components/ElementsPanelLink.ts +16 -16
  93. package/front_end/panels/elements/components/LayoutPane.ts +47 -47
  94. package/front_end/panels/elements/components/NodeText.ts +18 -18
  95. package/front_end/panels/elements/components/QueryContainer.ts +40 -40
  96. package/front_end/panels/elements/components/StylePropertyEditor.ts +18 -18
  97. package/front_end/panels/emulation/components/DeviceSizeInputElement.ts +4 -4
  98. package/front_end/panels/event_listeners/EventListenersUtils.ts +2 -1
  99. package/front_end/panels/issues/AffectedBlockedByResponseView.ts +4 -4
  100. package/front_end/panels/issues/AffectedCookiesView.ts +4 -5
  101. package/front_end/panels/issues/AffectedDirectivesView.ts +19 -19
  102. package/front_end/panels/issues/AffectedDocumentsInQuirksModeView.ts +7 -8
  103. package/front_end/panels/issues/AffectedElementsView.ts +4 -4
  104. package/front_end/panels/issues/AffectedElementsWithLowContrastView.ts +7 -8
  105. package/front_end/panels/issues/AffectedHeavyAdView.ts +8 -8
  106. package/front_end/panels/issues/AffectedResourcesView.ts +25 -26
  107. package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +8 -8
  108. package/front_end/panels/issues/AffectedSourcesView.ts +4 -4
  109. package/front_end/panels/issues/AffectedTrustedWebActivityIssueDetailsView.ts +4 -4
  110. package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +17 -17
  111. package/front_end/panels/issues/CSPViolationsListView.ts +22 -23
  112. package/front_end/panels/issues/CSPViolationsView.ts +17 -17
  113. package/front_end/panels/issues/ComboBoxOfCheckBoxes.ts +13 -13
  114. package/front_end/panels/issues/CorsIssueDetailsView.ts +23 -23
  115. package/front_end/panels/issues/GenericIssueDetailsView.ts +4 -4
  116. package/front_end/panels/issues/HiddenIssuesRow.ts +7 -7
  117. package/front_end/panels/issues/IssueAggregator.ts +95 -95
  118. package/front_end/panels/issues/IssueKindView.ts +14 -14
  119. package/front_end/panels/issues/IssueView.ts +98 -98
  120. package/front_end/panels/issues/IssuesPane.ts +102 -102
  121. package/front_end/panels/issues/WasmCrossOriginModuleSharingAffectedResourcesView.ts +5 -5
  122. package/front_end/panels/issues/components/HideIssuesMenu.ts +10 -10
  123. package/front_end/panels/media/PlayerListView.ts +160 -97
  124. package/front_end/panels/media/PlayerMessagesView.ts +1 -0
  125. package/front_end/panels/media/playerListView.css +58 -0
  126. package/front_end/panels/network/NetworkLogView.ts +2 -6
  127. package/front_end/panels/network/NetworkWaterfallColumn.ts +2 -4
  128. package/front_end/panels/network/components/RequestTrustTokensView.ts +40 -40
  129. package/front_end/panels/network/components/WebBundleInfoView.ts +9 -9
  130. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +92 -37
  131. package/front_end/panels/performance_monitor/performanceMonitor.css +32 -0
  132. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +2 -2
  133. package/front_end/panels/search/SearchConfig.ts +0 -6
  134. package/front_end/panels/settings/KeybindsSettingsTab.ts +4 -0
  135. package/front_end/panels/settings/components/SyncSection.ts +14 -14
  136. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +96 -96
  137. package/front_end/panels/sources/BreakpointEditDialog.ts +4 -3
  138. package/front_end/panels/sources/NavigatorView.ts +3 -9
  139. package/front_end/panels/sources/SourceMapNamesResolver.ts +3 -3
  140. package/front_end/panels/sources/SourcesPanel.ts +1 -3
  141. package/front_end/panels/sources/SourcesView.ts +0 -3
  142. package/front_end/panels/sources/TabbedEditorContainer.ts +0 -3
  143. package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
  144. package/front_end/panels/timeline/TimelineLoader.ts +0 -3
  145. package/front_end/panels/timeline/TimelineTreeView.ts +1 -1
  146. package/front_end/panels/timeline/components/WebVitalsLane.ts +77 -76
  147. package/front_end/panels/timeline/components/WebVitalsTimeline.ts +133 -133
  148. package/front_end/panels/timeline/components/WebVitalsTooltip.ts +9 -9
  149. package/front_end/panels/webauthn/WebauthnPane.ts +203 -205
  150. package/front_end/third_party/codemirror.next/bundle.ts +3 -3
  151. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  152. package/front_end/third_party/codemirror.next/chunk/markdown.js +2 -1
  153. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +10 -1
  154. package/front_end/third_party/codemirror.next/codemirror.next.js +2 -1
  155. package/front_end/third_party/codemirror.next/package.json +3 -3
  156. package/front_end/third_party/diff/DiffWrapper.ts +7 -0
  157. package/front_end/ui/components/adorners/Adorner.ts +2 -2
  158. package/front_end/ui/components/buttons/Button.ts +9 -9
  159. package/front_end/ui/components/data_grid/DataGrid.ts +64 -64
  160. package/front_end/ui/components/data_grid/DataGridController.ts +22 -22
  161. package/front_end/ui/components/data_grid/DataGridUtils.ts +3 -0
  162. package/front_end/ui/components/diff_view/DiffView.ts +6 -6
  163. package/front_end/ui/components/expandable_list/ExpandableList.ts +5 -5
  164. package/front_end/ui/components/icon_button/Icon.ts +4 -4
  165. package/front_end/ui/components/icon_button/IconButton.ts +4 -4
  166. package/front_end/ui/components/issue_counter/IssueCounter.ts +3 -3
  167. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +11 -11
  168. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +50 -50
  169. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +6 -6
  170. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +4 -4
  171. package/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator.ts +12 -12
  172. package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +11 -11
  173. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +40 -39
  174. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +18 -18
  175. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings.ts +6 -6
  176. package/front_end/ui/components/linkifier/LinkifierImpl.ts +4 -4
  177. package/front_end/ui/components/markdown_view/MarkdownImage.ts +5 -5
  178. package/front_end/ui/components/markdown_view/MarkdownLink.ts +2 -2
  179. package/front_end/ui/components/markdown_view/MarkdownView.ts +4 -4
  180. package/front_end/ui/components/panel_feedback/FeedbackButton.ts +2 -2
  181. package/front_end/ui/components/panel_feedback/PanelFeedback.ts +2 -2
  182. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +4 -4
  183. package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +22 -22
  184. package/front_end/ui/components/report_view/ReportView.ts +16 -16
  185. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +14 -14
  186. package/front_end/ui/components/settings/SettingCheckbox.ts +5 -5
  187. package/front_end/ui/components/survey_link/SurveyLink.ts +8 -8
  188. package/front_end/ui/components/text_editor/TextEditor.ts +9 -9
  189. package/front_end/ui/components/text_editor/cursor_tooltip.ts +7 -1
  190. package/front_end/ui/components/text_prompt/TextPrompt.ts +18 -18
  191. package/front_end/ui/components/tree_outline/TreeOutline.ts +69 -70
  192. package/front_end/ui/legacy/ContextFlavorListener.ts +0 -4
  193. package/front_end/ui/legacy/SearchableView.ts +13 -4
  194. package/front_end/ui/legacy/SuggestBox.ts +0 -3
  195. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +6 -6
  196. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +0 -3
  197. package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -1
  198. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +13 -12
  199. package/front_end/ui/legacy/components/source_frame/XMLView.ts +2 -2
  200. package/front_end/ui/legacy/themeColors.css +2 -0
  201. package/front_end/ui/legacy/theme_support/theme_support_impl.ts +34 -7
  202. package/package.json +1 -1
  203. package/scripts/eslint_rules/lib/use_private_class_members.js +41 -0
  204. package/scripts/eslint_rules/tests/use_private_class_members_test.js +62 -0
  205. package/scripts/migration/class-fields/migrate.js +2 -3
  206. package/scripts/migration/class-fields/migrate.sh +1 -3
  207. package/scripts/migration/class-fields/package.json +1 -1
  208. package/config/gni/all_devtools_files.gni +0 -255
  209. package/scripts/build/devtools_file_hashes.py +0 -82
  210. package/scripts/devtools_run/devtools_run_cli +0 -49
  211. package/scripts/devtools_run/package.json +0 -13
  212. package/scripts/unzip.py +0 -20
  213. package/scripts/visualize_deps/jquery_svg.html +0 -57
  214. package/scripts/visualize_deps/run_visualize.js +0 -119
@@ -281,6 +281,8 @@ grd_files_release_sources = [
281
281
  "front_end/models/issues_manager/descriptions/arInvalidTriggerPriority.md",
282
282
  "front_end/models/issues_manager/descriptions/arMissingAttributionData.md",
283
283
  "front_end/models/issues_manager/descriptions/arPermissionPolicyDisabled.md",
284
+ "front_end/models/issues_manager/descriptions/clientHintMetaTagAllowListInvalidOrigin.md",
285
+ "front_end/models/issues_manager/descriptions/clientHintMetaTagModifiedHTML.md",
284
286
  "front_end/models/issues_manager/descriptions/corsAllowCredentialsRequired.md",
285
287
  "front_end/models/issues_manager/descriptions/corsDisabledScheme.md",
286
288
  "front_end/models/issues_manager/descriptions/corsDisallowedByMode.md",
@@ -692,6 +694,7 @@ grd_files_debug_sources = [
692
694
  "front_end/models/har/Writer.js",
693
695
  "front_end/models/heap_snapshot_model/HeapSnapshotModel.js",
694
696
  "front_end/models/issues_manager/AttributionReportingIssue.js",
697
+ "front_end/models/issues_manager/ClientHintIssue.js",
695
698
  "front_end/models/issues_manager/ContentSecurityPolicyIssue.js",
696
699
  "front_end/models/issues_manager/ContrastCheckTrigger.js",
697
700
  "front_end/models/issues_manager/CorsIssue.js",
@@ -4,7 +4,7 @@
4
4
 
5
5
  export namespace Chrome {
6
6
  export namespace DevTools {
7
- export interface EventSink<ListenerT extends(...args: any) => any> {
7
+ export interface EventSink<ListenerT extends(...args: any) => void> {
8
8
  addListener(listener: ListenerT): void;
9
9
  }
10
10
 
@@ -139,6 +139,12 @@ module.exports = {
139
139
  }
140
140
  ]
141
141
  }
142
+ },
143
+ {
144
+ 'files': ['panels/**/components/*.ts', 'ui/components/**/*.ts', 'entrypoints/**/*.ts'],
145
+ 'rules': {
146
+ 'rulesdir/use_private_class_members': 2,
147
+ }
142
148
  }
143
149
  ]
144
150
  };
@@ -1562,6 +1562,16 @@
1562
1562
  return names.join(',');
1563
1563
  };
1564
1564
 
1565
+ TestSuite.prototype.testSourceMapsFromExtension = function(extensionId) {
1566
+ this.takeControl();
1567
+ const debuggerModel = self.SDK.targetManager.mainTarget().model(SDK.DebuggerModel);
1568
+ debuggerModel.sourceMapManager().addEventListener(
1569
+ SDK.SourceMapManager.Events.SourceMapAttached, this.releaseControl.bind(this));
1570
+
1571
+ this.evaluateInConsole_(
1572
+ `console.log(1) //# sourceMappingURL=chrome-extension://${extensionId}/source.map`, () => {});
1573
+ };
1574
+
1565
1575
  /**
1566
1576
  * Returns all loaded non anonymous uiSourceCodes.
1567
1577
  * @return {!Array.<!Workspace.UISourceCode>}
@@ -2,9 +2,6 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- /**
6
- * @interface
7
- */
8
5
  export interface App {
9
6
  presentUI(document: Document): void;
10
7
  }
@@ -6,9 +6,6 @@ import * as Root from '../root/root.js';
6
6
 
7
7
  import type {App} from './App.js';
8
8
 
9
- /**
10
- * @interface
11
- */
12
9
  export interface AppProvider {
13
10
  createApp(): App;
14
11
  }
@@ -2,9 +2,6 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- /**
6
- * @interface
7
- */
8
5
  export interface JavaScriptMetaData {
9
6
  signaturesForNativeFunction(name: string): string[][]|null;
10
7
 
@@ -2,9 +2,6 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- /**
6
- * @interface
7
- */
8
5
  export interface QueryParamHandler {
9
6
  handleQueryParam(value: string): void;
10
7
  }
@@ -2,9 +2,6 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- /**
6
- * @interface
7
- */
8
5
  export interface Runnable {
9
6
  run(): Promise<void>;
10
7
  }
@@ -28,9 +28,6 @@
28
28
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
29
  */
30
30
 
31
- /**
32
- * @interface
33
- */
34
31
  export interface HistoryEntry {
35
32
  valid(): boolean;
36
33
 
@@ -677,7 +677,8 @@ export const IssueCreated: {
677
677
  'QuirksModeIssue::QuirksMode': 58,
678
678
  'QuirksModeIssue::LimitedQuirksMode': 59,
679
679
  DeprecationIssue: 60,
680
- 'CorsIssue::PreflightAllowPrivateNetworkError': 61,
680
+ 'ClientHintIssue::MetaTagAllowListInvalidOrigin': 61,
681
+ 'ClientHintIssue::MetaTagModifiedHTML': 62,
681
682
  };
682
683
 
683
684
  // TODO(crbug.com/1167717): Make this a const enum again
@@ -1322,6 +1322,9 @@
1322
1322
  "models/har/Writer.ts | writingFile": {
1323
1323
  "message": "Writing file…"
1324
1324
  },
1325
+ "models/issues_manager/ClientHintIssue.ts | clientHintsInfrastructure": {
1326
+ "message": "Client Hints Infrastructure"
1327
+ },
1325
1328
  "models/issues_manager/ContentSecurityPolicyIssue.ts | contentSecurityPolicyEval": {
1326
1329
  "message": "Content Security Policy - Eval"
1327
1330
  },
@@ -1322,6 +1322,9 @@
1322
1322
  "models/har/Writer.ts | writingFile": {
1323
1323
  "message": "Ŵŕît́îńĝ f́îĺê…"
1324
1324
  },
1325
+ "models/issues_manager/ClientHintIssue.ts | clientHintsInfrastructure": {
1326
+ "message": "Ĉĺîén̂t́ Ĥín̂t́ŝ Ín̂f́r̂áŝt́r̂úĉt́ûŕê"
1327
+ },
1325
1328
  "models/issues_manager/ContentSecurityPolicyIssue.ts | contentSecurityPolicyEval": {
1326
1329
  "message": "Ĉón̂t́êńt̂ Śêćûŕît́ŷ Ṕôĺîćŷ - Év̂ál̂"
1327
1330
  },
@@ -2,8 +2,7 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- const originalConsole = console;
6
- const originalAssert = console.assert;
5
+ import * as Platform from '../platform/platform.js';
7
6
 
8
7
  const queryParamsObject = new URLSearchParams(location.search);
9
8
 
@@ -100,13 +99,6 @@ export class Runtime {
100
99
  }
101
100
  }
102
101
 
103
- static assert(value: boolean|undefined, message: string): void {
104
- if (value) {
105
- return;
106
- }
107
- originalAssert.call(originalConsole, value, message + ' ' + new Error().stack);
108
- }
109
-
110
102
  static setPlatform(platform: string): void {
111
103
  runtimePlatform = platform;
112
104
  }
@@ -197,8 +189,8 @@ export class ExperimentsSupport {
197
189
  }
198
190
 
199
191
  register(experimentName: string, experimentTitle: string, unstable?: boolean, docLink?: string): void {
200
- Runtime.assert(
201
- !this.#experimentNames.has(experimentName), 'Duplicate registration of experiment ' + experimentName);
192
+ Platform.DCHECK(
193
+ () => !this.#experimentNames.has(experimentName), 'Duplicate registration of experiment ' + experimentName);
202
194
  this.#experimentNames.add(experimentName);
203
195
  this.#experiments.push(new Experiment(this, experimentName, experimentTitle, Boolean(unstable), docLink ?? ''));
204
196
  }
@@ -278,7 +270,7 @@ export class ExperimentsSupport {
278
270
  }
279
271
 
280
272
  private checkExperiment(experimentName: string): void {
281
- Runtime.assert(this.#experimentNames.has(experimentName), 'Unknown experiment ' + experimentName);
273
+ Platform.DCHECK(() => this.#experimentNames.has(experimentName), 'Unknown experiment ' + experimentName);
282
274
  }
283
275
  }
284
276
 
@@ -360,15 +360,9 @@ export class OverlayPersistentHighlighter {
360
360
  }
361
361
  }
362
362
 
363
- /**
364
- * @interface
365
- */
366
363
  export interface DOMModel {
367
364
  nodeForId(nodeId: Protocol.DOM.NodeId): void;
368
365
  }
369
- /**
370
- * @interface
371
- */
372
366
  export interface OverlayAgent {
373
367
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
374
368
  // eslint-disable-next-line @typescript-eslint/naming-convention
@@ -415,16 +409,10 @@ export interface OverlayAgent {
415
409
  }): void;
416
410
  }
417
411
 
418
- /**
419
- * @interface
420
- */
421
412
  export interface Target {
422
413
  overlayAgent(): OverlayAgent;
423
414
  }
424
415
 
425
- /**
426
- * @interface
427
- */
428
416
  export interface OverlayModel {
429
417
  getDOMModel(): DOMModel;
430
418
 
@@ -219,7 +219,8 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
219
219
  return this.#loadOverride(url);
220
220
  }
221
221
  const parsedURL = new Common.ParsedURL.ParsedURL(url);
222
- const eligibleForLoadFromTarget = getLoadThroughTargetSetting().get() && parsedURL && parsedURL.isHttpOrHttps();
222
+ const eligibleForLoadFromTarget =
223
+ getLoadThroughTargetSetting().get() && parsedURL && parsedURL.scheme !== 'file' && parsedURL.scheme !== 'data';
223
224
  Host.userMetrics.developerResourceScheme(this.getDeveloperResourceScheme(parsedURL));
224
225
  if (eligibleForLoadFromTarget) {
225
226
  try {
@@ -94,9 +94,6 @@ export class TracingManager extends SDKModel<void> {
94
94
  }
95
95
  }
96
96
 
97
- /**
98
- * @interface
99
- */
100
97
  export interface TracingManagerClient {
101
98
  traceEventsCollected(events: EventPayload[]): void;
102
99
 
@@ -34,28 +34,28 @@ export type TokenOrComment = Acorn.Token|Acorn.Comment;
34
34
  * out whether the next token should be the preceding comment or not.
35
35
  */
36
36
  export class AcornTokenizer {
37
- private readonly content: string;
38
- private readonly comments: Acorn.Comment[];
39
- private tokenizer: {
37
+ readonly #content: string;
38
+ readonly #comments: Acorn.Comment[];
39
+ #tokenizer: {
40
40
  getToken(): Acorn.Token,
41
41
  [Symbol.iterator](): Iterator<Acorn.Token>,
42
42
  };
43
- private textCursor: TextUtils.TextCursor.TextCursor;
44
- private tokenLineStartInternal: number;
45
- private tokenLineEndInternal: number;
46
- private tokenColumnStartInternal: number;
47
- private bufferedToken?: TokenOrComment;
43
+ #textCursor: TextUtils.TextCursor.TextCursor;
44
+ #tokenLineStartInternal: number;
45
+ #tokenLineEndInternal: number;
46
+ #tokenColumnStartInternal: number;
47
+ #bufferedToken?: TokenOrComment;
48
48
 
49
49
  constructor(content: string) {
50
- this.content = content;
51
- this.comments = [];
52
- this.tokenizer =
53
- Acorn.tokenizer(this.content, {onComment: this.comments, ecmaVersion: ECMA_VERSION, allowHashBang: true});
54
- const contentLineEndings = Platform.StringUtilities.findLineEndingIndexes(this.content);
55
- this.textCursor = new TextUtils.TextCursor.TextCursor(contentLineEndings);
56
- this.tokenLineStartInternal = 0;
57
- this.tokenLineEndInternal = 0;
58
- this.tokenColumnStartInternal = 0;
50
+ this.#content = content;
51
+ this.#comments = [];
52
+ this.#tokenizer =
53
+ Acorn.tokenizer(this.#content, {onComment: this.#comments, ecmaVersion: ECMA_VERSION, allowHashBang: true});
54
+ const contentLineEndings = Platform.StringUtilities.findLineEndingIndexes(this.#content);
55
+ this.#textCursor = new TextUtils.TextCursor.TextCursor(contentLineEndings);
56
+ this.#tokenLineStartInternal = 0;
57
+ this.#tokenLineEndInternal = 0;
58
+ this.#tokenColumnStartInternal = 0;
59
59
  // If the first "token" should be a comment, we don't want to shift
60
60
  // the comment from the array (which happens in `nextTokenInternal`).
61
61
  // Therefore, we should bail out from retrieving the token if this
@@ -65,8 +65,8 @@ export class AcornTokenizer {
65
65
  // themselves. In that case, we first retrieve the actual token, before
66
66
  // we see the comment itself. In that case, we should proceed and
67
67
  // initialize `bufferedToken` as normal, to allow us to fix the reordering.
68
- if (this.comments.length === 0) {
69
- this.nextTokenInternal();
68
+ if (this.#comments.length === 0) {
69
+ this.#nextTokenInternal();
70
70
  }
71
71
  }
72
72
 
@@ -94,59 +94,59 @@ export class AcornTokenizer {
94
94
  return token.type === 'Block';
95
95
  }
96
96
 
97
- private nextTokenInternal(): TokenOrComment|undefined {
98
- if (this.comments.length) {
99
- const nextComment = this.comments.shift();
97
+ #nextTokenInternal(): TokenOrComment|undefined {
98
+ if (this.#comments.length) {
99
+ const nextComment = this.#comments.shift();
100
100
  // If this was the last comment to process, we need to make
101
101
  // sure to update our `bufferedToken` to become the actual
102
102
  // token. This only happens when we are processing the very
103
103
  // first comment of a file (usually a hashbang comment)
104
104
  // in which case we don't have to fix the reordering of tokens.
105
- if (!this.bufferedToken && this.comments.length === 0) {
106
- this.bufferedToken = this.tokenizer.getToken();
105
+ if (!this.#bufferedToken && this.#comments.length === 0) {
106
+ this.#bufferedToken = this.#tokenizer.getToken();
107
107
  }
108
108
  return nextComment;
109
109
  }
110
- const token = this.bufferedToken;
111
- this.bufferedToken = this.tokenizer.getToken();
110
+ const token = this.#bufferedToken;
111
+ this.#bufferedToken = this.#tokenizer.getToken();
112
112
  return token;
113
113
  }
114
114
 
115
115
  nextToken(): TokenOrComment|null {
116
- const token = this.nextTokenInternal();
116
+ const token = this.#nextTokenInternal();
117
117
  if (!token || token.type === Acorn.tokTypes.eof) {
118
118
  return null;
119
119
  }
120
120
 
121
- this.textCursor.advance(token.start);
122
- this.tokenLineStartInternal = this.textCursor.lineNumber();
123
- this.tokenColumnStartInternal = this.textCursor.columnNumber();
121
+ this.#textCursor.advance(token.start);
122
+ this.#tokenLineStartInternal = this.#textCursor.lineNumber();
123
+ this.#tokenColumnStartInternal = this.#textCursor.columnNumber();
124
124
 
125
- this.textCursor.advance(token.end);
126
- this.tokenLineEndInternal = this.textCursor.lineNumber();
125
+ this.#textCursor.advance(token.end);
126
+ this.#tokenLineEndInternal = this.#textCursor.lineNumber();
127
127
  return token;
128
128
  }
129
129
 
130
130
  peekToken(): TokenOrComment|null {
131
- if (this.comments.length) {
132
- return this.comments[0];
131
+ if (this.#comments.length) {
132
+ return this.#comments[0];
133
133
  }
134
- if (!this.bufferedToken) {
134
+ if (!this.#bufferedToken) {
135
135
  return null;
136
136
  }
137
- return this.bufferedToken.type !== Acorn.tokTypes.eof ? this.bufferedToken : null;
137
+ return this.#bufferedToken.type !== Acorn.tokTypes.eof ? this.#bufferedToken : null;
138
138
  }
139
139
 
140
140
  tokenLineStart(): number {
141
- return this.tokenLineStartInternal;
141
+ return this.#tokenLineStartInternal;
142
142
  }
143
143
 
144
144
  tokenLineEnd(): number {
145
- return this.tokenLineEndInternal;
145
+ return this.#tokenLineEndInternal;
146
146
  }
147
147
 
148
148
  tokenColumnStart(): number {
149
- return this.tokenColumnStartInternal;
149
+ return this.#tokenColumnStartInternal;
150
150
  }
151
151
  }
152
152
 
@@ -40,21 +40,21 @@ const cssTrimEnd = (tokenValue: string): string => {
40
40
  };
41
41
 
42
42
  export class CSSFormatter {
43
- private readonly builder: FormattedContentBuilder;
44
- private toOffset!: number;
45
- private fromOffset!: number;
46
- private lineEndings!: number[];
47
- private lastLine: number;
48
- private state: {
43
+ readonly #builder: FormattedContentBuilder;
44
+ #toOffset!: number;
45
+ #fromOffset!: number;
46
+ #lineEndings!: number[];
47
+ #lastLine: number;
48
+ #state: {
49
49
  eatWhitespace: (boolean|undefined),
50
50
  seenProperty: (boolean|undefined),
51
51
  inPropertyValue: (boolean|undefined),
52
52
  afterClosingBrace: (boolean|undefined),
53
53
  };
54
54
  constructor(builder: FormattedContentBuilder) {
55
- this.builder = builder;
56
- this.lastLine = -1;
57
- this.state = {
55
+ this.#builder = builder;
56
+ this.#lastLine = -1;
57
+ this.#state = {
58
58
  eatWhitespace: undefined,
59
59
  seenProperty: undefined,
60
60
  inPropertyValue: undefined,
@@ -63,84 +63,84 @@ export class CSSFormatter {
63
63
  }
64
64
 
65
65
  format(text: string, lineEndings: number[], fromOffset: number, toOffset: number): void {
66
- this.lineEndings = lineEndings;
67
- this.fromOffset = fromOffset;
68
- this.toOffset = toOffset;
69
- this.state = {
66
+ this.#lineEndings = lineEndings;
67
+ this.#fromOffset = fromOffset;
68
+ this.#toOffset = toOffset;
69
+ this.#state = {
70
70
  eatWhitespace: undefined,
71
71
  seenProperty: undefined,
72
72
  inPropertyValue: undefined,
73
73
  afterClosingBrace: undefined,
74
74
  };
75
- this.lastLine = -1;
75
+ this.#lastLine = -1;
76
76
  const tokenize = createTokenizer('text/css');
77
- const oldEnforce = this.builder.setEnforceSpaceBetweenWords(false);
78
- tokenize(text.substring(this.fromOffset, this.toOffset), this.tokenCallback.bind(this));
79
- this.builder.setEnforceSpaceBetweenWords(oldEnforce);
77
+ const oldEnforce = this.#builder.setEnforceSpaceBetweenWords(false);
78
+ tokenize(text.substring(this.#fromOffset, this.#toOffset), this.#tokenCallback.bind(this));
79
+ this.#builder.setEnforceSpaceBetweenWords(oldEnforce);
80
80
  }
81
81
 
82
- private tokenCallback(token: string, type: string|null, startPosition: number): void {
83
- startPosition += this.fromOffset;
84
- const startLine =
85
- Platform.ArrayUtilities.lowerBound(this.lineEndings, startPosition, Platform.ArrayUtilities.DEFAULT_COMPARATOR);
86
- if (startLine !== this.lastLine) {
87
- this.state.eatWhitespace = true;
82
+ #tokenCallback(token: string, type: string|null, startPosition: number): void {
83
+ startPosition += this.#fromOffset;
84
+ const startLine = Platform.ArrayUtilities.lowerBound(
85
+ this.#lineEndings, startPosition, Platform.ArrayUtilities.DEFAULT_COMPARATOR);
86
+ if (startLine !== this.#lastLine) {
87
+ this.#state.eatWhitespace = true;
88
88
  }
89
- if (type && (/^property/.test(type) || /^variable-2/.test(type)) && !this.state.inPropertyValue) {
90
- this.state.seenProperty = true;
89
+ if (type && (/^property/.test(type) || /^variable-2/.test(type)) && !this.#state.inPropertyValue) {
90
+ this.#state.seenProperty = true;
91
91
  }
92
- this.lastLine = startLine;
92
+ this.#lastLine = startLine;
93
93
  // https://drafts.csswg.org/css-syntax/#whitespace
94
94
  const isWhitespace = /^(?:\r?\n|[\t\f\r ])+$/.test(token);
95
95
  if (isWhitespace) {
96
- if (!this.state.eatWhitespace) {
97
- this.builder.addSoftSpace();
96
+ if (!this.#state.eatWhitespace) {
97
+ this.#builder.addSoftSpace();
98
98
  }
99
99
  return;
100
100
  }
101
- this.state.eatWhitespace = false;
101
+ this.#state.eatWhitespace = false;
102
102
  if (token === '\n') {
103
103
  return;
104
104
  }
105
105
 
106
106
  if (token !== '}') {
107
- if (this.state.afterClosingBrace) {
108
- this.builder.addNewLine(true);
107
+ if (this.#state.afterClosingBrace) {
108
+ this.#builder.addNewLine(true);
109
109
  }
110
- this.state.afterClosingBrace = false;
110
+ this.#state.afterClosingBrace = false;
111
111
  }
112
112
  if (token === '}') {
113
- if (this.state.inPropertyValue) {
114
- this.builder.addNewLine();
113
+ if (this.#state.inPropertyValue) {
114
+ this.#builder.addNewLine();
115
115
  }
116
- this.builder.decreaseNestingLevel();
117
- this.state.afterClosingBrace = true;
118
- this.state.inPropertyValue = false;
119
- } else if (token === ':' && !this.state.inPropertyValue && this.state.seenProperty) {
120
- this.builder.addToken(token, startPosition);
121
- this.builder.addSoftSpace();
122
- this.state.eatWhitespace = true;
123
- this.state.inPropertyValue = true;
124
- this.state.seenProperty = false;
116
+ this.#builder.decreaseNestingLevel();
117
+ this.#state.afterClosingBrace = true;
118
+ this.#state.inPropertyValue = false;
119
+ } else if (token === ':' && !this.#state.inPropertyValue && this.#state.seenProperty) {
120
+ this.#builder.addToken(token, startPosition);
121
+ this.#builder.addSoftSpace();
122
+ this.#state.eatWhitespace = true;
123
+ this.#state.inPropertyValue = true;
124
+ this.#state.seenProperty = false;
125
125
  return;
126
126
  } else if (token === '{') {
127
- this.builder.addSoftSpace();
128
- this.builder.addToken(token, startPosition);
129
- this.builder.addNewLine();
130
- this.builder.increaseNestingLevel();
127
+ this.#builder.addSoftSpace();
128
+ this.#builder.addToken(token, startPosition);
129
+ this.#builder.addNewLine();
130
+ this.#builder.increaseNestingLevel();
131
131
  return;
132
132
  }
133
133
 
134
- this.builder.addToken(cssTrimEnd(token), startPosition);
134
+ this.#builder.addToken(cssTrimEnd(token), startPosition);
135
135
 
136
- if (type === 'comment' && !this.state.inPropertyValue && !this.state.seenProperty) {
137
- this.builder.addNewLine();
136
+ if (type === 'comment' && !this.#state.inPropertyValue && !this.#state.seenProperty) {
137
+ this.#builder.addNewLine();
138
138
  }
139
- if (token === ';' && this.state.inPropertyValue) {
140
- this.state.inPropertyValue = false;
141
- this.builder.addNewLine();
139
+ if (token === ';' && this.#state.inPropertyValue) {
140
+ this.#state.inPropertyValue = false;
141
+ this.#builder.addNewLine();
142
142
  } else if (token === '}') {
143
- this.builder.addNewLine();
143
+ this.#builder.addNewLine();
144
144
  }
145
145
  }
146
146
  }
@@ -7,16 +7,16 @@ import type * as Acorn from '../../third_party/acorn/acorn.js';
7
7
  const SkipSubTreeObject: Object = {};
8
8
 
9
9
  export class ESTreeWalker {
10
- private readonly beforeVisit: (arg0: Acorn.ESTree.Node) => (Object | undefined);
11
- private readonly afterVisit: Function;
12
- private walkNulls: boolean;
10
+ readonly #beforeVisit: (arg0: Acorn.ESTree.Node) => (Object | undefined);
11
+ readonly #afterVisit: Function;
12
+ #walkNulls: boolean;
13
13
 
14
14
  constructor(
15
15
  beforeVisit: (arg0: Acorn.ESTree.Node) => (Object | undefined),
16
16
  afterVisit?: ((arg0: Acorn.ESTree.Node) => void)) {
17
- this.beforeVisit = beforeVisit;
18
- this.afterVisit = afterVisit || function(): void {};
19
- this.walkNulls = false;
17
+ this.#beforeVisit = beforeVisit;
18
+ this.#afterVisit = afterVisit || function(): void {};
19
+ this.#walkNulls = false;
20
20
  }
21
21
 
22
22
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
@@ -26,15 +26,15 @@ export class ESTreeWalker {
26
26
  }
27
27
 
28
28
  setWalkNulls(value: boolean): void {
29
- this.walkNulls = value;
29
+ this.#walkNulls = value;
30
30
  }
31
31
 
32
32
  walk(ast: Acorn.ESTree.Node): void {
33
- this.innerWalk(ast, null);
33
+ this.#innerWalk(ast, null);
34
34
  }
35
35
 
36
- private innerWalk(node: Acorn.ESTree.Node, parent: Acorn.ESTree.Node|null): void {
37
- if (!node && parent && this.walkNulls) {
36
+ #innerWalk(node: Acorn.ESTree.Node, parent: Acorn.ESTree.Node|null): void {
37
+ if (!node && parent && this.#walkNulls) {
38
38
  const result = ({raw: 'null', value: null, parent: null} as Acorn.ESTree.SimpleLiteral);
39
39
  // Otherwise Closure can't handle the definition
40
40
  result.type = 'Literal';
@@ -47,8 +47,8 @@ export class ESTreeWalker {
47
47
  }
48
48
  node.parent = parent;
49
49
 
50
- if (this.beforeVisit.call(null, node) === ESTreeWalker.SkipSubtree) {
51
- this.afterVisit.call(null, node);
50
+ if (this.#beforeVisit.call(null, node) === ESTreeWalker.SkipSubtree) {
51
+ this.#afterVisit.call(null, node);
52
52
  return;
53
53
  }
54
54
 
@@ -62,10 +62,10 @@ export class ESTreeWalker {
62
62
  const templateLiteral = (node as Acorn.ESTree.TemplateLiteral);
63
63
  const expressionsLength = templateLiteral.expressions.length;
64
64
  for (let i = 0; i < expressionsLength; ++i) {
65
- this.innerWalk(templateLiteral.quasis[i], templateLiteral);
66
- this.innerWalk(templateLiteral.expressions[i], templateLiteral);
65
+ this.#innerWalk(templateLiteral.quasis[i], templateLiteral);
66
+ this.#innerWalk(templateLiteral.expressions[i], templateLiteral);
67
67
  }
68
- this.innerWalk(templateLiteral.quasis[expressionsLength], templateLiteral);
68
+ this.#innerWalk(templateLiteral.quasis[expressionsLength], templateLiteral);
69
69
  } else {
70
70
  for (let i = 0; i < walkOrder.length; ++i) {
71
71
  // @ts-ignore We are doing type traversal here, but the strings
@@ -75,19 +75,19 @@ export class ESTreeWalker {
75
75
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
76
76
  const entity = (node[walkOrder[i]] as any);
77
77
  if (Array.isArray(entity)) {
78
- this.walkArray((entity as Acorn.ESTree.Node[]), node);
78
+ this.#walkArray((entity as Acorn.ESTree.Node[]), node);
79
79
  } else {
80
- this.innerWalk((entity as Acorn.ESTree.Node), node);
80
+ this.#innerWalk((entity as Acorn.ESTree.Node), node);
81
81
  }
82
82
  }
83
83
  }
84
84
 
85
- this.afterVisit.call(null, node);
85
+ this.#afterVisit.call(null, node);
86
86
  }
87
87
 
88
- private walkArray(nodeArray: Acorn.ESTree.Node[], parentNode: Acorn.ESTree.Node|null): void {
88
+ #walkArray(nodeArray: Acorn.ESTree.Node[], parentNode: Acorn.ESTree.Node|null): void {
89
89
  for (let i = 0; i < nodeArray.length; ++i) {
90
- this.innerWalk(nodeArray[i], parentNode);
90
+ this.#innerWalk(nodeArray[i], parentNode);
91
91
  }
92
92
  }
93
93
  }