chrome-devtools-frontend 1.0.951864 → 1.0.952284

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 (144) hide show
  1. package/front_end/.eslintrc.js +6 -0
  2. package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +36 -36
  3. package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +53 -53
  4. package/front_end/entrypoints/formatter_worker/ESTreeWalker.ts +11 -11
  5. package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +43 -43
  6. package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +106 -105
  7. package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +26 -26
  8. package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +50 -55
  9. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +200 -200
  10. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +84 -83
  11. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +15 -15
  12. package/front_end/entrypoints/inspector_main/InspectorMain.ts +21 -21
  13. package/front_end/entrypoints/main/ExecutionContextSelector.ts +30 -30
  14. package/front_end/entrypoints/main/MainImpl.ts +12 -12
  15. package/front_end/entrypoints/node_app/NodeConnectionsPanel.ts +33 -33
  16. package/front_end/entrypoints/node_app/NodeMain.ts +35 -35
  17. package/front_end/generated/InspectorBackendCommands.js +5 -1
  18. package/front_end/generated/protocol.d.ts +16 -0
  19. package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +6 -6
  20. package/front_end/models/issues_manager/ContrastCheckTrigger.ts +15 -15
  21. package/front_end/models/issues_manager/CorsIssue.ts +9 -9
  22. package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +5 -5
  23. package/front_end/models/issues_manager/DeprecationIssue.ts +7 -7
  24. package/front_end/models/issues_manager/GenericIssue.ts +5 -5
  25. package/front_end/models/issues_manager/HeavyAdIssue.ts +5 -5
  26. package/front_end/models/issues_manager/Issue.ts +10 -10
  27. package/front_end/models/issues_manager/IssueResolver.ts +11 -10
  28. package/front_end/models/issues_manager/IssuesManager.ts +56 -56
  29. package/front_end/models/issues_manager/LowTextContrastIssue.ts +4 -4
  30. package/front_end/models/issues_manager/MixedContentIssue.ts +7 -7
  31. package/front_end/models/issues_manager/NavigatorUserAgentIssue.ts +7 -7
  32. package/front_end/models/issues_manager/QuirksModeIssue.ts +4 -4
  33. package/front_end/models/issues_manager/SameSiteCookieIssue.ts +16 -16
  34. package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +5 -5
  35. package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +32 -31
  36. package/front_end/models/issues_manager/TrustedWebActivityIssue.ts +5 -5
  37. package/front_end/models/issues_manager/WasmCrossOriginModuleSharingIssue.ts +5 -5
  38. package/front_end/panels/application/components/BackForwardCacheView.ts +33 -33
  39. package/front_end/panels/application/components/EndpointsGrid.ts +12 -12
  40. package/front_end/panels/application/components/FrameDetailsView.ts +108 -110
  41. package/front_end/panels/application/components/OriginTrialTreeView.ts +45 -45
  42. package/front_end/panels/application/components/PermissionsPolicySection.ts +19 -19
  43. package/front_end/panels/application/components/ReportsGrid.ts +30 -30
  44. package/front_end/panels/application/components/StackTrace.ts +48 -47
  45. package/front_end/panels/application/components/TrustTokensView.ts +31 -31
  46. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +41 -52
  47. package/front_end/panels/css_overview/CSSOverviewController.ts +2 -2
  48. package/front_end/panels/css_overview/CSSOverviewPanel.ts +18 -27
  49. package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +2 -2
  50. package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +6 -6
  51. package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +4 -4
  52. package/front_end/panels/elements/components/AccessibilityTreeNode.ts +17 -17
  53. package/front_end/panels/elements/components/AdornerManager.ts +21 -21
  54. package/front_end/panels/elements/components/AdornerSettingsPane.ts +14 -14
  55. package/front_end/panels/elements/components/CSSQuery.ts +16 -16
  56. package/front_end/panels/elements/components/ComputedStyleProperty.ts +14 -14
  57. package/front_end/panels/elements/components/ComputedStyleTrace.ts +15 -15
  58. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +78 -78
  59. package/front_end/panels/elements/components/ElementsPanelLink.ts +16 -16
  60. package/front_end/panels/elements/components/LayoutPane.ts +47 -47
  61. package/front_end/panels/elements/components/NodeText.ts +18 -18
  62. package/front_end/panels/elements/components/QueryContainer.ts +40 -40
  63. package/front_end/panels/elements/components/StylePropertyEditor.ts +18 -18
  64. package/front_end/panels/emulation/components/DeviceSizeInputElement.ts +4 -4
  65. package/front_end/panels/issues/AffectedBlockedByResponseView.ts +4 -4
  66. package/front_end/panels/issues/AffectedCookiesView.ts +4 -5
  67. package/front_end/panels/issues/AffectedDirectivesView.ts +19 -19
  68. package/front_end/panels/issues/AffectedDocumentsInQuirksModeView.ts +7 -8
  69. package/front_end/panels/issues/AffectedElementsView.ts +4 -4
  70. package/front_end/panels/issues/AffectedElementsWithLowContrastView.ts +7 -8
  71. package/front_end/panels/issues/AffectedHeavyAdView.ts +8 -8
  72. package/front_end/panels/issues/AffectedResourcesView.ts +25 -26
  73. package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +8 -8
  74. package/front_end/panels/issues/AffectedSourcesView.ts +4 -4
  75. package/front_end/panels/issues/AffectedTrustedWebActivityIssueDetailsView.ts +4 -4
  76. package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +17 -17
  77. package/front_end/panels/issues/CSPViolationsListView.ts +22 -23
  78. package/front_end/panels/issues/CSPViolationsView.ts +17 -17
  79. package/front_end/panels/issues/ComboBoxOfCheckBoxes.ts +13 -13
  80. package/front_end/panels/issues/CorsIssueDetailsView.ts +23 -23
  81. package/front_end/panels/issues/GenericIssueDetailsView.ts +4 -4
  82. package/front_end/panels/issues/HiddenIssuesRow.ts +7 -7
  83. package/front_end/panels/issues/IssueAggregator.ts +95 -95
  84. package/front_end/panels/issues/IssueKindView.ts +14 -14
  85. package/front_end/panels/issues/IssueView.ts +98 -98
  86. package/front_end/panels/issues/IssuesPane.ts +102 -102
  87. package/front_end/panels/issues/WasmCrossOriginModuleSharingAffectedResourcesView.ts +5 -5
  88. package/front_end/panels/issues/components/HideIssuesMenu.ts +10 -10
  89. package/front_end/panels/media/PlayerListView.ts +160 -97
  90. package/front_end/panels/media/PlayerMessagesView.ts +1 -0
  91. package/front_end/panels/media/playerListView.css +58 -0
  92. package/front_end/panels/network/NetworkLogView.ts +2 -6
  93. package/front_end/panels/network/NetworkWaterfallColumn.ts +2 -4
  94. package/front_end/panels/network/components/RequestTrustTokensView.ts +40 -40
  95. package/front_end/panels/network/components/WebBundleInfoView.ts +9 -9
  96. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +6 -12
  97. package/front_end/panels/settings/components/SyncSection.ts +14 -14
  98. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +96 -96
  99. package/front_end/panels/sources/BreakpointEditDialog.ts +4 -3
  100. package/front_end/panels/timeline/components/WebVitalsLane.ts +77 -76
  101. package/front_end/panels/timeline/components/WebVitalsTimeline.ts +133 -133
  102. package/front_end/panels/timeline/components/WebVitalsTooltip.ts +9 -9
  103. package/front_end/panels/webauthn/WebauthnPane.ts +203 -205
  104. package/front_end/ui/components/adorners/Adorner.ts +2 -2
  105. package/front_end/ui/components/buttons/Button.ts +9 -9
  106. package/front_end/ui/components/data_grid/DataGrid.ts +62 -62
  107. package/front_end/ui/components/data_grid/DataGridController.ts +22 -22
  108. package/front_end/ui/components/diff_view/DiffView.ts +6 -6
  109. package/front_end/ui/components/expandable_list/ExpandableList.ts +5 -5
  110. package/front_end/ui/components/icon_button/Icon.ts +4 -4
  111. package/front_end/ui/components/icon_button/IconButton.ts +4 -4
  112. package/front_end/ui/components/issue_counter/IssueCounter.ts +3 -3
  113. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +11 -11
  114. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +50 -50
  115. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +6 -6
  116. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +4 -4
  117. package/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator.ts +12 -12
  118. package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +11 -11
  119. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +40 -39
  120. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +18 -18
  121. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings.ts +6 -6
  122. package/front_end/ui/components/linkifier/LinkifierImpl.ts +4 -4
  123. package/front_end/ui/components/markdown_view/MarkdownImage.ts +5 -5
  124. package/front_end/ui/components/markdown_view/MarkdownLink.ts +2 -2
  125. package/front_end/ui/components/markdown_view/MarkdownView.ts +4 -4
  126. package/front_end/ui/components/panel_feedback/FeedbackButton.ts +2 -2
  127. package/front_end/ui/components/panel_feedback/PanelFeedback.ts +2 -2
  128. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +4 -4
  129. package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +22 -22
  130. package/front_end/ui/components/report_view/ReportView.ts +16 -16
  131. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +14 -14
  132. package/front_end/ui/components/settings/SettingCheckbox.ts +5 -5
  133. package/front_end/ui/components/survey_link/SurveyLink.ts +8 -8
  134. package/front_end/ui/components/text_editor/TextEditor.ts +9 -9
  135. package/front_end/ui/components/text_prompt/TextPrompt.ts +18 -18
  136. package/front_end/ui/components/tree_outline/TreeOutline.ts +69 -70
  137. package/front_end/ui/legacy/themeColors.css +2 -0
  138. package/front_end/ui/legacy/theme_support/theme_support_impl.ts +12 -0
  139. package/package.json +1 -1
  140. package/scripts/eslint_rules/lib/use_private_class_members.js +41 -0
  141. package/scripts/eslint_rules/tests/use_private_class_members_test.js +62 -0
  142. package/scripts/migration/class-fields/migrate.js +2 -3
  143. package/scripts/migration/class-fields/migrate.sh +1 -3
  144. package/scripts/migration/class-fields/package.json +1 -1
@@ -34,27 +34,27 @@ import type {HeapSnapshotHeader, Profile} from './HeapSnapshot.js';
34
34
  import type {HeapSnapshotWorkerDispatcher} from './HeapSnapshotWorkerDispatcher.js';
35
35
 
36
36
  export class HeapSnapshotLoader {
37
- private readonly progress: HeapSnapshotProgress;
38
- private buffer: string;
39
- private dataCallback: ((value: string|PromiseLike<string>) => void)|null;
40
- private done: boolean;
37
+ readonly #progress: HeapSnapshotProgress;
38
+ #buffer: string;
39
+ #dataCallback: ((value: string|PromiseLike<string>) => void)|null;
40
+ #done: boolean;
41
41
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
42
42
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
43
- private snapshot?: {[x: string]: any};
44
- private array!: number[]|Uint32Array|null;
45
- private arrayIndex!: number;
43
+ #snapshot?: {[x: string]: any};
44
+ #array!: number[]|Uint32Array|null;
45
+ #arrayIndex!: number;
46
46
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
47
47
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
48
- private json?: any;
48
+ #json?: any;
49
49
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
50
50
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
51
- private jsonTokenizer?: any;
51
+ #jsonTokenizer?: any;
52
52
  constructor(dispatcher: HeapSnapshotWorkerDispatcher) {
53
53
  this.reset();
54
- this.progress = new HeapSnapshotProgress(dispatcher);
55
- this.buffer = '';
56
- this.dataCallback = null;
57
- this.done = false;
54
+ this.#progress = new HeapSnapshotProgress(dispatcher);
55
+ this.#buffer = '';
56
+ this.#dataCallback = null;
57
+ this.#done = false;
58
58
  this.parseInput();
59
59
  }
60
60
 
@@ -63,22 +63,22 @@ export class HeapSnapshotLoader {
63
63
  }
64
64
 
65
65
  private reset(): void {
66
- this.json = '';
67
- this.snapshot = undefined;
66
+ this.#json = '';
67
+ this.#snapshot = undefined;
68
68
  }
69
69
 
70
70
  close(): void {
71
- this.done = true;
72
- if (this.dataCallback) {
73
- this.dataCallback('');
71
+ this.#done = true;
72
+ if (this.#dataCallback) {
73
+ this.#dataCallback('');
74
74
  }
75
75
  }
76
76
 
77
77
  buildSnapshot(): JSHeapSnapshot {
78
- this.snapshot = this.snapshot || {};
78
+ this.#snapshot = this.#snapshot || {};
79
79
 
80
- this.progress.updateStatus('Processing snapshot…');
81
- const result = new JSHeapSnapshot((this.snapshot as Profile), this.progress);
80
+ this.#progress.updateStatus('Processing snapshot…');
81
+ const result = new JSHeapSnapshot((this.#snapshot as Profile), this.#progress);
82
82
  this.reset();
83
83
  return result;
84
84
  }
@@ -88,26 +88,26 @@ export class HeapSnapshotLoader {
88
88
  const char0 = '0'.charCodeAt(0);
89
89
  const char9 = '9'.charCodeAt(0);
90
90
  const closingBracket = ']'.charCodeAt(0);
91
- const length = this.json.length;
91
+ const length = this.#json.length;
92
92
  while (true) {
93
93
  while (index < length) {
94
- const code = this.json.charCodeAt(index);
94
+ const code = this.#json.charCodeAt(index);
95
95
  if (char0 <= code && code <= char9) {
96
96
  break;
97
97
  } else if (code === closingBracket) {
98
- this.json = this.json.slice(index + 1);
98
+ this.#json = this.#json.slice(index + 1);
99
99
  return false;
100
100
  }
101
101
  ++index;
102
102
  }
103
103
  if (index === length) {
104
- this.json = '';
104
+ this.#json = '';
105
105
  return true;
106
106
  }
107
107
  let nextNumber = 0;
108
108
  const startIndex = index;
109
109
  while (index < length) {
110
- const code = this.json.charCodeAt(index);
110
+ const code = this.#json.charCodeAt(index);
111
111
  if (char0 > code || code > char9) {
112
112
  break;
113
113
  }
@@ -116,73 +116,73 @@ export class HeapSnapshotLoader {
116
116
  ++index;
117
117
  }
118
118
  if (index === length) {
119
- this.json = this.json.slice(startIndex);
119
+ this.#json = this.#json.slice(startIndex);
120
120
  return true;
121
121
  }
122
- if (!this.array) {
122
+ if (!this.#array) {
123
123
  throw new Error('Array not instantiated');
124
124
  }
125
- this.array[this.arrayIndex++] = nextNumber;
125
+ this.#array[this.#arrayIndex++] = nextNumber;
126
126
  }
127
127
  }
128
128
 
129
129
  private parseStringsArray(): void {
130
- this.progress.updateStatus('Parsing strings…');
131
- const closingBracketIndex = this.json.lastIndexOf(']');
130
+ this.#progress.updateStatus('Parsing strings…');
131
+ const closingBracketIndex = this.#json.lastIndexOf(']');
132
132
  if (closingBracketIndex === -1) {
133
133
  throw new Error('Incomplete JSON');
134
134
  }
135
- this.json = this.json.slice(0, closingBracketIndex + 1);
135
+ this.#json = this.#json.slice(0, closingBracketIndex + 1);
136
136
 
137
- if (!this.snapshot) {
137
+ if (!this.#snapshot) {
138
138
  throw new Error('No snapshot in parseStringsArray');
139
139
  }
140
- this.snapshot.strings = JSON.parse(this.json);
140
+ this.#snapshot.strings = JSON.parse(this.#json);
141
141
  }
142
142
 
143
143
  write(chunk: string): void {
144
- this.buffer += chunk;
145
- if (!this.dataCallback) {
144
+ this.#buffer += chunk;
145
+ if (!this.#dataCallback) {
146
146
  return;
147
147
  }
148
- this.dataCallback(this.buffer);
149
- this.dataCallback = null;
150
- this.buffer = '';
148
+ this.#dataCallback(this.#buffer);
149
+ this.#dataCallback = null;
150
+ this.#buffer = '';
151
151
  }
152
152
 
153
153
  private fetchChunk(): Promise<string> {
154
- return this.done ? Promise.resolve(this.buffer) : new Promise(r => {
155
- this.dataCallback = r;
154
+ return this.#done ? Promise.resolve(this.#buffer) : new Promise(r => {
155
+ this.#dataCallback = r;
156
156
  });
157
157
  }
158
158
 
159
159
  private async findToken(token: string, startIndex?: number): Promise<number> {
160
160
  while (true) {
161
- const pos = this.json.indexOf(token, startIndex || 0);
161
+ const pos = this.#json.indexOf(token, startIndex || 0);
162
162
  if (pos !== -1) {
163
163
  return pos;
164
164
  }
165
- startIndex = this.json.length - token.length + 1;
166
- this.json += await this.fetchChunk();
165
+ startIndex = this.#json.length - token.length + 1;
166
+ this.#json += await this.fetchChunk();
167
167
  }
168
168
  }
169
169
 
170
170
  private async parseArray(name: string, title: string, length?: number): Promise<number[]|Uint32Array> {
171
171
  const nameIndex = await this.findToken(name);
172
172
  const bracketIndex = await this.findToken('[', nameIndex);
173
- this.json = this.json.slice(bracketIndex + 1);
174
- this.array = length ? new Uint32Array(length) : [];
175
- this.arrayIndex = 0;
173
+ this.#json = this.#json.slice(bracketIndex + 1);
174
+ this.#array = length ? new Uint32Array(length) : [];
175
+ this.#arrayIndex = 0;
176
176
  while (this.parseUintArray()) {
177
177
  if (length) {
178
- this.progress.updateProgress(title, this.arrayIndex, this.array.length);
178
+ this.#progress.updateProgress(title, this.#arrayIndex, this.#array.length);
179
179
  } else {
180
- this.progress.updateStatus(title);
180
+ this.#progress.updateStatus(title);
181
181
  }
182
- this.json += await this.fetchChunk();
182
+ this.#json += await this.fetchChunk();
183
183
  }
184
- const result = this.array;
185
- this.array = null;
184
+ const result = this.#array;
185
+ this.#array = null;
186
186
  return result;
187
187
  }
188
188
 
@@ -193,63 +193,64 @@ export class HeapSnapshotLoader {
193
193
  throw new Error('Snapshot token not found');
194
194
  }
195
195
 
196
- this.progress.updateStatus('Loading snapshot info…');
197
- const json = this.json.slice(snapshotTokenIndex + snapshotToken.length + 1);
198
- this.jsonTokenizer = new TextUtils.TextUtils.BalancedJSONTokenizer(metaJSON => {
199
- this.json = this.jsonTokenizer.remainder();
200
- this.jsonTokenizer = null;
196
+ this.#progress.updateStatus('Loading snapshot info…');
197
+ const json = this.#json.slice(snapshotTokenIndex + snapshotToken.length + 1);
198
+ this.#jsonTokenizer = new TextUtils.TextUtils.BalancedJSONTokenizer(metaJSON => {
199
+ this.#json = this.#jsonTokenizer.remainder();
200
+ this.#jsonTokenizer = null;
201
201
 
202
- this.snapshot = this.snapshot || {};
203
- this.snapshot.snapshot = (JSON.parse(metaJSON) as HeapSnapshotHeader);
202
+ this.#snapshot = this.#snapshot || {};
203
+ this.#snapshot.snapshot = (JSON.parse(metaJSON) as HeapSnapshotHeader);
204
204
  });
205
- this.jsonTokenizer.write(json);
206
- while (this.jsonTokenizer) {
207
- this.jsonTokenizer.write(await this.fetchChunk());
205
+ this.#jsonTokenizer.write(json);
206
+ while (this.#jsonTokenizer) {
207
+ this.#jsonTokenizer.write(await this.fetchChunk());
208
208
  }
209
209
 
210
- this.snapshot = this.snapshot || {};
210
+ this.#snapshot = this.#snapshot || {};
211
211
  const nodes = await this.parseArray(
212
212
  '"nodes"', 'Loading nodes… {PH1}%',
213
- this.snapshot.snapshot.meta.node_fields.length * this.snapshot.snapshot.node_count);
214
- this.snapshot.nodes = (nodes as Uint32Array);
213
+ this.#snapshot.snapshot.meta.node_fields.length * this.#snapshot.snapshot.node_count);
214
+ this.#snapshot.nodes = (nodes as Uint32Array);
215
215
 
216
216
  const edges = await this.parseArray(
217
217
  '"edges"', 'Loading edges… {PH1}%',
218
- this.snapshot.snapshot.meta.edge_fields.length * this.snapshot.snapshot.edge_count);
219
- this.snapshot.edges = (edges as Uint32Array);
218
+ this.#snapshot.snapshot.meta.edge_fields.length * this.#snapshot.snapshot.edge_count);
219
+ this.#snapshot.edges = (edges as Uint32Array);
220
220
 
221
- if (this.snapshot.snapshot.trace_function_count) {
221
+ if (this.#snapshot.snapshot.trace_function_count) {
222
222
  const traceFunctionInfos = await this.parseArray(
223
223
  '"trace_function_infos"', 'Loading allocation traces… {PH1}%',
224
- this.snapshot.snapshot.meta.trace_function_info_fields.length * this.snapshot.snapshot.trace_function_count);
225
- this.snapshot.trace_function_infos = (traceFunctionInfos as Uint32Array);
224
+ this.#snapshot.snapshot.meta.trace_function_info_fields.length *
225
+ this.#snapshot.snapshot.trace_function_count);
226
+ this.#snapshot.trace_function_infos = (traceFunctionInfos as Uint32Array);
226
227
 
227
228
  const thisTokenEndIndex = await this.findToken(':');
228
229
  const nextTokenIndex = await this.findToken('"', thisTokenEndIndex);
229
- const openBracketIndex = this.json.indexOf('[');
230
- const closeBracketIndex = this.json.lastIndexOf(']', nextTokenIndex);
231
- this.snapshot.trace_tree = JSON.parse(this.json.substring(openBracketIndex, closeBracketIndex + 1));
232
- this.json = this.json.slice(closeBracketIndex + 1);
230
+ const openBracketIndex = this.#json.indexOf('[');
231
+ const closeBracketIndex = this.#json.lastIndexOf(']', nextTokenIndex);
232
+ this.#snapshot.trace_tree = JSON.parse(this.#json.substring(openBracketIndex, closeBracketIndex + 1));
233
+ this.#json = this.#json.slice(closeBracketIndex + 1);
233
234
  }
234
235
 
235
- if (this.snapshot.snapshot.meta.sample_fields) {
236
+ if (this.#snapshot.snapshot.meta.sample_fields) {
236
237
  const samples = await this.parseArray('"samples"', 'Loading samples…');
237
- this.snapshot.samples = (samples as number[]);
238
+ this.#snapshot.samples = (samples as number[]);
238
239
  }
239
240
 
240
- if (this.snapshot.snapshot.meta['location_fields']) {
241
+ if (this.#snapshot.snapshot.meta['location_fields']) {
241
242
  const locations = await this.parseArray('"locations"', 'Loading locations…');
242
- this.snapshot.locations = (locations as number[]);
243
+ this.#snapshot.locations = (locations as number[]);
243
244
  } else {
244
- this.snapshot.locations = [];
245
+ this.#snapshot.locations = [];
245
246
  }
246
247
 
247
- this.progress.updateStatus('Loading strings…');
248
+ this.#progress.updateStatus('Loading strings…');
248
249
  const stringsTokenIndex = await this.findToken('"strings"');
249
250
  const bracketIndex = await this.findToken('[', stringsTokenIndex);
250
- this.json = this.json.slice(bracketIndex);
251
- while (!this.done) {
252
- this.json += await this.fetchChunk();
251
+ this.#json = this.#json.slice(bracketIndex);
252
+ while (!this.#done) {
253
+ this.#json += await this.fetchChunk();
253
254
  }
254
255
  this.parseStringsArray();
255
256
  }
@@ -41,20 +41,20 @@ interface DispatcherResponse {
41
41
  export class HeapSnapshotWorkerDispatcher {
42
42
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
43
43
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
44
- private objects: any[];
45
- private readonly global: Worker;
46
- private readonly postMessage: Function;
44
+ #objects: any[];
45
+ readonly #global: Worker;
46
+ readonly #postMessage: Function;
47
47
  constructor(globalObject: Worker, postMessage: Function) {
48
- this.objects = [];
49
- this.global = globalObject;
50
- this.postMessage = postMessage;
48
+ this.#objects = [];
49
+ this.#global = globalObject;
50
+ this.#postMessage = postMessage;
51
51
  }
52
52
 
53
53
  private findFunction(name: string): Function {
54
54
  const path = name.split('.');
55
55
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
56
56
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
- let result = (this.global as any);
57
+ let result = (this.#global as any);
58
58
  for (let i = 0; i < path.length; ++i) {
59
59
  result = result[path[i]];
60
60
  }
@@ -64,7 +64,7 @@ export class HeapSnapshotWorkerDispatcher {
64
64
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
65
65
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
66
66
  sendEvent(name: string, data: any): void {
67
- this.postMessage({eventName: name, data: data});
67
+ this.#postMessage({eventName: name, data: data});
68
68
  }
69
69
 
70
70
  dispatchMessage({data}: {data: HeapSnapshotModel.HeapSnapshotModel.WorkerCommand}): void {
@@ -75,30 +75,30 @@ export class HeapSnapshotWorkerDispatcher {
75
75
  case 'create': {
76
76
  const constructorFunction = this.findFunction(data.methodName);
77
77
  // @ts-ignore
78
- this.objects[data.objectId] = new constructorFunction(this);
78
+ this.#objects[data.objectId] = new constructorFunction(this);
79
79
  break;
80
80
  }
81
81
  case 'dispose': {
82
- delete this.objects[data.objectId];
82
+ delete this.#objects[data.objectId];
83
83
  break;
84
84
  }
85
85
  case 'getter': {
86
- const object = this.objects[data.objectId];
86
+ const object = this.#objects[data.objectId];
87
87
  const result = object[data.methodName];
88
88
  response.result = result;
89
89
  break;
90
90
  }
91
91
  case 'factory': {
92
- const object = this.objects[data.objectId];
92
+ const object = this.#objects[data.objectId];
93
93
  const result = object[data.methodName].apply(object, data.methodArguments);
94
94
  if (result) {
95
- this.objects[data.newObjectId] = result;
95
+ this.#objects[data.newObjectId] = result;
96
96
  }
97
97
  response.result = Boolean(result);
98
98
  break;
99
99
  }
100
100
  case 'method': {
101
- const object = this.objects[data.objectId];
101
+ const object = this.#objects[data.objectId];
102
102
  response.result = object[data.methodName].apply(object, data.methodArguments);
103
103
  break;
104
104
  }
@@ -118,6 +118,6 @@ export class HeapSnapshotWorkerDispatcher {
118
118
  response.errorMethodName = data.methodName;
119
119
  }
120
120
  }
121
- this.postMessage(response);
121
+ this.#postMessage(response);
122
122
  }
123
123
  }
@@ -145,20 +145,20 @@ export class FocusDebuggeeActionDelegate implements UI.ActionRegistration.Action
145
145
  let nodeIndicatorInstance: NodeIndicator;
146
146
 
147
147
  export class NodeIndicator implements UI.Toolbar.Provider {
148
- private readonly element: Element;
149
- private readonly button: UI.Toolbar.ToolbarItem;
148
+ readonly #element: Element;
149
+ readonly #button: UI.Toolbar.ToolbarItem;
150
150
  private constructor() {
151
151
  const element = document.createElement('div');
152
152
  const shadowRoot =
153
153
  UI.Utils.createShadowRootWithCoreStyles(element, {cssFile: [nodeIconStyles], delegatesFocus: undefined});
154
- this.element = shadowRoot.createChild('div', 'node-icon');
154
+ this.#element = shadowRoot.createChild('div', 'node-icon');
155
155
  element.addEventListener(
156
156
  'click', () => Host.InspectorFrontendHost.InspectorFrontendHostInstance.openNodeFrontend(), false);
157
- this.button = new UI.Toolbar.ToolbarItem(element);
158
- this.button.setTitle(i18nString(UIStrings.openDedicatedTools));
157
+ this.#button = new UI.Toolbar.ToolbarItem(element);
158
+ this.#button.setTitle(i18nString(UIStrings.openDedicatedTools));
159
159
  SDK.TargetManager.TargetManager.instance().addEventListener(
160
160
  SDK.TargetManager.Events.AvailableTargetsChanged, event => this.update(event.data));
161
- this.button.setVisible(false);
161
+ this.#button.setVisible(false);
162
162
  this.update([]);
163
163
  }
164
164
  static instance(opts: {
@@ -174,14 +174,14 @@ export class NodeIndicator implements UI.Toolbar.Provider {
174
174
 
175
175
  private update(targetInfos: Protocol.Target.TargetInfo[]): void {
176
176
  const hasNode = Boolean(targetInfos.find(target => target.type === 'node' && !target.attached));
177
- this.element.classList.toggle('inactive', !hasNode);
177
+ this.#element.classList.toggle('inactive', !hasNode);
178
178
  if (hasNode) {
179
- this.button.setVisible(true);
179
+ this.#button.setVisible(true);
180
180
  }
181
181
  }
182
182
 
183
183
  item(): UI.Toolbar.ToolbarItem|null {
184
- return this.button;
184
+ return this.#button;
185
185
  }
186
186
  }
187
187
 
@@ -205,20 +205,20 @@ export class SourcesPanelIndicator {
205
205
  }
206
206
 
207
207
  export class BackendSettingsSync implements SDK.TargetManager.Observer {
208
- private readonly autoAttachSetting: Common.Settings.Setting<boolean>;
209
- private readonly adBlockEnabledSetting: Common.Settings.Setting<boolean>;
210
- private readonly emulatePageFocusSetting: Common.Settings.Setting<boolean>;
208
+ readonly #autoAttachSetting: Common.Settings.Setting<boolean>;
209
+ readonly #adBlockEnabledSetting: Common.Settings.Setting<boolean>;
210
+ readonly #emulatePageFocusSetting: Common.Settings.Setting<boolean>;
211
211
 
212
212
  constructor() {
213
- this.autoAttachSetting = Common.Settings.Settings.instance().moduleSetting('autoAttachToCreatedPages');
214
- this.autoAttachSetting.addChangeListener(this.updateAutoAttach, this);
213
+ this.#autoAttachSetting = Common.Settings.Settings.instance().moduleSetting('autoAttachToCreatedPages');
214
+ this.#autoAttachSetting.addChangeListener(this.updateAutoAttach, this);
215
215
  this.updateAutoAttach();
216
216
 
217
- this.adBlockEnabledSetting = Common.Settings.Settings.instance().moduleSetting('network.adBlockingEnabled');
218
- this.adBlockEnabledSetting.addChangeListener(this.update, this);
217
+ this.#adBlockEnabledSetting = Common.Settings.Settings.instance().moduleSetting('network.adBlockingEnabled');
218
+ this.#adBlockEnabledSetting.addChangeListener(this.update, this);
219
219
 
220
- this.emulatePageFocusSetting = Common.Settings.Settings.instance().moduleSetting('emulatePageFocus');
221
- this.emulatePageFocusSetting.addChangeListener(this.update, this);
220
+ this.#emulatePageFocusSetting = Common.Settings.Settings.instance().moduleSetting('emulatePageFocus');
221
+ this.#emulatePageFocusSetting.addChangeListener(this.update, this);
222
222
 
223
223
  SDK.TargetManager.TargetManager.instance().observeTargets(this);
224
224
  }
@@ -227,12 +227,12 @@ export class BackendSettingsSync implements SDK.TargetManager.Observer {
227
227
  if (target.type() !== SDK.Target.Type.Frame || target.parentTarget()) {
228
228
  return;
229
229
  }
230
- target.pageAgent().invoke_setAdBlockingEnabled({enabled: this.adBlockEnabledSetting.get()});
231
- target.emulationAgent().invoke_setFocusEmulationEnabled({enabled: this.emulatePageFocusSetting.get()});
230
+ target.pageAgent().invoke_setAdBlockingEnabled({enabled: this.#adBlockEnabledSetting.get()});
231
+ target.emulationAgent().invoke_setFocusEmulationEnabled({enabled: this.#emulatePageFocusSetting.get()});
232
232
  }
233
233
 
234
234
  private updateAutoAttach(): void {
235
- Host.InspectorFrontendHost.InspectorFrontendHostInstance.setOpenNewWindowForPopups(this.autoAttachSetting.get());
235
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.setOpenNewWindowForPopups(this.#autoAttachSetting.get());
236
236
  }
237
237
 
238
238
  private update(): void {
@@ -7,10 +7,10 @@ import type * as Common from '../../core/common/common.js';
7
7
  import type * as UI from '../../ui/legacy/legacy.js';
8
8
 
9
9
  export class ExecutionContextSelector implements SDK.TargetManager.SDKModelObserver<SDK.RuntimeModel.RuntimeModel> {
10
- private targetManager: SDK.TargetManager.TargetManager;
11
- private context: UI.Context.Context;
12
- private lastSelectedContextId?: string;
13
- private ignoreContextChanged?: boolean;
10
+ #targetManager: SDK.TargetManager.TargetManager;
11
+ #context: UI.Context.Context;
12
+ #lastSelectedContextId?: string;
13
+ #ignoreContextChanged?: boolean;
14
14
 
15
15
  constructor(targetManager: SDK.TargetManager.TargetManager, context: UI.Context.Context) {
16
16
  context.addFlavorChangeListener(SDK.RuntimeModel.ExecutionContext, this.executionContextChanged, this);
@@ -25,8 +25,8 @@ export class ExecutionContextSelector implements SDK.TargetManager.SDKModelObser
25
25
  targetManager.addModelListener(
26
26
  SDK.RuntimeModel.RuntimeModel, SDK.RuntimeModel.Events.ExecutionContextOrderChanged,
27
27
  this.onExecutionContextOrderChanged, this);
28
- this.targetManager = targetManager;
29
- this.context = context;
28
+ this.#targetManager = targetManager;
29
+ this.#context = context;
30
30
  targetManager.observeModels(SDK.RuntimeModel.RuntimeModel, this);
31
31
  }
32
32
 
@@ -37,21 +37,21 @@ export class ExecutionContextSelector implements SDK.TargetManager.SDKModelObser
37
37
 
38
38
  function deferred(this: ExecutionContextSelector): void {
39
39
  // We always want the second context for the service worker targets.
40
- if (!this.context.flavor(SDK.Target.Target)) {
41
- this.context.setFlavor(SDK.Target.Target, runtimeModel.target());
40
+ if (!this.#context.flavor(SDK.Target.Target)) {
41
+ this.#context.setFlavor(SDK.Target.Target, runtimeModel.target());
42
42
  }
43
43
  }
44
44
  }
45
45
 
46
46
  modelRemoved(runtimeModel: SDK.RuntimeModel.RuntimeModel): void {
47
- const currentExecutionContext = this.context.flavor(SDK.RuntimeModel.ExecutionContext);
47
+ const currentExecutionContext = this.#context.flavor(SDK.RuntimeModel.ExecutionContext);
48
48
  if (currentExecutionContext && currentExecutionContext.runtimeModel === runtimeModel) {
49
49
  this.currentExecutionContextGone();
50
50
  }
51
51
 
52
- const models = this.targetManager.models(SDK.RuntimeModel.RuntimeModel);
53
- if (this.context.flavor(SDK.Target.Target) === runtimeModel.target() && models.length) {
54
- this.context.setFlavor(SDK.Target.Target, models[0].target());
52
+ const models = this.#targetManager.models(SDK.RuntimeModel.RuntimeModel);
53
+ if (this.#context.flavor(SDK.Target.Target) === runtimeModel.target() && models.length) {
54
+ this.#context.setFlavor(SDK.Target.Target, models[0].target());
55
55
  }
56
56
  }
57
57
 
@@ -59,9 +59,9 @@ export class ExecutionContextSelector implements SDK.TargetManager.SDKModelObser
59
59
  data: newContext,
60
60
  }: Common.EventTarget.EventTargetEvent<SDK.RuntimeModel.ExecutionContext|null>): void {
61
61
  if (newContext) {
62
- this.context.setFlavor(SDK.Target.Target, newContext.target());
63
- if (!this.ignoreContextChanged) {
64
- this.lastSelectedContextId = this.contextPersistentId(newContext);
62
+ this.#context.setFlavor(SDK.Target.Target, newContext.target());
63
+ if (!this.#ignoreContextChanged) {
64
+ this.#lastSelectedContextId = this.contextPersistentId(newContext);
65
65
  }
66
66
  }
67
67
  }
@@ -71,7 +71,7 @@ export class ExecutionContextSelector implements SDK.TargetManager.SDKModelObser
71
71
  }
72
72
 
73
73
  private targetChanged({data: newTarget}: Common.EventTarget.EventTargetEvent<SDK.Target.Target|null>): void {
74
- const currentContext = this.context.flavor(SDK.RuntimeModel.ExecutionContext);
74
+ const currentContext = this.#context.flavor(SDK.RuntimeModel.ExecutionContext);
75
75
 
76
76
  if (!newTarget || (currentContext && currentContext.target() === newTarget)) {
77
77
  return;
@@ -94,16 +94,16 @@ export class ExecutionContextSelector implements SDK.TargetManager.SDKModelObser
94
94
  newContext = executionContexts[i];
95
95
  }
96
96
  }
97
- this.ignoreContextChanged = true;
98
- this.context.setFlavor(SDK.RuntimeModel.ExecutionContext, newContext || executionContexts[0]);
99
- this.ignoreContextChanged = false;
97
+ this.#ignoreContextChanged = true;
98
+ this.#context.setFlavor(SDK.RuntimeModel.ExecutionContext, newContext || executionContexts[0]);
99
+ this.#ignoreContextChanged = false;
100
100
  }
101
101
 
102
102
  private shouldSwitchToContext(executionContext: SDK.RuntimeModel.ExecutionContext): boolean {
103
- if (this.lastSelectedContextId && this.lastSelectedContextId === this.contextPersistentId(executionContext)) {
103
+ if (this.#lastSelectedContextId && this.#lastSelectedContextId === this.contextPersistentId(executionContext)) {
104
104
  return true;
105
105
  }
106
- return !this.lastSelectedContextId && this.isDefaultContext(executionContext);
106
+ return !this.#lastSelectedContextId && this.isDefaultContext(executionContext);
107
107
  }
108
108
 
109
109
  private isDefaultContext(executionContext: SDK.RuntimeModel.ExecutionContext): boolean {
@@ -126,7 +126,7 @@ export class ExecutionContextSelector implements SDK.TargetManager.SDKModelObser
126
126
  private onExecutionContextDestroyed(event: Common.EventTarget.EventTargetEvent<SDK.RuntimeModel.ExecutionContext>):
127
127
  void {
128
128
  const executionContext = event.data;
129
- if (this.context.flavor(SDK.RuntimeModel.ExecutionContext) === executionContext) {
129
+ if (this.#context.flavor(SDK.RuntimeModel.ExecutionContext) === executionContext) {
130
130
  this.currentExecutionContextGone();
131
131
  }
132
132
  }
@@ -143,17 +143,17 @@ export class ExecutionContextSelector implements SDK.TargetManager.SDKModelObser
143
143
  }
144
144
 
145
145
  private switchContextIfNecessary(executionContext: SDK.RuntimeModel.ExecutionContext): boolean {
146
- if (!this.context.flavor(SDK.RuntimeModel.ExecutionContext) || this.shouldSwitchToContext(executionContext)) {
147
- this.ignoreContextChanged = true;
148
- this.context.setFlavor(SDK.RuntimeModel.ExecutionContext, executionContext);
149
- this.ignoreContextChanged = false;
146
+ if (!this.#context.flavor(SDK.RuntimeModel.ExecutionContext) || this.shouldSwitchToContext(executionContext)) {
147
+ this.#ignoreContextChanged = true;
148
+ this.#context.setFlavor(SDK.RuntimeModel.ExecutionContext, executionContext);
149
+ this.#ignoreContextChanged = false;
150
150
  return true;
151
151
  }
152
152
  return false;
153
153
  }
154
154
 
155
155
  private currentExecutionContextGone(): void {
156
- const runtimeModels = this.targetManager.models(SDK.RuntimeModel.RuntimeModel);
156
+ const runtimeModels = this.#targetManager.models(SDK.RuntimeModel.RuntimeModel);
157
157
  let newContext: SDK.RuntimeModel.ExecutionContext|null = null;
158
158
  for (let i = 0; i < runtimeModels.length && !newContext; ++i) {
159
159
  const executionContexts = runtimeModels[i].executionContexts();
@@ -173,8 +173,8 @@ export class ExecutionContextSelector implements SDK.TargetManager.SDKModelObser
173
173
  }
174
174
  }
175
175
  }
176
- this.ignoreContextChanged = true;
177
- this.context.setFlavor(SDK.RuntimeModel.ExecutionContext, newContext);
178
- this.ignoreContextChanged = false;
176
+ this.#ignoreContextChanged = true;
177
+ this.#context.setFlavor(SDK.RuntimeModel.ExecutionContext, newContext);
178
+ this.#ignoreContextChanged = false;
179
179
  }
180
180
  }