chrome-devtools-frontend 1.0.1525561 → 1.0.1526630

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 (58) hide show
  1. package/front_end/core/common/Settings.ts +1 -1
  2. package/front_end/core/i18n/i18nImpl.ts +1 -1
  3. package/front_end/core/sdk/ChildTargetManager.ts +2 -0
  4. package/front_end/core/sdk/PreloadingModel.ts +3 -0
  5. package/front_end/core/sdk/ResourceTreeModel.ts +1 -1
  6. package/front_end/core/sdk/SourceMapScopesInfo.ts +57 -0
  7. package/front_end/generated/InspectorBackendCommands.js +5 -5
  8. package/front_end/generated/SupportedCSSProperties.js +0 -19
  9. package/front_end/generated/protocol-mapping.d.ts +4 -2
  10. package/front_end/generated/protocol-proxy-api.d.ts +4 -2
  11. package/front_end/generated/protocol.ts +9 -8
  12. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +43 -8
  13. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +50 -32
  14. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +29 -29
  15. package/front_end/models/javascript_metadata/NativeFunctions.js +3 -8
  16. package/front_end/models/trace/handlers/UserTimingsHandler.ts +1 -1
  17. package/front_end/models/trace/insights/CLSCulprits.ts +2 -1
  18. package/front_end/models/trace/insights/Cache.ts +2 -1
  19. package/front_end/models/trace/insights/DOMSize.ts +2 -1
  20. package/front_end/models/trace/insights/DocumentLatency.ts +2 -1
  21. package/front_end/models/trace/insights/DuplicatedJavaScript.ts +2 -1
  22. package/front_end/models/trace/insights/FontDisplay.ts +2 -1
  23. package/front_end/models/trace/insights/ForcedReflow.ts +2 -1
  24. package/front_end/models/trace/insights/INPBreakdown.ts +2 -1
  25. package/front_end/models/trace/insights/ImageDelivery.ts +2 -1
  26. package/front_end/models/trace/insights/LCPBreakdown.ts +2 -1
  27. package/front_end/models/trace/insights/LCPDiscovery.ts +2 -1
  28. package/front_end/models/trace/insights/LegacyJavaScript.ts +2 -1
  29. package/front_end/models/trace/insights/ModernHTTP.ts +2 -1
  30. package/front_end/models/trace/insights/NetworkDependencyTree.ts +2 -1
  31. package/front_end/models/trace/insights/RenderBlocking.ts +2 -1
  32. package/front_end/models/trace/insights/SlowCSSSelector.ts +2 -1
  33. package/front_end/models/trace/insights/ThirdParties.ts +2 -1
  34. package/front_end/models/trace/insights/Viewport.ts +2 -1
  35. package/front_end/models/trace/insights/types.ts +2 -1
  36. package/front_end/panels/application/ReportingApiView.ts +8 -7
  37. package/front_end/panels/application/StorageView.ts +2 -1
  38. package/front_end/panels/application/preloading/components/PreloadingString.ts +2 -0
  39. package/front_end/panels/console/ConsolePrompt.ts +24 -4
  40. package/front_end/panels/coverage/CoverageListView.ts +125 -279
  41. package/front_end/panels/coverage/CoverageView.ts +109 -111
  42. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +11 -19
  43. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +27 -43
  44. package/front_end/panels/network/RequestResponseView.ts +1 -1
  45. package/front_end/panels/timeline/TimelinePanel.ts +10 -8
  46. package/front_end/panels/timeline/components/ExportTraceOptions.ts +1 -1
  47. package/front_end/third_party/chromium/README.chromium +1 -1
  48. package/front_end/ui/components/buttons/Button.ts +18 -1
  49. package/front_end/ui/legacy/EmptyWidget.ts +11 -1
  50. package/front_end/ui/legacy/SearchableView.ts +1 -1
  51. package/front_end/ui/legacy/Toolbar.ts +25 -4
  52. package/front_end/ui/legacy/UIUtils.ts +28 -2
  53. package/front_end/ui/legacy/Widget.ts +5 -0
  54. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +48 -5
  55. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +2 -2
  56. package/front_end/ui/legacy/components/source_frame/JSONView.ts +28 -0
  57. package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +7 -8
  58. package/package.json +22 -22
@@ -2,6 +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
  /* eslint-disable rulesdir/no-imperative-dom-api */
5
+ /* eslint-disable rulesdir/no-lit-render-outside-of-view */
5
6
 
6
7
  import '../../ui/legacy/legacy.js';
7
8
 
@@ -14,6 +15,7 @@ import * as Bindings from '../../models/bindings/bindings.js';
14
15
  import * as Workspace from '../../models/workspace/workspace.js';
15
16
  import * as Buttons from '../../ui/components/buttons/buttons.js';
16
17
  import * as UI from '../../ui/legacy/legacy.js';
18
+ import {Directives, html, nothing, render} from '../../ui/lit/lit.js';
17
19
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
18
20
 
19
21
  import {CoverageDecorationManager} from './CoverageDecorationManager.js';
@@ -124,33 +126,35 @@ const UIStrings = {
124
126
  } as const;
125
127
  const str_ = i18n.i18n.registerUIStrings('panels/coverage/CoverageView.ts', UIStrings);
126
128
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
129
+ const {ref} = Directives;
130
+ const {bindToAction} = UI.UIUtils;
131
+ const {bindToSetting} = UI.SettingsUI;
127
132
 
128
133
  let coverageViewInstance: CoverageView|undefined;
129
134
 
130
135
  export class CoverageView extends UI.Widget.VBox {
131
136
  private model: CoverageModel|null;
132
137
  private decorationManager: CoverageDecorationManager|null;
133
- private readonly coverageTypeComboBox: UI.Toolbar.ToolbarComboBox;
138
+ private coverageTypeComboBox!: HTMLSelectElement;
134
139
  private readonly coverageTypeComboBoxSetting: Common.Settings.Setting<number>;
135
140
  private toggleRecordAction: UI.ActionRegistration.Action;
136
- private readonly toggleRecordButton: UI.Toolbar.ToolbarButton;
141
+ private toggleRecordButton!: Buttons.Button.Button;
137
142
  private inlineReloadButton: Element|null;
138
- private readonly startWithReloadButton: UI.Toolbar.ToolbarButton|undefined;
143
+ private startWithReloadButton!: Buttons.Button.Button|undefined;
139
144
  private readonly clearAction: UI.ActionRegistration.Action;
140
145
  private readonly exportAction: UI.ActionRegistration.Action;
141
146
  private textFilterRegExp: RegExp|null;
142
- private readonly filterInput: UI.Toolbar.ToolbarInput;
147
+ private filterInput!: UI.Toolbar.ToolbarInputElement;
143
148
  private typeFilterValue: number|null;
144
- private readonly filterByTypeComboBox: UI.Toolbar.ToolbarComboBox;
149
+ private filterByTypeComboBox!: HTMLSelectElement;
145
150
  private showContentScriptsSetting: Common.Settings.Setting<boolean>;
146
- private readonly contentScriptsCheckbox: UI.Toolbar.ToolbarSettingCheckbox;
147
- private readonly coverageResultsElement: HTMLElement;
151
+ private contentScriptsCheckbox!: UI.UIUtils.CheckboxLabel;
152
+ private coverageResultsElement!: HTMLElement;
148
153
  private readonly landingPage: UI.Widget.VBox;
149
154
  private readonly bfcacheReloadPromptPage: UI.Widget.VBox;
150
155
  private readonly activationReloadPromptPage: UI.Widget.VBox;
151
156
  private listView: CoverageListView;
152
- private readonly statusToolbarElement: HTMLElement;
153
- private statusMessageElement: HTMLElement;
157
+ private statusMessageElement!: HTMLElement;
154
158
 
155
159
  constructor() {
156
160
  super({
@@ -162,109 +166,103 @@ export class CoverageView extends UI.Widget.VBox {
162
166
  this.model = null;
163
167
  this.decorationManager = null;
164
168
 
165
- const toolbarContainer = this.contentElement.createChild('div', 'coverage-toolbar-container');
166
- toolbarContainer.setAttribute('jslog', `${VisualLogging.toolbar()}`);
167
- toolbarContainer.role = 'toolbar';
168
- const toolbar = toolbarContainer.createChild('devtools-toolbar', 'coverage-toolbar');
169
- toolbar.role = 'presentation';
170
- toolbar.wrappable = true;
171
-
172
- this.coverageTypeComboBox = new UI.Toolbar.ToolbarComboBox(
173
- this.onCoverageTypeComboBoxSelectionChanged.bind(this), i18nString(UIStrings.chooseCoverageGranularityPer),
174
- undefined, 'coverage-type');
175
- const coverageTypes = [
176
- {
177
- label: i18nString(UIStrings.perFunction),
178
- value: CoverageType.JAVA_SCRIPT | CoverageType.JAVA_SCRIPT_PER_FUNCTION,
179
- },
180
- {
181
- label: i18nString(UIStrings.perBlock),
182
- value: CoverageType.JAVA_SCRIPT,
183
- },
184
- ];
185
- for (const type of coverageTypes) {
186
- this.coverageTypeComboBox.addOption(this.coverageTypeComboBox.createOption(type.label, `${type.value}`));
187
- }
188
169
  this.coverageTypeComboBoxSetting =
189
170
  Common.Settings.Settings.instance().createSetting('coverage-view-coverage-type', 0);
190
- this.coverageTypeComboBox.setSelectedIndex(this.coverageTypeComboBoxSetting.get());
191
- this.coverageTypeComboBox.setEnabled(true);
192
- toolbar.appendToolbarItem(this.coverageTypeComboBox);
171
+
193
172
  this.toggleRecordAction = UI.ActionRegistry.ActionRegistry.instance().getAction('coverage.toggle-recording');
194
- this.toggleRecordButton = UI.Toolbar.Toolbar.createActionButton(this.toggleRecordAction);
195
- toolbar.appendToolbarItem(this.toggleRecordButton);
196
173
 
197
174
  const mainTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
198
- const mainTargetSupportsRecordOnReload = mainTarget?.model(SDK.ResourceTreeModel.ResourceTreeModel);
175
+ const mainTargetSupportsRecordOnReload = Boolean(mainTarget?.model(SDK.ResourceTreeModel.ResourceTreeModel));
199
176
  this.inlineReloadButton = null;
200
- if (mainTargetSupportsRecordOnReload) {
201
- this.startWithReloadButton = UI.Toolbar.Toolbar.createActionButton('coverage.start-with-reload');
202
- toolbar.appendToolbarItem(this.startWithReloadButton);
203
- this.toggleRecordButton.setEnabled(false);
204
- this.toggleRecordButton.setVisible(false);
205
- }
206
177
  this.clearAction = UI.ActionRegistry.ActionRegistry.instance().getAction('coverage.clear');
207
178
  this.clearAction.setEnabled(false);
208
- toolbar.appendToolbarItem(UI.Toolbar.Toolbar.createActionButton(this.clearAction));
209
-
210
- toolbar.appendSeparator();
211
179
  this.exportAction = UI.ActionRegistry.ActionRegistry.instance().getAction('coverage.export');
212
180
  this.exportAction.setEnabled(false);
213
- toolbar.appendToolbarItem(UI.Toolbar.Toolbar.createActionButton(this.exportAction));
214
181
 
215
182
  this.textFilterRegExp = null;
216
- toolbar.appendSeparator();
217
- this.filterInput = new UI.Toolbar.ToolbarFilter(i18nString(UIStrings.filterByUrl), 1, 1);
218
- this.filterInput.setEnabled(false);
219
- this.filterInput.addEventListener(UI.Toolbar.ToolbarInput.Event.TEXT_CHANGED, this.onFilterChanged, this);
220
- toolbar.appendToolbarItem(this.filterInput);
221
-
222
- toolbar.appendSeparator();
223
183
 
224
184
  this.typeFilterValue = null;
225
- this.filterByTypeComboBox = new UI.Toolbar.ToolbarComboBox(
226
- this.onFilterByTypeChanged.bind(this), i18nString(UIStrings.filterCoverageByType), undefined,
227
- 'coverage-by-type');
228
- const options = [
229
- {
230
- label: i18nString(UIStrings.all),
231
- value: '',
232
- },
233
- {
234
- label: i18nString(UIStrings.css),
235
- value: CoverageType.CSS,
236
- },
237
- {
238
- label: i18nString(UIStrings.javascript),
239
- value: CoverageType.JAVA_SCRIPT | CoverageType.JAVA_SCRIPT_PER_FUNCTION,
240
- },
241
- ];
242
- for (const option of options) {
243
- this.filterByTypeComboBox.addOption(this.filterByTypeComboBox.createOption(option.label, `${option.value}`));
244
- }
245
-
246
- this.filterByTypeComboBox.setSelectedIndex(0);
247
- this.filterByTypeComboBox.setEnabled(false);
248
- toolbar.appendToolbarItem(this.filterByTypeComboBox);
249
-
250
- toolbar.appendSeparator();
185
+
251
186
  this.showContentScriptsSetting = Common.Settings.Settings.instance().createSetting('show-content-scripts', false);
252
187
  this.showContentScriptsSetting.addChangeListener(this.onFilterChanged, this);
253
- this.contentScriptsCheckbox = new UI.Toolbar.ToolbarSettingCheckbox(
254
- this.showContentScriptsSetting, i18nString(UIStrings.includeExtensionContentScripts),
255
- i18nString(UIStrings.contentScripts));
256
- this.contentScriptsCheckbox.setEnabled(false);
257
- toolbar.appendToolbarItem(this.contentScriptsCheckbox);
258
188
 
259
- this.coverageResultsElement = this.contentElement.createChild('div', 'coverage-results');
189
+ // clang-format off
190
+ render(html`
191
+ <style>${coverageViewStyles}</style>
192
+ <div class="coverage-toolbar-container" jslog=${VisualLogging.toolbar()} role="toolbar">
193
+ <devtools-toolbar class="coverage-toolbar" role="presentation" wrappable>
194
+ <select title=${i18nString(UIStrings.chooseCoverageGranularityPer)}
195
+ aria-label=${i18nString(UIStrings.chooseCoverageGranularityPer)}
196
+ jslog=${VisualLogging.dropDown('coverage-type').track({change: true})}
197
+ @change=${this.onCoverageTypeComboBoxSelectionChanged.bind(this)}
198
+ ${ref(e => { if (e instanceof HTMLSelectElement) { this.coverageTypeComboBox = e; } })}>
199
+ <option value=${CoverageType.JAVA_SCRIPT | CoverageType.JAVA_SCRIPT_PER_FUNCTION}
200
+ jslog=${VisualLogging.item(`${CoverageType.JAVA_SCRIPT | CoverageType.JAVA_SCRIPT_PER_FUNCTION}`).track({click: true})}>
201
+ ${i18nString(UIStrings.perFunction)}
202
+ </option>
203
+ <option value=${CoverageType.JAVA_SCRIPT}
204
+ jslog=${VisualLogging.item(`${CoverageType.JAVA_SCRIPT}`).track({click: true})}>
205
+ ${i18nString(UIStrings.perBlock)}
206
+ </option>
207
+ </select>
208
+ ${mainTargetSupportsRecordOnReload ? html`
209
+ <devtools-button ${bindToAction('coverage.start-with-reload')}
210
+ ${ref(e => { if (e instanceof Buttons.Button.Button) { this.startWithReloadButton = e; } })}>
211
+ </devtools-button>` : nothing}
212
+ <devtools-button ${bindToAction('coverage.toggle-recording')}
213
+ .disabled=${mainTargetSupportsRecordOnReload}
214
+ .hidden=${mainTargetSupportsRecordOnReload}
215
+ ${ref(e => { if (e instanceof Buttons.Button.Button) { this.toggleRecordButton = e; } })}>
216
+ </devtools-button>
217
+ <devtools-button ${bindToAction('coverage.clear')}></devtools-button>
218
+ <div class="toolbar-divider"></div>
219
+ <devtools-button ${bindToAction('coverage.export')}></devtools-button>
220
+ <div class="toolbar-divider"></div>
221
+ <devtools-toolbar-input type="filter" placeholder=${i18nString(UIStrings.filterByUrl)}
222
+ disabled @change=${this.onFilterChanged.bind(this)} style="flex-grow:1; flex-shrink:1"
223
+ ${ref(e => { if (e instanceof UI.Toolbar.ToolbarInputElement) { this.filterInput = e; } })}>
224
+ </devtools-toolbar-input>
225
+ <div class="toolbar-divider"></div>
226
+ <select title=${i18nString(UIStrings.filterCoverageByType)}
227
+ aria-label=${i18nString(UIStrings.filterCoverageByType)}
228
+ jslog=${VisualLogging.dropDown('coverage-by-type').track({change: true})} disabled
229
+ @change=${this.onFilterByTypeChanged.bind(this)}
230
+ ${ref(e => { if (e instanceof HTMLSelectElement) { this.filterByTypeComboBox = e; } })}>
231
+ <option value="" jslog=${VisualLogging.item('').track({click: true})}>${i18nString(UIStrings.all)}</option>
232
+ <option value=${CoverageType.CSS}
233
+ jslog=${VisualLogging.item(`${CoverageType.CSS}`).track({click: true})}>
234
+ ${i18nString(UIStrings.css)}
235
+ </option>
236
+ <option value=${CoverageType.JAVA_SCRIPT | CoverageType.JAVA_SCRIPT_PER_FUNCTION}
237
+ jslog=${VisualLogging.item(`${CoverageType.JAVA_SCRIPT | CoverageType.JAVA_SCRIPT_PER_FUNCTION}`).track({click: true})}>
238
+ ${i18nString(UIStrings.javascript)}
239
+ </option>
240
+ </select>
241
+ <div class="toolbar-divider"></div>
242
+ <devtools-checkbox title=${i18nString(UIStrings.includeExtensionContentScripts)} disabled
243
+ ${bindToSetting(this.showContentScriptsSetting)}
244
+ ${ref(e => { if (e instanceof UI.UIUtils.CheckboxLabel) { this.contentScriptsCheckbox = e; } })}>
245
+ ${i18nString(UIStrings.contentScripts)}
246
+ </devtools-checkbox>
247
+ </devtools-toolbar>
248
+ </div>
249
+ <div class="coverage-results"
250
+ ${ref(e => { if (e instanceof HTMLElement) { this.coverageResultsElement = e; } })}>
251
+ </div>
252
+ <div class="coverage-toolbar-summary">
253
+ <div class="coverage-message"
254
+ ${ref(e => { if (e instanceof HTMLElement) { this.statusMessageElement = e; } })}>
255
+ </div>
256
+ </div>`, this.contentElement);
257
+ // clang-format on
258
+
259
+ this.coverageTypeComboBox.selectedIndex = this.coverageTypeComboBoxSetting.get();
260
260
  this.landingPage = this.buildLandingPage();
261
261
  this.bfcacheReloadPromptPage = this.buildReloadPromptPage(i18nString(UIStrings.bfcacheNoCapture), 'bfcache-page');
262
262
  this.activationReloadPromptPage =
263
263
  this.buildReloadPromptPage(i18nString(UIStrings.activationNoCapture), 'prerender-page');
264
264
  this.listView = new CoverageListView();
265
265
 
266
- this.statusToolbarElement = this.contentElement.createChild('div', 'coverage-toolbar-summary');
267
- this.statusMessageElement = this.statusToolbarElement.createChild('div', 'coverage-message');
268
266
  this.landingPage.show(this.coverageResultsElement);
269
267
  }
270
268
 
@@ -333,9 +331,9 @@ export class CoverageView extends UI.Widget.VBox {
333
331
  this.listView.detach();
334
332
  this.landingPage.show(this.coverageResultsElement);
335
333
  this.statusMessageElement.textContent = '';
336
- this.filterInput.setEnabled(false);
337
- this.filterByTypeComboBox.setEnabled(false);
338
- this.contentScriptsCheckbox.setEnabled(false);
334
+ this.filterInput.disabled = true;
335
+ this.filterByTypeComboBox.disabled = true;
336
+ this.contentScriptsCheckbox.disabled = true;
339
337
  this.exportAction.setEnabled(false);
340
338
  }
341
339
 
@@ -350,7 +348,7 @@ export class CoverageView extends UI.Widget.VBox {
350
348
  }
351
349
 
352
350
  isBlockCoverageSelected(): boolean {
353
- const option = this.coverageTypeComboBox.selectedOption();
351
+ const option = this.coverageTypeComboBox.selectedOptions[0];
354
352
  const coverageType = Number(option ? option.value : Number.NaN);
355
353
  // Check that Coverage.CoverageType.JavaScriptPerFunction is not present.
356
354
  return coverageType === CoverageType.JAVA_SCRIPT;
@@ -358,17 +356,17 @@ export class CoverageView extends UI.Widget.VBox {
358
356
 
359
357
  private selectCoverageType(jsCoveragePerBlock: boolean): void {
360
358
  const selectedIndex = jsCoveragePerBlock ? 1 : 0;
361
- this.coverageTypeComboBox.setSelectedIndex(selectedIndex);
359
+ this.coverageTypeComboBox.selectedIndex = selectedIndex;
362
360
  }
363
361
 
364
362
  private onCoverageTypeComboBoxSelectionChanged(): void {
365
- this.coverageTypeComboBoxSetting.set(this.coverageTypeComboBox.selectedIndex());
363
+ this.coverageTypeComboBoxSetting.set(this.coverageTypeComboBox.selectedIndex);
366
364
  }
367
365
 
368
366
  async startRecording(options: {reload: (boolean|undefined), jsCoveragePerBlock: (boolean|undefined)}|null):
369
367
  Promise<void> {
370
368
  let hadFocus, reloadButtonFocused;
371
- if ((this.startWithReloadButton?.element.hasFocus()) || (this.inlineReloadButton?.hasFocus())) {
369
+ if ((this.startWithReloadButton?.hasFocus()) || (this.inlineReloadButton?.hasFocus())) {
372
370
  reloadButtonFocused = true;
373
371
  } else if (this.hasFocus()) {
374
372
  hadFocus = true;
@@ -410,18 +408,18 @@ export class CoverageView extends UI.Widget.VBox {
410
408
  this.toggleRecordAction.setToggled(true);
411
409
  this.clearAction.setEnabled(false);
412
410
  if (this.startWithReloadButton) {
413
- this.startWithReloadButton.setEnabled(false);
414
- this.startWithReloadButton.setVisible(false);
415
- this.toggleRecordButton.setEnabled(true);
416
- this.toggleRecordButton.setVisible(true);
411
+ this.startWithReloadButton.disabled = true;
412
+ this.startWithReloadButton.hidden = true;
413
+ this.toggleRecordButton.disabled = false;
414
+ this.toggleRecordButton.hidden = false;
417
415
  if (reloadButtonFocused) {
418
416
  this.toggleRecordButton.focus();
419
417
  }
420
418
  }
421
- this.coverageTypeComboBox.setEnabled(false);
422
- this.filterInput.setEnabled(true);
423
- this.filterByTypeComboBox.setEnabled(true);
424
- this.contentScriptsCheckbox.setEnabled(true);
419
+ this.coverageTypeComboBox.disabled = true;
420
+ this.filterInput.disabled = false;
421
+ this.filterByTypeComboBox.disabled = false;
422
+ this.contentScriptsCheckbox.disabled = false;
425
423
  if (this.landingPage.isShowing()) {
426
424
  this.landingPage.detach();
427
425
  }
@@ -480,12 +478,12 @@ export class CoverageView extends UI.Widget.VBox {
480
478
  this.model.removeEventListener(Events.CoverageUpdated, this.onCoverageDataReceived, this);
481
479
  }
482
480
  this.toggleRecordAction.setToggled(false);
483
- this.coverageTypeComboBox.setEnabled(true);
481
+ this.coverageTypeComboBox.disabled = false;
484
482
  if (this.startWithReloadButton) {
485
- this.startWithReloadButton.setEnabled(true);
486
- this.startWithReloadButton.setVisible(true);
487
- this.toggleRecordButton.setEnabled(false);
488
- this.toggleRecordButton.setVisible(false);
483
+ this.startWithReloadButton.disabled = false;
484
+ this.startWithReloadButton.hidden = false;
485
+ this.toggleRecordButton.disabled = true;
486
+ this.toggleRecordButton.hidden = true;
489
487
  }
490
488
  this.clearAction.setEnabled(true);
491
489
  }
@@ -593,7 +591,7 @@ export class CoverageView extends UI.Widget.VBox {
593
591
  if (!this.listView) {
594
592
  return;
595
593
  }
596
- const text = this.filterInput.value();
594
+ const text = this.filterInput.value;
597
595
  this.textFilterRegExp = text ? Platform.StringUtilities.createPlainTextSearchRegex(text, 'i') : null;
598
596
  this.updateListView();
599
597
  this.updateStats();
@@ -606,7 +604,7 @@ export class CoverageView extends UI.Widget.VBox {
606
604
 
607
605
  Host.userMetrics.actionTaken(Host.UserMetrics.Action.CoverageReportFiltered);
608
606
 
609
- const option = this.filterByTypeComboBox.selectedOption();
607
+ const option = this.filterByTypeComboBox.selectedOptions[0];
610
608
  const type = option?.value;
611
609
  this.typeFilterValue = parseInt(type || '', 10) || null;
612
610
  this.updateListView();
@@ -145,24 +145,16 @@ export class LinearMemoryInspectorView extends UI.Widget.VBox {
145
145
  this.firstTimeOpen = true;
146
146
 
147
147
  this.#inspector = new LinearMemoryInspectorComponents.LinearMemoryInspector.LinearMemoryInspector();
148
- this.#inspector.contentElement.addEventListener(
149
- LinearMemoryInspectorComponents.LinearMemoryInspector.MemoryRequestEvent.eventName,
150
- (event: LinearMemoryInspectorComponents.LinearMemoryInspector.MemoryRequestEvent) =>
151
- this.#memoryRequested(event));
152
- this.#inspector.contentElement.addEventListener(
153
- LinearMemoryInspectorComponents.LinearMemoryInspector.AddressChangedEvent.eventName,
154
- (event: LinearMemoryInspectorComponents.LinearMemoryInspector.AddressChangedEvent) =>
155
- this.updateAddress(event.data));
156
- this.#inspector.contentElement.addEventListener(
157
- LinearMemoryInspectorComponents.LinearMemoryInspector.SettingsChangedEvent.eventName,
158
- (event: LinearMemoryInspectorComponents.LinearMemoryInspector.SettingsChangedEvent) => {
159
- // Stop event from bubbling up, since no element further up needs the event.
160
- event.stopPropagation();
161
- this.saveSettings(event.data);
162
- });
163
- this.#inspector.contentElement.addEventListener(
164
- LinearMemoryInspectorComponents.LinearMemoryHighlightChipList.DeleteMemoryHighlightEvent.eventName,
165
- (event: LinearMemoryInspectorComponents.LinearMemoryHighlightChipList.DeleteMemoryHighlightEvent) => {
148
+ this.#inspector.addEventListener(
149
+ LinearMemoryInspectorComponents.LinearMemoryInspector.Events.MEMORY_REQUEST, this.#memoryRequested, this);
150
+ this.#inspector.addEventListener(
151
+ LinearMemoryInspectorComponents.LinearMemoryInspector.Events.ADDRESS_CHANGED,
152
+ event => this.updateAddress(event.data));
153
+ this.#inspector.addEventListener(
154
+ LinearMemoryInspectorComponents.LinearMemoryInspector.Events.SETTINGS_CHANGED,
155
+ event => this.saveSettings(event.data));
156
+ this.#inspector.addEventListener(
157
+ LinearMemoryInspectorComponents.LinearMemoryInspector.Events.DELETE_MEMORY_HIGHLIGHT, event => {
166
158
  LinearMemoryInspectorController.instance().removeHighlight(this.#tabId, event.data);
167
159
  this.refreshData();
168
160
  });
@@ -214,7 +206,7 @@ export class LinearMemoryInspectorView extends UI.Widget.VBox {
214
206
  });
215
207
  }
216
208
 
217
- #memoryRequested(event: LinearMemoryInspectorComponents.LinearMemoryInspector.MemoryRequestEvent): void {
209
+ #memoryRequested(event: Common.EventTarget.EventTargetEvent<{start: number, end: number, address: number}>): void {
218
210
  const {start, end, address} = event.data;
219
211
  if (address < start || address >= end) {
220
212
  throw new Error('Requested address is out of bounds.');
@@ -68,34 +68,18 @@ export interface Settings {
68
68
  endianness: Endianness;
69
69
  }
70
70
 
71
- export class MemoryRequestEvent extends Event {
72
- static readonly eventName = 'memoryrequest';
73
- data: {start: number, end: number, address: number};
74
-
75
- constructor(start: number, end: number, address: number) {
76
- super(MemoryRequestEvent.eventName);
77
- this.data = {start, end, address};
78
- }
71
+ export const enum Events {
72
+ MEMORY_REQUEST = 'MemoryRequest',
73
+ ADDRESS_CHANGED = 'AddressChanged',
74
+ SETTINGS_CHANGED = 'SettingsChanged',
75
+ DELETE_MEMORY_HIGHLIGHT = 'DeleteMemoryHighlight',
79
76
  }
80
77
 
81
- export class AddressChangedEvent extends Event {
82
- static readonly eventName = 'addresschanged';
83
- data: number;
84
-
85
- constructor(address: number) {
86
- super(AddressChangedEvent.eventName);
87
- this.data = address;
88
- }
89
- }
90
-
91
- export class SettingsChangedEvent extends Event {
92
- static readonly eventName = 'settingschanged';
93
- data: Settings;
94
-
95
- constructor(settings: Settings) {
96
- super(SettingsChangedEvent.eventName);
97
- this.data = settings;
98
- }
78
+ export interface EventTypes {
79
+ [Events.MEMORY_REQUEST]: {start: number, end: number, address: number};
80
+ [Events.ADDRESS_CHANGED]: number;
81
+ [Events.SETTINGS_CHANGED]: Settings;
82
+ [Events.DELETE_MEMORY_HIGHLIGHT]: HighlightInfo;
99
83
  }
100
84
 
101
85
  class AddressHistoryEntry implements Common.SimpleHistoryManager.HistoryEntry {
@@ -138,6 +122,7 @@ export interface ViewInput {
138
122
  onNavigatePage: (e: PageNavigationEvent) => void;
139
123
  onNavigateHistory: (e: HistoryNavigationEvent) => boolean;
140
124
  onJumpToAddress: (e: JumpToPointerAddressEvent|JumpToHighlightedMemoryEvent) => void;
125
+ onDeleteMemoryHighlight: (e: DeleteMemoryHighlightEvent) => void;
141
126
  onByteSelected: (e: ByteSelectedEvent) => void;
142
127
  onResize: (e: ResizeEvent) => void;
143
128
  onValueTypeToggled: (e: ValueTypeToggledEvent) => void;
@@ -180,7 +165,8 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: Record<string, unknown>,
180
165
  @historynavigation=${input.onNavigateHistory}></devtools-linear-memory-inspector-navigator>
181
166
  <devtools-linear-memory-highlight-chip-list
182
167
  .data=${{highlightInfos: highlightedMemoryAreas, focusedMemoryHighlight}}
183
- @jumptohighlightedmemory=${input.onJumpToAddress}>
168
+ @jumptohighlightedmemory=${input.onJumpToAddress}
169
+ @deletememoryhighlight=${input.onDeleteMemoryHighlight}>
184
170
  </devtools-linear-memory-highlight-chip-list>
185
171
  <devtools-linear-memory-inspector-viewer
186
172
  .data=${
@@ -263,7 +249,8 @@ function getSmallestEnclosingMemoryHighlight(highlightedMemoryAreas: HighlightIn
263
249
 
264
250
  export type View = typeof DEFAULT_VIEW;
265
251
 
266
- export class LinearMemoryInspector extends UI.Widget.Widget {
252
+ export class LinearMemoryInspector extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.Widget>(
253
+ UI.Widget.Widget) {
267
254
  readonly #history = new Common.SimpleHistoryManager.SimpleHistoryManager(10);
268
255
 
269
256
  #memory = new Uint8Array();
@@ -338,7 +325,7 @@ export class LinearMemoryInspector extends UI.Widget.Widget {
338
325
  const {start, end} = getPageRangeForAddress(this.#address, this.#numBytesPerPage, this.#outerMemoryLength);
339
326
 
340
327
  if (start < this.#memoryOffset || end > this.#memoryOffset + this.#memory.length) {
341
- this.contentElement.dispatchEvent(new MemoryRequestEvent(start, end, this.#address));
328
+ this.dispatchEventToListeners(Events.MEMORY_REQUEST, {start, end, address: this.#address});
342
329
  return;
343
330
  }
344
331
 
@@ -377,6 +364,7 @@ export class LinearMemoryInspector extends UI.Widget.Widget {
377
364
  onNavigatePage: this.#navigatePage.bind(this),
378
365
  onNavigateHistory: this.#navigateHistory.bind(this),
379
366
  onJumpToAddress: this.#onJumpToAddress.bind(this),
367
+ onDeleteMemoryHighlight: this.#onDeleteMemoryHighlight.bind(this),
380
368
  onByteSelected: this.#onByteSelected.bind(this),
381
369
  onResize: this.#resize.bind(this),
382
370
  onValueTypeToggled: this.#onValueTypeToggled.bind(this),
@@ -396,9 +384,14 @@ export class LinearMemoryInspector extends UI.Widget.Widget {
396
384
  this.#jumpToAddress(addressInRange);
397
385
  }
398
386
 
387
+ #onDeleteMemoryHighlight(e: DeleteMemoryHighlightEvent): void {
388
+ e.stopPropagation();
389
+ this.dispatchEventToListeners(Events.DELETE_MEMORY_HIGHLIGHT, e.data);
390
+ }
391
+
399
392
  #onRefreshRequest(): void {
400
393
  const {start, end} = getPageRangeForAddress(this.#address, this.#numBytesPerPage, this.#outerMemoryLength);
401
- this.contentElement.dispatchEvent(new MemoryRequestEvent(start, end, this.#address));
394
+ this.dispatchEventToListeners(Events.MEMORY_REQUEST, {start, end, address: this.#address});
402
395
  }
403
396
 
404
397
  #onByteSelected(e: ByteSelectedEvent): void {
@@ -413,7 +406,7 @@ export class LinearMemoryInspector extends UI.Widget.Widget {
413
406
 
414
407
  #onEndiannessChanged(e: EndiannessChangedEvent): void {
415
408
  this.#endianness = e.data;
416
- this.contentElement.dispatchEvent(new SettingsChangedEvent(this.#createSettings()));
409
+ this.dispatchEventToListeners(Events.SETTINGS_CHANGED, this.#createSettings());
417
410
  void this.requestUpdate();
418
411
  }
419
412
 
@@ -445,7 +438,7 @@ export class LinearMemoryInspector extends UI.Widget.Widget {
445
438
  } else {
446
439
  this.#valueTypes.delete(type);
447
440
  }
448
- this.contentElement.dispatchEvent(new SettingsChangedEvent(this.#createSettings()));
441
+ this.dispatchEventToListeners(Events.SETTINGS_CHANGED, this.#createSettings());
449
442
  void this.requestUpdate();
450
443
  }
451
444
 
@@ -453,7 +446,7 @@ export class LinearMemoryInspector extends UI.Widget.Widget {
453
446
  e.stopImmediatePropagation();
454
447
  const {type, mode} = e.data;
455
448
  this.#valueTypeModes.set(type, mode);
456
- this.contentElement.dispatchEvent(new SettingsChangedEvent(this.#createSettings()));
449
+ this.dispatchEventToListeners(Events.SETTINGS_CHANGED, this.#createSettings());
457
450
  void this.requestUpdate();
458
451
  }
459
452
 
@@ -490,16 +483,7 @@ export class LinearMemoryInspector extends UI.Widget.Widget {
490
483
  const historyEntry = new AddressHistoryEntry(address, () => this.#jumpToAddress(address));
491
484
  this.#history.push(historyEntry);
492
485
  this.#address = address;
493
- this.contentElement.dispatchEvent(new AddressChangedEvent(this.#address));
486
+ this.dispatchEventToListeners(Events.ADDRESS_CHANGED, this.#address);
494
487
  void this.requestUpdate();
495
488
  }
496
489
  }
497
-
498
- declare global {
499
- interface HTMLElementEventMap {
500
- memoryrequest: MemoryRequestEvent;
501
- addresschanged: AddressChangedEvent;
502
- settingschanged: SettingsChangedEvent;
503
- deletememoryhighlight: DeleteMemoryHighlightEvent;
504
- }
505
- }
@@ -56,7 +56,7 @@ export const DEFAULT_VIEW: View = (input: ViewInput, output: ViewOutput, target:
56
56
  i18nString(UIStrings.failedToLoadResponseData), (input.contentData as {error: string}).error,
57
57
  element))}></devtools-widget>`;
58
58
  // clang-format on
59
- } else if (input.request.statusCode === 204) {
59
+ } else if (input.request.statusCode === 204 || input.request.failed) {
60
60
  // clang-format off
61
61
  widget = html`<devtools-widget
62
62
  .widgetConfig=${widgetConfig(element => new UI.EmptyWidget.EmptyWidget(
@@ -310,7 +310,7 @@ let isNode: boolean;
310
310
 
311
311
  /**
312
312
  * Represents the states that the timeline panel can be in.
313
- * If you need to change the panel's view, use the {@see #changeView} method.
313
+ * If you need to change the panel's view, use the {@link TimelinePanel.#changeView} method.
314
314
  * Note that we do not represent the "Loading/Processing" view here. The
315
315
  * StatusPane is managed in the code that handles file import/recording, and
316
316
  * when it is visible it is rendered on top of the UI so obscures what is behind
@@ -787,8 +787,8 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
787
787
  }
788
788
 
789
789
  /**
790
- * Determine if two view modes are equivalent. Useful because if {@see
791
- * #changeView} gets called and the new mode is identical to the current,
790
+ * Determine if two view modes are equivalent. Useful because if
791
+ * {@link TimelinePanel.#changeView} gets called and the new mode is identical to the current,
792
792
  * we can bail without doing any UI updates.
793
793
  */
794
794
  #viewModesEquivalent(m1: ViewMode, m2: ViewMode): boolean {
@@ -2087,14 +2087,14 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
2087
2087
 
2088
2088
  /**
2089
2089
  * Called when we update the active trace that is being shown to the user.
2090
- * This is called from {@see changeView} when we change the UI to show a
2090
+ * This is called from {@link TimelinePanel.#changeView} when we change the UI to show a
2091
2091
  * trace - either one the user has just recorded/imported, or one they have
2092
2092
  * navigated to via the dropdown.
2093
2093
  *
2094
2094
  * If you need code to execute whenever the active trace changes, this is the method to use.
2095
- * If you need code to execute ONLY ON NEW TRACES, then use {@see loadingComplete}
2095
+ * If you need code to execute ONLY ON NEW TRACES, then use {@link TimelinePanel.loadingComplete}
2096
2096
  * You should not call this method directly if you want the UI to update; use
2097
- * {@see changeView} to control what is shown to the user.
2097
+ * {@link TimelinePanel.#changeView} to control what is shown to the user.
2098
2098
  */
2099
2099
  #setModelForActiveTrace(): void {
2100
2100
  if (this.#viewMode.mode !== 'VIEWING_TRACE') {
@@ -2249,8 +2249,10 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
2249
2249
  }
2250
2250
  }
2251
2251
 
2252
- UI.Context.Context.instance().setFlavor(
2253
- AiAssistanceModel.AgentFocus, AiAssistanceModel.AgentFocus.fromParsedTrace(parsedTrace));
2252
+ if (parsedTrace.metadata.dataOrigin !== Trace.Types.File.DataOrigin.CPU_PROFILE) {
2253
+ UI.Context.Context.instance().setFlavor(
2254
+ AiAssistanceModel.AgentFocus, AiAssistanceModel.AgentFocus.fromParsedTrace(parsedTrace));
2255
+ }
2254
2256
  }
2255
2257
 
2256
2258
  #onAnnotationModifiedEvent(e: Event): void {
@@ -235,7 +235,7 @@ export class ExportTraceOptions extends HTMLElement {
235
235
  ${checkboxesWithInfoDialog.has(checkboxId) ? html`
236
236
  <devtools-button
237
237
  aria-details=${`export-trace-tooltip-${checkboxId}`}
238
- aria-label=${this.#accessibleLabelForInfoCheckbox(checkboxId)}
238
+ .accessibleLabel=${this.#accessibleLabelForInfoCheckbox(checkboxId)}
239
239
  class="pen-icon"
240
240
  .iconName=${'info'}
241
241
  .variant=${Buttons.Button.Variant.ICON}
@@ -1,7 +1,7 @@
1
1
  Name: Dependencies sourced from the upstream `chromium` repository
2
2
  URL: https://source.chromium.org/chromium/chromium/src/+/main:components/variations/proto/devtools/
3
3
  Version: N/A
4
- Revision: 21c0e9d79181fd991f782bb74b0eb1c8bce10209
4
+ Revision: 4ceac4e2889e841baa72d3beb6c8eac6c0d2341e
5
5
  Update Mechanism: Manual (https://crbug.com/428069060)
6
6
  License: BSD-3-Clause
7
7
  License File: LICENSE