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
@@ -123,51 +123,51 @@ export interface HeapSnapshotItemIndexProvider {
123
123
  }
124
124
 
125
125
  export class HeapSnapshotNodeIndexProvider implements HeapSnapshotItemIndexProvider {
126
- private node: HeapSnapshotNode;
126
+ #node: HeapSnapshotNode;
127
127
  constructor(snapshot: HeapSnapshot) {
128
- this.node = snapshot.createNode();
128
+ this.#node = snapshot.createNode();
129
129
  }
130
130
 
131
131
  itemForIndex(index: number): HeapSnapshotNode {
132
- this.node.nodeIndex = index;
133
- return this.node;
132
+ this.#node.nodeIndex = index;
133
+ return this.#node;
134
134
  }
135
135
  }
136
136
 
137
137
  export class HeapSnapshotEdgeIndexProvider implements HeapSnapshotItemIndexProvider {
138
- private edge: JSHeapSnapshotEdge;
138
+ #edge: JSHeapSnapshotEdge;
139
139
  constructor(snapshot: HeapSnapshot) {
140
- this.edge = snapshot.createEdge(0);
140
+ this.#edge = snapshot.createEdge(0);
141
141
  }
142
142
 
143
143
  itemForIndex(index: number): HeapSnapshotEdge {
144
- this.edge.edgeIndex = index;
145
- return this.edge;
144
+ this.#edge.edgeIndex = index;
145
+ return this.#edge;
146
146
  }
147
147
  }
148
148
 
149
149
  export class HeapSnapshotRetainerEdgeIndexProvider implements HeapSnapshotItemIndexProvider {
150
- private readonly retainerEdge: JSHeapSnapshotRetainerEdge;
150
+ readonly #retainerEdge: JSHeapSnapshotRetainerEdge;
151
151
  constructor(snapshot: HeapSnapshot) {
152
- this.retainerEdge = snapshot.createRetainingEdge(0);
152
+ this.#retainerEdge = snapshot.createRetainingEdge(0);
153
153
  }
154
154
 
155
155
  itemForIndex(index: number): HeapSnapshotRetainerEdge {
156
- this.retainerEdge.setRetainerIndex(index);
157
- return this.retainerEdge;
156
+ this.#retainerEdge.setRetainerIndex(index);
157
+ return this.#retainerEdge;
158
158
  }
159
159
  }
160
160
 
161
161
  export class HeapSnapshotEdgeIterator implements HeapSnapshotItemIterator {
162
- private readonly sourceNode: HeapSnapshotNode;
162
+ readonly #sourceNode: HeapSnapshotNode;
163
163
  edge: JSHeapSnapshotEdge;
164
164
  constructor(node: HeapSnapshotNode) {
165
- this.sourceNode = node;
165
+ this.#sourceNode = node;
166
166
  this.edge = node.snapshot.createEdge(node.edgeIndexesStart());
167
167
  }
168
168
 
169
169
  hasNext(): boolean {
170
- return this.edge.edgeIndex < this.sourceNode.edgeIndexesEnd();
170
+ return this.edge.edgeIndex < this.#sourceNode.edgeIndexesEnd();
171
171
  }
172
172
 
173
173
  item(): HeapSnapshotEdge {
@@ -184,11 +184,11 @@ export class HeapSnapshotEdgeIterator implements HeapSnapshotItemIterator {
184
184
 
185
185
  export class HeapSnapshotRetainerEdge implements HeapSnapshotItem {
186
186
  protected snapshot: HeapSnapshot;
187
- private retainerIndexInternal!: number;
188
- private globalEdgeIndex!: number;
189
- private retainingNodeIndex?: number;
190
- private edgeInstance?: JSHeapSnapshotEdge|null;
191
- private nodeInstance?: HeapSnapshotNode|null;
187
+ #retainerIndexInternal!: number;
188
+ #globalEdgeIndex!: number;
189
+ #retainingNodeIndex?: number;
190
+ #edgeInstance?: JSHeapSnapshotEdge|null;
191
+ #nodeInstance?: HeapSnapshotNode|null;
192
192
  constructor(snapshot: HeapSnapshot, retainerIndex: number) {
193
193
  this.snapshot = snapshot;
194
194
  this.setRetainerIndex(retainerIndex);
@@ -211,19 +211,19 @@ export class HeapSnapshotRetainerEdge implements HeapSnapshotItem {
211
211
  }
212
212
 
213
213
  nodeIndex(): number {
214
- if (typeof this.retainingNodeIndex === 'undefined') {
214
+ if (typeof this.#retainingNodeIndex === 'undefined') {
215
215
  throw new Error('retainingNodeIndex is undefined');
216
216
  }
217
217
 
218
- return this.retainingNodeIndex;
218
+ return this.#retainingNodeIndex;
219
219
  }
220
220
 
221
221
  retainerIndex(): number {
222
- return this.retainerIndexInternal;
222
+ return this.#retainerIndexInternal;
223
223
  }
224
224
 
225
225
  setRetainerIndex(retainerIndex: number): void {
226
- if (retainerIndex === this.retainerIndexInternal) {
226
+ if (retainerIndex === this.#retainerIndexInternal) {
227
227
  return;
228
228
  }
229
229
 
@@ -231,11 +231,11 @@ export class HeapSnapshotRetainerEdge implements HeapSnapshotItem {
231
231
  throw new Error('Snapshot does not contain retaining edges or retaining nodes');
232
232
  }
233
233
 
234
- this.retainerIndexInternal = retainerIndex;
235
- this.globalEdgeIndex = this.snapshot.retainingEdges[retainerIndex];
236
- this.retainingNodeIndex = this.snapshot.retainingNodes[retainerIndex];
237
- this.edgeInstance = null;
238
- this.nodeInstance = null;
234
+ this.#retainerIndexInternal = retainerIndex;
235
+ this.#globalEdgeIndex = this.snapshot.retainingEdges[retainerIndex];
236
+ this.#retainingNodeIndex = this.snapshot.retainingNodes[retainerIndex];
237
+ this.#edgeInstance = null;
238
+ this.#nodeInstance = null;
239
239
  }
240
240
 
241
241
  set edgeIndex(edgeIndex: number) {
@@ -243,17 +243,17 @@ export class HeapSnapshotRetainerEdge implements HeapSnapshotItem {
243
243
  }
244
244
 
245
245
  private nodeInternal(): HeapSnapshotNode {
246
- if (!this.nodeInstance) {
247
- this.nodeInstance = this.snapshot.createNode(this.retainingNodeIndex);
246
+ if (!this.#nodeInstance) {
247
+ this.#nodeInstance = this.snapshot.createNode(this.#retainingNodeIndex);
248
248
  }
249
- return this.nodeInstance;
249
+ return this.#nodeInstance;
250
250
  }
251
251
 
252
252
  protected edge(): JSHeapSnapshotEdge {
253
- if (!this.edgeInstance) {
254
- this.edgeInstance = this.snapshot.createEdge(this.globalEdgeIndex);
253
+ if (!this.#edgeInstance) {
254
+ this.#edgeInstance = this.snapshot.createEdge(this.#globalEdgeIndex);
255
255
  }
256
- return this.edgeInstance;
256
+ return this.#edgeInstance;
257
257
  }
258
258
 
259
259
  toString(): string {
@@ -261,12 +261,12 @@ export class HeapSnapshotRetainerEdge implements HeapSnapshotItem {
261
261
  }
262
262
 
263
263
  itemIndex(): number {
264
- return this.retainerIndexInternal;
264
+ return this.#retainerIndexInternal;
265
265
  }
266
266
 
267
267
  serialize(): HeapSnapshotModel.HeapSnapshotModel.Edge {
268
268
  return new HeapSnapshotModel.HeapSnapshotModel.Edge(
269
- this.name(), this.node().serialize(), this.type(), this.globalEdgeIndex);
269
+ this.name(), this.node().serialize(), this.type(), this.#globalEdgeIndex);
270
270
  }
271
271
 
272
272
  type(): string {
@@ -275,7 +275,7 @@ export class HeapSnapshotRetainerEdge implements HeapSnapshotItem {
275
275
  }
276
276
 
277
277
  export class HeapSnapshotRetainerEdgeIterator implements HeapSnapshotItemIterator {
278
- private readonly retainersEnd: number;
278
+ readonly #retainersEnd: number;
279
279
  retainer: JSHeapSnapshotRetainerEdge;
280
280
  constructor(retainedNode: HeapSnapshotNode) {
281
281
  const snapshot = retainedNode.snapshot;
@@ -284,12 +284,12 @@ export class HeapSnapshotRetainerEdgeIterator implements HeapSnapshotItemIterato
284
284
  throw new Error('Snapshot does not contain firstRetainerIndex');
285
285
  }
286
286
  const retainerIndex = snapshot.firstRetainerIndex[retainedNodeOrdinal];
287
- this.retainersEnd = snapshot.firstRetainerIndex[retainedNodeOrdinal + 1];
287
+ this.#retainersEnd = snapshot.firstRetainerIndex[retainedNodeOrdinal + 1];
288
288
  this.retainer = snapshot.createRetainingEdge(retainerIndex);
289
289
  }
290
290
 
291
291
  hasNext(): boolean {
292
- return this.retainer.retainerIndex() < this.retainersEnd;
292
+ return this.retainer.retainerIndex() < this.#retainersEnd;
293
293
  }
294
294
 
295
295
  item(): HeapSnapshotRetainerEdge {
@@ -432,14 +432,14 @@ export class HeapSnapshotNode implements HeapSnapshotItem {
432
432
 
433
433
  export class HeapSnapshotNodeIterator implements HeapSnapshotItemIterator {
434
434
  node: HeapSnapshotNode;
435
- private readonly nodesLength: number;
435
+ readonly #nodesLength: number;
436
436
  constructor(node: HeapSnapshotNode) {
437
437
  this.node = node;
438
- this.nodesLength = node.snapshot.nodes.length;
438
+ this.#nodesLength = node.snapshot.nodes.length;
439
439
  }
440
440
 
441
441
  hasNext(): boolean {
442
- return this.node.nodeIndex < this.nodesLength;
442
+ return this.node.nodeIndex < this.#nodesLength;
443
443
  }
444
444
 
445
445
  item(): HeapSnapshotNode {
@@ -452,62 +452,62 @@ export class HeapSnapshotNodeIterator implements HeapSnapshotItemIterator {
452
452
  }
453
453
 
454
454
  export class HeapSnapshotIndexRangeIterator implements HeapSnapshotItemIterator {
455
- private readonly itemProvider: HeapSnapshotItemIndexProvider;
456
- private readonly indexes: number[]|Uint32Array;
457
- private position: number;
455
+ readonly #itemProvider: HeapSnapshotItemIndexProvider;
456
+ readonly #indexes: number[]|Uint32Array;
457
+ #position: number;
458
458
  constructor(itemProvider: HeapSnapshotItemIndexProvider, indexes: number[]|Uint32Array) {
459
- this.itemProvider = itemProvider;
460
- this.indexes = indexes;
461
- this.position = 0;
459
+ this.#itemProvider = itemProvider;
460
+ this.#indexes = indexes;
461
+ this.#position = 0;
462
462
  }
463
463
 
464
464
  hasNext(): boolean {
465
- return this.position < this.indexes.length;
465
+ return this.#position < this.#indexes.length;
466
466
  }
467
467
 
468
468
  item(): HeapSnapshotItem {
469
- const index = this.indexes[this.position];
470
- return this.itemProvider.itemForIndex(index);
469
+ const index = this.#indexes[this.#position];
470
+ return this.#itemProvider.itemForIndex(index);
471
471
  }
472
472
 
473
473
  next(): void {
474
- ++this.position;
474
+ ++this.#position;
475
475
  }
476
476
  }
477
477
 
478
478
  export class HeapSnapshotFilteredIterator implements HeapSnapshotItemIterator {
479
- private iterator: HeapSnapshotItemIterator;
480
- private filter: ((arg0: HeapSnapshotItem) => boolean)|undefined;
479
+ #iterator: HeapSnapshotItemIterator;
480
+ #filter: ((arg0: HeapSnapshotItem) => boolean)|undefined;
481
481
  constructor(iterator: HeapSnapshotItemIterator, filter?: ((arg0: HeapSnapshotItem) => boolean)) {
482
- this.iterator = iterator;
483
- this.filter = filter;
482
+ this.#iterator = iterator;
483
+ this.#filter = filter;
484
484
  this.skipFilteredItems();
485
485
  }
486
486
 
487
487
  hasNext(): boolean {
488
- return this.iterator.hasNext();
488
+ return this.#iterator.hasNext();
489
489
  }
490
490
 
491
491
  item(): HeapSnapshotItem {
492
- return this.iterator.item();
492
+ return this.#iterator.item();
493
493
  }
494
494
 
495
495
  next(): void {
496
- this.iterator.next();
496
+ this.#iterator.next();
497
497
  this.skipFilteredItems();
498
498
  }
499
499
 
500
500
  private skipFilteredItems(): void {
501
- while (this.iterator.hasNext() && this.filter && !this.filter(this.iterator.item())) {
502
- this.iterator.next();
501
+ while (this.#iterator.hasNext() && this.#filter && !this.#filter(this.#iterator.item())) {
502
+ this.#iterator.next();
503
503
  }
504
504
  }
505
505
  }
506
506
 
507
507
  export class HeapSnapshotProgress {
508
- private readonly dispatcher: HeapSnapshotWorkerDispatcher|undefined;
508
+ readonly #dispatcher: HeapSnapshotWorkerDispatcher|undefined;
509
509
  constructor(dispatcher?: HeapSnapshotWorkerDispatcher) {
510
- this.dispatcher = dispatcher;
510
+ this.#dispatcher = dispatcher;
511
511
  }
512
512
 
513
513
  updateStatus(status: string): void {
@@ -521,34 +521,34 @@ export class HeapSnapshotProgress {
521
521
 
522
522
  reportProblem(error: string): void {
523
523
  // May be undefined in tests.
524
- if (this.dispatcher) {
525
- this.dispatcher.sendEvent(HeapSnapshotModel.HeapSnapshotModel.HeapSnapshotProgressEvent.BrokenSnapshot, error);
524
+ if (this.#dispatcher) {
525
+ this.#dispatcher.sendEvent(HeapSnapshotModel.HeapSnapshotModel.HeapSnapshotProgressEvent.BrokenSnapshot, error);
526
526
  }
527
527
  }
528
528
 
529
529
  private sendUpdateEvent(serializedText: string): void {
530
530
  // May be undefined in tests.
531
- if (this.dispatcher) {
532
- this.dispatcher.sendEvent(HeapSnapshotModel.HeapSnapshotModel.HeapSnapshotProgressEvent.Update, serializedText);
531
+ if (this.#dispatcher) {
532
+ this.#dispatcher.sendEvent(HeapSnapshotModel.HeapSnapshotModel.HeapSnapshotProgressEvent.Update, serializedText);
533
533
  }
534
534
  }
535
535
  }
536
536
 
537
537
  export class HeapSnapshotProblemReport {
538
- private readonly errors: string[];
538
+ readonly #errors: string[];
539
539
  constructor(title: string) {
540
- this.errors = [title];
540
+ this.#errors = [title];
541
541
  }
542
542
 
543
543
  addError(error: string): void {
544
- if (this.errors.length > 100) {
544
+ if (this.#errors.length > 100) {
545
545
  return;
546
546
  }
547
- this.errors.push(error);
547
+ this.#errors.push(error);
548
548
  }
549
549
 
550
550
  toString(): string {
551
- return this.errors.join('\n ');
551
+ return this.#errors.join('\n ');
552
552
  }
553
553
  }
554
554
  export interface Profile {
@@ -578,36 +578,36 @@ const enum DOMLinkState {
578
578
  export abstract class HeapSnapshot {
579
579
  nodes: Uint32Array;
580
580
  containmentEdges: Uint32Array;
581
- private readonly metaNode: HeapSnapshotMetainfo;
582
- private readonly rawSamples: number[];
583
- private samples: HeapSnapshotModel.HeapSnapshotModel.Samples|null;
581
+ readonly #metaNode: HeapSnapshotMetainfo;
582
+ readonly #rawSamples: number[];
583
+ #samples: HeapSnapshotModel.HeapSnapshotModel.Samples|null;
584
584
  strings: string[];
585
- private readonly locations: number[];
586
- private readonly progress: HeapSnapshotProgress;
587
- private readonly noDistance: number;
585
+ readonly #locations: number[];
586
+ readonly #progress: HeapSnapshotProgress;
587
+ readonly #noDistance: number;
588
588
  rootNodeIndexInternal: number;
589
- private snapshotDiffs: {
589
+ #snapshotDiffs: {
590
590
  [x: string]: {
591
591
  [x: string]: HeapSnapshotModel.HeapSnapshotModel.Diff,
592
592
  },
593
593
  };
594
- private aggregatesForDiffInternal!: {
594
+ #aggregatesForDiffInternal!: {
595
595
  [x: string]: HeapSnapshotModel.HeapSnapshotModel.AggregateForDiff,
596
596
  };
597
- private aggregates: {
597
+ #aggregates: {
598
598
  [x: string]: {
599
599
  [x: string]: AggregatedInfo,
600
600
  },
601
601
  };
602
- private aggregatesSortedFlags: {
602
+ #aggregatesSortedFlags: {
603
603
  [x: string]: boolean,
604
604
  };
605
- private profile: Profile;
605
+ #profile: Profile;
606
606
  nodeTypeOffset!: number;
607
607
  nodeNameOffset!: number;
608
608
  nodeIdOffset!: number;
609
609
  nodeSelfSizeOffset!: number;
610
- private nodeEdgeCountOffset!: number;
610
+ #nodeEdgeCountOffset!: number;
611
611
  nodeTraceNodeIdOffset!: number;
612
612
  nodeFieldCount!: number;
613
613
  nodeTypes!: string[];
@@ -630,25 +630,25 @@ export abstract class HeapSnapshot {
630
630
  edgeShortcutType!: number;
631
631
  edgeWeakType!: number;
632
632
  edgeInvisibleType!: number;
633
- private locationIndexOffset!: number;
634
- private locationScriptIdOffset!: number;
635
- private locationLineOffset!: number;
636
- private locationColumnOffset!: number;
637
- private locationFieldCount!: number;
633
+ #locationIndexOffset!: number;
634
+ #locationScriptIdOffset!: number;
635
+ #locationLineOffset!: number;
636
+ #locationColumnOffset!: number;
637
+ #locationFieldCount!: number;
638
638
  nodeCount!: number;
639
- private edgeCount!: number;
639
+ #edgeCount!: number;
640
640
  retainedSizes!: Float64Array;
641
641
  firstEdgeIndexes!: Uint32Array;
642
642
  retainingNodes!: Uint32Array;
643
643
  retainingEdges!: Uint32Array;
644
644
  firstRetainerIndex!: Uint32Array;
645
645
  nodeDistances!: Int32Array;
646
- private firstDominatedNodeIndex!: Uint32Array;
647
- private dominatedNodes!: Uint32Array;
646
+ firstDominatedNodeIndex!: Uint32Array;
647
+ dominatedNodes!: Uint32Array;
648
648
  dominatorsTree!: Uint32Array;
649
- private allocationProfile!: AllocationProfile;
650
- private nodeDetachednessOffset!: number;
651
- private locationMap!: Map<number, HeapSnapshotModel.HeapSnapshotModel.Location>;
649
+ #allocationProfile!: AllocationProfile;
650
+ #nodeDetachednessOffset!: number;
651
+ #locationMap!: Map<number, HeapSnapshotModel.HeapSnapshotModel.Location>;
652
652
  lazyStringCache!: {
653
653
  [x: string]: string,
654
654
  };
@@ -656,37 +656,37 @@ export abstract class HeapSnapshot {
656
656
  constructor(profile: Profile, progress: HeapSnapshotProgress) {
657
657
  this.nodes = profile.nodes;
658
658
  this.containmentEdges = profile.edges;
659
- this.metaNode = profile.snapshot.meta;
660
- this.rawSamples = profile.samples;
661
- this.samples = null;
659
+ this.#metaNode = profile.snapshot.meta;
660
+ this.#rawSamples = profile.samples;
661
+ this.#samples = null;
662
662
  this.strings = profile.strings;
663
- this.locations = profile.locations;
664
- this.progress = progress;
663
+ this.#locations = profile.locations;
664
+ this.#progress = progress;
665
665
 
666
- this.noDistance = -5;
666
+ this.#noDistance = -5;
667
667
  this.rootNodeIndexInternal = 0;
668
668
  if (profile.snapshot.root_index) {
669
669
  this.rootNodeIndexInternal = profile.snapshot.root_index;
670
670
  }
671
671
 
672
- this.snapshotDiffs = {};
672
+ this.#snapshotDiffs = {};
673
673
 
674
- this.aggregates = {};
674
+ this.#aggregates = {};
675
675
 
676
- this.aggregatesSortedFlags = {};
677
- this.profile = profile;
676
+ this.#aggregatesSortedFlags = {};
677
+ this.#profile = profile;
678
678
  }
679
679
 
680
680
  initialize(): void {
681
- const meta = this.metaNode;
681
+ const meta = this.#metaNode;
682
682
 
683
683
  this.nodeTypeOffset = meta.node_fields.indexOf('type');
684
684
  this.nodeNameOffset = meta.node_fields.indexOf('name');
685
685
  this.nodeIdOffset = meta.node_fields.indexOf('id');
686
686
  this.nodeSelfSizeOffset = meta.node_fields.indexOf('self_size');
687
- this.nodeEdgeCountOffset = meta.node_fields.indexOf('edge_count');
687
+ this.#nodeEdgeCountOffset = meta.node_fields.indexOf('edge_count');
688
688
  this.nodeTraceNodeIdOffset = meta.node_fields.indexOf('trace_node_id');
689
- this.nodeDetachednessOffset = meta.node_fields.indexOf('detachedness');
689
+ this.#nodeDetachednessOffset = meta.node_fields.indexOf('detachedness');
690
690
  this.nodeFieldCount = meta.node_fields.length;
691
691
 
692
692
  this.nodeTypes = meta.node_types[this.nodeTypeOffset];
@@ -715,53 +715,53 @@ export abstract class HeapSnapshot {
715
715
 
716
716
  const locationFields = meta.location_fields || [];
717
717
 
718
- this.locationIndexOffset = locationFields.indexOf('object_index');
719
- this.locationScriptIdOffset = locationFields.indexOf('script_id');
720
- this.locationLineOffset = locationFields.indexOf('line');
721
- this.locationColumnOffset = locationFields.indexOf('column');
722
- this.locationFieldCount = locationFields.length;
718
+ this.#locationIndexOffset = locationFields.indexOf('object_index');
719
+ this.#locationScriptIdOffset = locationFields.indexOf('script_id');
720
+ this.#locationLineOffset = locationFields.indexOf('line');
721
+ this.#locationColumnOffset = locationFields.indexOf('column');
722
+ this.#locationFieldCount = locationFields.length;
723
723
 
724
724
  this.nodeCount = this.nodes.length / this.nodeFieldCount;
725
- this.edgeCount = this.containmentEdges.length / this.edgeFieldsCount;
725
+ this.#edgeCount = this.containmentEdges.length / this.edgeFieldsCount;
726
726
 
727
727
  this.retainedSizes = new Float64Array(this.nodeCount);
728
728
  this.firstEdgeIndexes = new Uint32Array(this.nodeCount + 1);
729
- this.retainingNodes = new Uint32Array(this.edgeCount);
730
- this.retainingEdges = new Uint32Array(this.edgeCount);
729
+ this.retainingNodes = new Uint32Array(this.#edgeCount);
730
+ this.retainingEdges = new Uint32Array(this.#edgeCount);
731
731
  this.firstRetainerIndex = new Uint32Array(this.nodeCount + 1);
732
732
  this.nodeDistances = new Int32Array(this.nodeCount);
733
733
  this.firstDominatedNodeIndex = new Uint32Array(this.nodeCount + 1);
734
734
  this.dominatedNodes = new Uint32Array(this.nodeCount - 1);
735
735
 
736
- this.progress.updateStatus('Building edge indexes…');
736
+ this.#progress.updateStatus('Building edge indexes…');
737
737
  this.buildEdgeIndexes();
738
- this.progress.updateStatus('Building retainers…');
738
+ this.#progress.updateStatus('Building retainers…');
739
739
  this.buildRetainers();
740
- this.progress.updateStatus('Propagating DOM state…');
740
+ this.#progress.updateStatus('Propagating DOM state…');
741
741
  this.propagateDOMState();
742
- this.progress.updateStatus('Calculating node flags…');
742
+ this.#progress.updateStatus('Calculating node flags…');
743
743
  this.calculateFlags();
744
- this.progress.updateStatus('Calculating distances…');
744
+ this.#progress.updateStatus('Calculating distances…');
745
745
  this.calculateDistances();
746
- this.progress.updateStatus('Building postorder index…');
746
+ this.#progress.updateStatus('Building postorder index…');
747
747
  const result = this.buildPostOrderIndex();
748
748
  // Actually it is array that maps node ordinal number to dominator node ordinal number.
749
- this.progress.updateStatus('Building dominator tree…');
749
+ this.#progress.updateStatus('Building dominator tree…');
750
750
  this.dominatorsTree = this.buildDominatorTree(result.postOrderIndex2NodeOrdinal, result.nodeOrdinal2PostOrderIndex);
751
- this.progress.updateStatus('Calculating retained sizes…');
751
+ this.#progress.updateStatus('Calculating retained sizes…');
752
752
  this.calculateRetainedSizes(result.postOrderIndex2NodeOrdinal);
753
- this.progress.updateStatus('Building dominated nodes…');
753
+ this.#progress.updateStatus('Building dominated nodes…');
754
754
  this.buildDominatedNodes();
755
- this.progress.updateStatus('Calculating statistics…');
755
+ this.#progress.updateStatus('Calculating statistics…');
756
756
  this.calculateStatistics();
757
- this.progress.updateStatus('Calculating samples…');
757
+ this.#progress.updateStatus('Calculating samples…');
758
758
  this.buildSamples();
759
- this.progress.updateStatus('Building locations…');
759
+ this.#progress.updateStatus('Building locations…');
760
760
  this.buildLocationMap();
761
- this.progress.updateStatus('Finished processing.');
761
+ this.#progress.updateStatus('Finished processing.');
762
762
 
763
- if (this.profile.snapshot.trace_function_count) {
764
- this.progress.updateStatus('Building allocation statistics…');
763
+ if (this.#profile.snapshot.trace_function_count) {
764
+ this.#progress.updateStatus('Building allocation statistics…');
765
765
  const nodes = this.nodes;
766
766
  const nodesLength = nodes.length;
767
767
  const nodeFieldCount = this.nodeFieldCount;
@@ -782,8 +782,8 @@ export abstract class HeapSnapshot {
782
782
  stats.size += node.selfSize();
783
783
  stats.ids.push(node.id());
784
784
  }
785
- this.allocationProfile = new AllocationProfile(this.profile, liveObjects);
786
- this.progress.updateStatus('done');
785
+ this.#allocationProfile = new AllocationProfile(this.#profile, liveObjects);
786
+ this.#progress.updateStatus('done');
787
787
  }
788
788
  }
789
789
 
@@ -793,7 +793,7 @@ export abstract class HeapSnapshot {
793
793
  const firstEdgeIndexes = this.firstEdgeIndexes;
794
794
  const nodeFieldCount = this.nodeFieldCount;
795
795
  const edgeFieldsCount = this.edgeFieldsCount;
796
- const nodeEdgeCountOffset = this.nodeEdgeCountOffset;
796
+ const nodeEdgeCountOffset = this.#nodeEdgeCountOffset;
797
797
  firstEdgeIndexes[nodeCount] = this.containmentEdges.length;
798
798
  for (let nodeOrdinal = 0, edgeIndex = 0; nodeOrdinal < nodeCount; ++nodeOrdinal) {
799
799
  firstEdgeIndexes[nodeOrdinal] = edgeIndex;
@@ -965,11 +965,11 @@ export abstract class HeapSnapshot {
965
965
 
966
966
  private createAllocationStackFilter(bottomUpAllocationNodeId: number):
967
967
  ((arg0: HeapSnapshotNode) => boolean)|undefined {
968
- if (!this.allocationProfile) {
968
+ if (!this.#allocationProfile) {
969
969
  throw new Error('No Allocation Profile provided');
970
970
  }
971
971
 
972
- const traceIds = this.allocationProfile.traceIds(bottomUpAllocationNodeId);
972
+ const traceIds = this.#allocationProfile.traceIds(bottomUpAllocationNodeId);
973
973
  if (!traceIds.length) {
974
974
  return undefined;
975
975
  }
@@ -989,20 +989,20 @@ export abstract class HeapSnapshot {
989
989
  const aggregates = this.buildAggregates(filter);
990
990
 
991
991
  let aggregatesByClassName;
992
- if (key && this.aggregates[key]) {
993
- aggregatesByClassName = this.aggregates[key];
992
+ if (key && this.#aggregates[key]) {
993
+ aggregatesByClassName = this.#aggregates[key];
994
994
  } else {
995
995
  this.calculateClassesRetainedSize(aggregates.aggregatesByClassIndex, filter);
996
996
  aggregatesByClassName = aggregates.aggregatesByClassName;
997
997
  if (key) {
998
- this.aggregates[key] = aggregatesByClassName;
998
+ this.#aggregates[key] = aggregatesByClassName;
999
999
  }
1000
1000
  }
1001
1001
 
1002
- if (sortedIndexes && (!key || !this.aggregatesSortedFlags[key])) {
1002
+ if (sortedIndexes && (!key || !this.#aggregatesSortedFlags[key])) {
1003
1003
  this.sortAggregateIndexes(aggregates.aggregatesByClassName);
1004
1004
  if (key) {
1005
- this.aggregatesSortedFlags[key] = sortedIndexes;
1005
+ this.#aggregatesSortedFlags[key] = sortedIndexes;
1006
1006
  }
1007
1007
  }
1008
1008
 
@@ -1012,11 +1012,11 @@ export abstract class HeapSnapshot {
1012
1012
  }
1013
1013
 
1014
1014
  allocationTracesTops(): HeapSnapshotModel.HeapSnapshotModel.SerializedAllocationNode[] {
1015
- return this.allocationProfile.serializeTraceTops();
1015
+ return this.#allocationProfile.serializeTraceTops();
1016
1016
  }
1017
1017
 
1018
1018
  allocationNodeCallers(nodeId: number): HeapSnapshotModel.HeapSnapshotModel.AllocationNodeCallers {
1019
- return this.allocationProfile.serializeCallers(nodeId);
1019
+ return this.#allocationProfile.serializeCallers(nodeId);
1020
1020
  }
1021
1021
 
1022
1022
  allocationStack(nodeIndex: number): HeapSnapshotModel.HeapSnapshotModel.AllocationStackFrame[]|null {
@@ -1025,16 +1025,16 @@ export abstract class HeapSnapshot {
1025
1025
  if (!allocationNodeId) {
1026
1026
  return null;
1027
1027
  }
1028
- return this.allocationProfile.serializeAllocationStack(allocationNodeId);
1028
+ return this.#allocationProfile.serializeAllocationStack(allocationNodeId);
1029
1029
  }
1030
1030
 
1031
1031
  aggregatesForDiff(): {[x: string]: HeapSnapshotModel.HeapSnapshotModel.AggregateForDiff} {
1032
- if (this.aggregatesForDiffInternal) {
1033
- return this.aggregatesForDiffInternal;
1032
+ if (this.#aggregatesForDiffInternal) {
1033
+ return this.#aggregatesForDiffInternal;
1034
1034
  }
1035
1035
 
1036
1036
  const aggregatesByClassName = this.getAggregatesByClassName(true, 'allObjects');
1037
- this.aggregatesForDiffInternal = {};
1037
+ this.#aggregatesForDiffInternal = {};
1038
1038
 
1039
1039
  const node = this.createNode();
1040
1040
  for (const className in aggregatesByClassName) {
@@ -1048,9 +1048,9 @@ export abstract class HeapSnapshot {
1048
1048
  selfSizes[i] = node.selfSize();
1049
1049
  }
1050
1050
 
1051
- this.aggregatesForDiffInternal[className] = {indexes: indexes, ids: ids, selfSizes: selfSizes};
1051
+ this.#aggregatesForDiffInternal[className] = {indexes: indexes, ids: ids, selfSizes: selfSizes};
1052
1052
  }
1053
- return this.aggregatesForDiffInternal;
1053
+ return this.#aggregatesForDiffInternal;
1054
1054
  }
1055
1055
 
1056
1056
  isUserRoot(_node: HeapSnapshotNode): boolean {
@@ -1060,7 +1060,7 @@ export abstract class HeapSnapshot {
1060
1060
  calculateDistances(filter?: ((arg0: HeapSnapshotNode, arg1: HeapSnapshotEdge) => boolean)): void {
1061
1061
  const nodeCount = this.nodeCount;
1062
1062
  const distances = this.nodeDistances;
1063
- const noDistance = this.noDistance;
1063
+ const noDistance = this.#noDistance;
1064
1064
  for (let i = 0; i < nodeCount; ++i) {
1065
1065
  distances[i] = noDistance;
1066
1066
  }
@@ -1098,7 +1098,7 @@ export abstract class HeapSnapshot {
1098
1098
  const edgeTypeOffset = this.edgeTypeOffset;
1099
1099
  const nodeCount = this.nodeCount;
1100
1100
  const edgeWeakType = this.edgeWeakType;
1101
- const noDistance = this.noDistance;
1101
+ const noDistance = this.#noDistance;
1102
1102
 
1103
1103
  let index = 0;
1104
1104
  const edge = this.createEdge(0);
@@ -1652,7 +1652,7 @@ export abstract class HeapSnapshot {
1652
1652
  * "Detached <Name>".
1653
1653
  */
1654
1654
  private propagateDOMState(): void {
1655
- if (this.nodeDetachednessOffset === -1) {
1655
+ if (this.#nodeDetachednessOffset === -1) {
1656
1656
  return;
1657
1657
  }
1658
1658
 
@@ -1697,7 +1697,7 @@ export abstract class HeapSnapshot {
1697
1697
  return;
1698
1698
  }
1699
1699
 
1700
- snapshot.nodes[nodeIndex + snapshot.nodeDetachednessOffset] = newState;
1700
+ snapshot.nodes[nodeIndex + snapshot.#nodeDetachednessOffset] = newState;
1701
1701
 
1702
1702
  if (newState === DOMLinkState.Attached) {
1703
1703
  attached.push(nodeOrdinal);
@@ -1722,7 +1722,7 @@ export abstract class HeapSnapshot {
1722
1722
  // through processing to have their name adjusted and them enqueued in
1723
1723
  // the respective queues.
1724
1724
  for (let nodeOrdinal = 0; nodeOrdinal < this.nodeCount; ++nodeOrdinal) {
1725
- const state = this.nodes[nodeOrdinal * this.nodeFieldCount + this.nodeDetachednessOffset];
1725
+ const state = this.nodes[nodeOrdinal * this.nodeFieldCount + this.#nodeDetachednessOffset];
1726
1726
  // Bail out for objects that have no known state. For all other objects set that state.
1727
1727
  if (state === DOMLinkState.Unknown) {
1728
1728
  continue;
@@ -1737,7 +1737,7 @@ export abstract class HeapSnapshot {
1737
1737
  // 3. If the parent is not attached, then the child inherits the parent's state.
1738
1738
  while (detached.length !== 0) {
1739
1739
  const nodeOrdinal = (detached.pop() as number);
1740
- const nodeState = this.nodes[nodeOrdinal * this.nodeFieldCount + this.nodeDetachednessOffset];
1740
+ const nodeState = this.nodes[nodeOrdinal * this.nodeFieldCount + this.#nodeDetachednessOffset];
1741
1741
  // Ignore if the node has been found through propagating forward attached state.
1742
1742
  if (nodeState === DOMLinkState.Attached) {
1743
1743
  continue;
@@ -1749,7 +1749,7 @@ export abstract class HeapSnapshot {
1749
1749
  }
1750
1750
 
1751
1751
  private buildSamples(): void {
1752
- const samples = this.rawSamples;
1752
+ const samples = this.#rawSamples;
1753
1753
  if (!samples || !samples.length) {
1754
1754
  return;
1755
1755
  }
@@ -1758,8 +1758,8 @@ export abstract class HeapSnapshot {
1758
1758
  const timestamps = new Array(sampleCount);
1759
1759
  const lastAssignedIds = new Array(sampleCount);
1760
1760
 
1761
- const timestampOffset = this.metaNode.sample_fields.indexOf('timestamp_us');
1762
- const lastAssignedIdOffset = this.metaNode.sample_fields.indexOf('last_assigned_id');
1761
+ const timestampOffset = this.#metaNode.sample_fields.indexOf('timestamp_us');
1762
+ const lastAssignedIdOffset = this.#metaNode.sample_fields.indexOf('last_assigned_id');
1763
1763
  for (let i = 0; i < sampleCount; i++) {
1764
1764
  sizeForRange[i] = 0;
1765
1765
  timestamps[i] = (samples[2 * i + timestampOffset]) / 1000;
@@ -1786,30 +1786,30 @@ export abstract class HeapSnapshot {
1786
1786
  }
1787
1787
  sizeForRange[rangeIndex] += node.selfSize();
1788
1788
  }
1789
- this.samples = new HeapSnapshotModel.HeapSnapshotModel.Samples(timestamps, lastAssignedIds, sizeForRange);
1789
+ this.#samples = new HeapSnapshotModel.HeapSnapshotModel.Samples(timestamps, lastAssignedIds, sizeForRange);
1790
1790
  }
1791
1791
 
1792
1792
  private buildLocationMap(): void {
1793
1793
  const map = new Map<number, HeapSnapshotModel.HeapSnapshotModel.Location>();
1794
- const locations = this.locations;
1794
+ const locations = this.#locations;
1795
1795
 
1796
- for (let i = 0; i < locations.length; i += this.locationFieldCount) {
1797
- const nodeIndex = locations[i + this.locationIndexOffset];
1798
- const scriptId = locations[i + this.locationScriptIdOffset];
1799
- const line = locations[i + this.locationLineOffset];
1800
- const col = locations[i + this.locationColumnOffset];
1796
+ for (let i = 0; i < locations.length; i += this.#locationFieldCount) {
1797
+ const nodeIndex = locations[i + this.#locationIndexOffset];
1798
+ const scriptId = locations[i + this.#locationScriptIdOffset];
1799
+ const line = locations[i + this.#locationLineOffset];
1800
+ const col = locations[i + this.#locationColumnOffset];
1801
1801
  map.set(nodeIndex, new HeapSnapshotModel.HeapSnapshotModel.Location(scriptId, line, col));
1802
1802
  }
1803
1803
 
1804
- this.locationMap = map;
1804
+ this.#locationMap = map;
1805
1805
  }
1806
1806
 
1807
1807
  getLocation(nodeIndex: number): HeapSnapshotModel.HeapSnapshotModel.Location|null {
1808
- return this.locationMap.get(nodeIndex) || null;
1808
+ return this.#locationMap.get(nodeIndex) || null;
1809
1809
  }
1810
1810
 
1811
1811
  getSamples(): HeapSnapshotModel.HeapSnapshotModel.Samples|null {
1812
- return this.samples;
1812
+ return this.#samples;
1813
1813
  }
1814
1814
 
1815
1815
  calculateFlags(): void {
@@ -1830,7 +1830,7 @@ export abstract class HeapSnapshot {
1830
1830
  {[x: string]: HeapSnapshotModel.HeapSnapshotModel.Diff} {
1831
1831
  let snapshotDiff: {[x: string]: HeapSnapshotModel.HeapSnapshotModel.Diff}|{
1832
1832
  [x: string]: HeapSnapshotModel.HeapSnapshotModel.Diff,
1833
- } = this.snapshotDiffs[baseSnapshotId];
1833
+ } = this.#snapshotDiffs[baseSnapshotId];
1834
1834
  if (snapshotDiff) {
1835
1835
  return snapshotDiff;
1836
1836
  }
@@ -1857,7 +1857,7 @@ export abstract class HeapSnapshot {
1857
1857
  }
1858
1858
  }
1859
1859
 
1860
- this.snapshotDiffs[baseSnapshotId] = snapshotDiff;
1860
+ this.#snapshotDiffs[baseSnapshotId] = snapshotDiff;
1861
1861
  return snapshotDiff;
1862
1862
  }
1863
1863
 
@@ -1973,7 +1973,7 @@ export abstract class HeapSnapshot {
1973
1973
  }
1974
1974
 
1975
1975
  createAddedNodesProvider(baseSnapshotId: string, className: string): HeapSnapshotNodesProvider {
1976
- const snapshotDiff = this.snapshotDiffs[baseSnapshotId];
1976
+ const snapshotDiff = this.#snapshotDiffs[baseSnapshotId];
1977
1977
  const diffForClass = snapshotDiff[className];
1978
1978
  return new HeapSnapshotNodesProvider(this, diffForClass.addedIndexes);
1979
1979
  }
@@ -2043,20 +2043,20 @@ export class HeapSnapshotHeader {
2043
2043
 
2044
2044
  export abstract class HeapSnapshotItemProvider {
2045
2045
  protected readonly iterator: HeapSnapshotItemIterator;
2046
- private readonly indexProvider: HeapSnapshotItemIndexProvider;
2047
- private readonly isEmptyInternal: boolean;
2046
+ readonly #indexProvider: HeapSnapshotItemIndexProvider;
2047
+ readonly #isEmptyInternal: boolean;
2048
2048
  protected iterationOrder: number[]|null;
2049
2049
  protected currentComparator: HeapSnapshotModel.HeapSnapshotModel.ComparatorConfig|null;
2050
- private sortedPrefixLength: number;
2051
- private sortedSuffixLength: number;
2050
+ #sortedPrefixLength: number;
2051
+ #sortedSuffixLength: number;
2052
2052
  constructor(iterator: HeapSnapshotItemIterator, indexProvider: HeapSnapshotItemIndexProvider) {
2053
2053
  this.iterator = iterator;
2054
- this.indexProvider = indexProvider;
2055
- this.isEmptyInternal = !iterator.hasNext();
2054
+ this.#indexProvider = indexProvider;
2055
+ this.#isEmptyInternal = !iterator.hasNext();
2056
2056
  this.iterationOrder = null;
2057
2057
  this.currentComparator = null;
2058
- this.sortedPrefixLength = 0;
2059
- this.sortedSuffixLength = 0;
2058
+ this.#sortedPrefixLength = 0;
2059
+ this.#sortedSuffixLength = 0;
2060
2060
  }
2061
2061
 
2062
2062
  protected createIterationOrder(): void {
@@ -2070,7 +2070,7 @@ export abstract class HeapSnapshotItemProvider {
2070
2070
  }
2071
2071
 
2072
2072
  isEmpty(): boolean {
2073
- return this.isEmptyInternal;
2073
+ return this.#isEmptyInternal;
2074
2074
  }
2075
2075
 
2076
2076
  serializeItemsRange(begin: number, end: number): HeapSnapshotModel.HeapSnapshotModel.ItemsRange {
@@ -2086,17 +2086,17 @@ export abstract class HeapSnapshotItemProvider {
2086
2086
  if (end > this.iterationOrder.length) {
2087
2087
  end = this.iterationOrder.length;
2088
2088
  }
2089
- if (this.sortedPrefixLength < end && begin < this.iterationOrder.length - this.sortedSuffixLength &&
2089
+ if (this.#sortedPrefixLength < end && begin < this.iterationOrder.length - this.#sortedSuffixLength &&
2090
2090
  this.currentComparator) {
2091
2091
  const currentComparator = this.currentComparator;
2092
2092
  this.sort(
2093
- currentComparator, this.sortedPrefixLength, this.iterationOrder.length - 1 - this.sortedSuffixLength, begin,
2093
+ currentComparator, this.#sortedPrefixLength, this.iterationOrder.length - 1 - this.#sortedSuffixLength, begin,
2094
2094
  end - 1);
2095
- if (begin <= this.sortedPrefixLength) {
2096
- this.sortedPrefixLength = end;
2095
+ if (begin <= this.#sortedPrefixLength) {
2096
+ this.#sortedPrefixLength = end;
2097
2097
  }
2098
- if (end >= this.iterationOrder.length - this.sortedSuffixLength) {
2099
- this.sortedSuffixLength = this.iterationOrder.length - begin;
2098
+ if (end >= this.iterationOrder.length - this.#sortedSuffixLength) {
2099
+ this.#sortedSuffixLength = this.iterationOrder.length - begin;
2100
2100
  }
2101
2101
  }
2102
2102
  let position = begin;
@@ -2104,7 +2104,7 @@ export abstract class HeapSnapshotItemProvider {
2104
2104
  const result = new Array(count);
2105
2105
  for (let i = 0; i < count; ++i) {
2106
2106
  const itemIndex = this.iterationOrder[position++];
2107
- const item = this.indexProvider.itemForIndex(itemIndex);
2107
+ const item = this.#indexProvider.itemForIndex(itemIndex);
2108
2108
  result[i] = item.serialize();
2109
2109
  }
2110
2110
  return new HeapSnapshotModel.HeapSnapshotModel.ItemsRange(begin, end, this.iterationOrder.length, result);
@@ -2112,8 +2112,8 @@ export abstract class HeapSnapshotItemProvider {
2112
2112
 
2113
2113
  sortAndRewind(comparator: HeapSnapshotModel.HeapSnapshotModel.ComparatorConfig): void {
2114
2114
  this.currentComparator = comparator;
2115
- this.sortedPrefixLength = 0;
2116
- this.sortedSuffixLength = 0;
2115
+ this.#sortedPrefixLength = 0;
2116
+ this.#sortedSuffixLength = 0;
2117
2117
  }
2118
2118
 
2119
2119
  abstract sort(
@@ -2321,7 +2321,7 @@ export class JSHeapSnapshot extends HeapSnapshot {
2321
2321
  };
2322
2322
  lazyStringCache: {};
2323
2323
  private flags!: Uint32Array;
2324
- private statistics?: HeapSnapshotModel.HeapSnapshotModel.Statistics;
2324
+ #statistics?: HeapSnapshotModel.HeapSnapshotModel.Statistics;
2325
2325
  constructor(profile: Profile, progress: HeapSnapshotProgress) {
2326
2326
  super(profile, progress);
2327
2327
  this.nodeFlags = {
@@ -2573,14 +2573,14 @@ export class JSHeapSnapshot extends HeapSnapshot {
2573
2573
  sizeJSArrays += this.calculateArraySize(node);
2574
2574
  }
2575
2575
  }
2576
- this.statistics = new HeapSnapshotModel.HeapSnapshotModel.Statistics();
2577
- this.statistics.total = this.totalSize;
2578
- this.statistics.v8heap = this.totalSize - sizeNative;
2579
- this.statistics.native = sizeNative;
2580
- this.statistics.code = sizeCode;
2581
- this.statistics.jsArrays = sizeJSArrays;
2582
- this.statistics.strings = sizeStrings;
2583
- this.statistics.system = sizeSystem;
2576
+ this.#statistics = new HeapSnapshotModel.HeapSnapshotModel.Statistics();
2577
+ this.#statistics.total = this.totalSize;
2578
+ this.#statistics.v8heap = this.totalSize - sizeNative;
2579
+ this.#statistics.native = sizeNative;
2580
+ this.#statistics.code = sizeCode;
2581
+ this.#statistics.jsArrays = sizeJSArrays;
2582
+ this.#statistics.strings = sizeStrings;
2583
+ this.#statistics.system = sizeSystem;
2584
2584
  }
2585
2585
 
2586
2586
  private calculateArraySize(node: HeapSnapshotNode): number {
@@ -2614,7 +2614,7 @@ export class JSHeapSnapshot extends HeapSnapshot {
2614
2614
  }
2615
2615
 
2616
2616
  getStatistics(): HeapSnapshotModel.HeapSnapshotModel.Statistics {
2617
- return this.statistics as HeapSnapshotModel.HeapSnapshotModel.Statistics;
2617
+ return this.#statistics as HeapSnapshotModel.HeapSnapshotModel.Statistics;
2618
2618
  }
2619
2619
  }
2620
2620