Skip to content

Commit 200f6f9

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored and
Devtools-frontend LUCI CQ
committed
[cleanup] Remove unused code
TypeScript report of unused code Bug: 409278895 Change-Id: I2457db195d095bc0932d07819d6905aaed6b8743 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6439152 Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
1 parent adb4323 commit 200f6f9

35 files changed

+51
-188
lines changed

front_end/core/common/Settings.ts

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -731,26 +731,26 @@ export class VersionController {
731731
return result;
732732
}
733733

734-
private updateVersionFrom0To1(): void {
734+
updateVersionFrom0To1(): void {
735735
this.clearBreakpointsWhenTooMany(Settings.instance().createLocalSetting('breakpoints', []), 500000);
736736
}
737737

738-
private updateVersionFrom1To2(): void {
738+
updateVersionFrom1To2(): void {
739739
Settings.instance().createSetting('previouslyViewedFiles', []).set([]);
740740
}
741741

742-
private updateVersionFrom2To3(): void {
742+
updateVersionFrom2To3(): void {
743743
Settings.instance().createSetting('fileSystemMapping', {}).set({});
744744
removeSetting(Settings.instance().createSetting('fileMappingEntries', []));
745745
}
746746

747-
private updateVersionFrom3To4(): void {
747+
updateVersionFrom3To4(): void {
748748
const advancedMode = Settings.instance().createSetting('showHeaSnapshotObjectsHiddenProperties', false);
749749
moduleSetting('showAdvancedHeapSnapshotProperties').set(advancedMode.get());
750750
removeSetting(advancedMode);
751751
}
752752

753-
private updateVersionFrom4To5(): void {
753+
updateVersionFrom4To5(): void {
754754
const settingNames: {
755755
[x: string]: string,
756756
} = {
@@ -804,7 +804,7 @@ export class VersionController {
804804
}
805805
}
806806

807-
private updateVersionFrom5To6(): void {
807+
updateVersionFrom5To6(): void {
808808
const settingNames: {
809809
[x: string]: string,
810810
} = {
@@ -844,7 +844,7 @@ export class VersionController {
844844
}
845845
}
846846

847-
private updateVersionFrom6To7(): void {
847+
updateVersionFrom6To7(): void {
848848
const settingNames = {
849849
sourcesPanelNavigatorSplitViewState: 'sourcesPanelNavigatorSplitViewState',
850850
elementsPanelSplitViewState: 'elementsPanelSplitViewState',
@@ -871,10 +871,10 @@ export class VersionController {
871871
}
872872
}
873873

874-
private updateVersionFrom7To8(): void {
874+
updateVersionFrom7To8(): void {
875875
}
876876

877-
private updateVersionFrom8To9(): void {
877+
updateVersionFrom8To9(): void {
878878
const settingNames = ['skipStackFramesPattern', 'workspaceFolderExcludePattern'];
879879

880880
for (let i = 0; i < settingNames.length; ++i) {
@@ -895,7 +895,7 @@ export class VersionController {
895895
}
896896
}
897897

898-
private updateVersionFrom9To10(): void {
898+
updateVersionFrom9To10(): void {
899899
// This one is localStorage specific, which is fine.
900900
if (!window.localStorage) {
901901
return;
@@ -907,7 +907,7 @@ export class VersionController {
907907
}
908908
}
909909

910-
private updateVersionFrom10To11(): void {
910+
updateVersionFrom10To11(): void {
911911
const oldSettingName = 'customDevicePresets';
912912
const newSettingName = 'customEmulatedDeviceList';
913913
const oldSetting = Settings.instance().createSetting<unknown>(oldSettingName, undefined);
@@ -948,21 +948,21 @@ export class VersionController {
948948
removeSetting(oldSetting);
949949
}
950950

951-
private updateVersionFrom11To12(): void {
951+
updateVersionFrom11To12(): void {
952952
this.migrateSettingsFromLocalStorage();
953953
}
954954

955-
private updateVersionFrom12To13(): void {
955+
updateVersionFrom12To13(): void {
956956
this.migrateSettingsFromLocalStorage();
957957
removeSetting(Settings.instance().createSetting('timelineOverviewMode', ''));
958958
}
959959

960-
private updateVersionFrom13To14(): void {
960+
updateVersionFrom13To14(): void {
961961
const defaultValue = {throughput: -1, latency: 0};
962962
Settings.instance().createSetting('networkConditions', defaultValue).set(defaultValue);
963963
}
964964

965-
private updateVersionFrom14To15(): void {
965+
updateVersionFrom14To15(): void {
966966
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
967967
// eslint-disable-next-line @typescript-eslint/no-explicit-any
968968
const setting = Settings.instance().createLocalSetting<any>('workspaceExcludedFolders', {});
@@ -979,7 +979,7 @@ export class VersionController {
979979
setting.set(newValue);
980980
}
981981

982-
private updateVersionFrom15To16(): void {
982+
updateVersionFrom15To16(): void {
983983
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
984984
// eslint-disable-next-line @typescript-eslint/no-explicit-any
985985
const setting = Settings.instance().createSetting<any>('InspectorView.panelOrder', {});
@@ -990,7 +990,7 @@ export class VersionController {
990990
setting.set(tabOrders);
991991
}
992992

993-
private updateVersionFrom16To17(): void {
993+
updateVersionFrom16To17(): void {
994994
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
995995
// eslint-disable-next-line @typescript-eslint/no-explicit-any
996996
const setting = Settings.instance().createSetting<any>('networkConditionsCustomProfiles', []);
@@ -1010,7 +1010,7 @@ export class VersionController {
10101010
setting.set(newValue);
10111011
}
10121012

1013-
private updateVersionFrom17To18(): void {
1013+
updateVersionFrom17To18(): void {
10141014
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
10151015
// eslint-disable-next-line @typescript-eslint/no-explicit-any
10161016
const setting = Settings.instance().createLocalSetting<any>('workspaceExcludedFolders', {});
@@ -1032,7 +1032,7 @@ export class VersionController {
10321032
setting.set(newValue);
10331033
}
10341034

1035-
private updateVersionFrom18To19(): void {
1035+
updateVersionFrom18To19(): void {
10361036
const defaultColumns = {status: true, type: true, initiator: true, size: true, time: true};
10371037
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
10381038
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1057,14 +1057,14 @@ export class VersionController {
10571057
removeSetting(visibleColumnSettings);
10581058
}
10591059

1060-
private updateVersionFrom19To20(): void {
1060+
updateVersionFrom19To20(): void {
10611061
const oldSetting = Settings.instance().createSetting('InspectorView.panelOrder', {});
10621062
const newSetting = Settings.instance().createSetting('panel-tabOrder', {});
10631063
newSetting.set(oldSetting.get());
10641064
removeSetting(oldSetting);
10651065
}
10661066

1067-
private updateVersionFrom20To21(): void {
1067+
updateVersionFrom20To21(): void {
10681068
const networkColumns = Settings.instance().createSetting('networkLogColumns', {});
10691069
const columns = (networkColumns.get() as {
10701070
[x: string]: string,
@@ -1074,7 +1074,7 @@ export class VersionController {
10741074
networkColumns.set(columns);
10751075
}
10761076

1077-
private updateVersionFrom21To22(): void {
1077+
updateVersionFrom21To22(): void {
10781078
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
10791079
// eslint-disable-next-line @typescript-eslint/no-explicit-any
10801080
const breakpointsSetting = Settings.instance().createLocalSetting<any>('breakpoints', []);
@@ -1086,18 +1086,18 @@ export class VersionController {
10861086
breakpointsSetting.set(breakpoints);
10871087
}
10881088

1089-
private updateVersionFrom22To23(): void {
1089+
updateVersionFrom22To23(): void {
10901090
// This update is no-op.
10911091
}
10921092

1093-
private updateVersionFrom23To24(): void {
1093+
updateVersionFrom23To24(): void {
10941094
const oldSetting = Settings.instance().createSetting('searchInContentScripts', false);
10951095
const newSetting = Settings.instance().createSetting('searchInAnonymousAndContentScripts', false);
10961096
newSetting.set(oldSetting.get());
10971097
removeSetting(oldSetting);
10981098
}
10991099

1100-
private updateVersionFrom24To25(): void {
1100+
updateVersionFrom24To25(): void {
11011101
const defaultColumns = {status: true, type: true, initiator: true, size: true, time: true};
11021102
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
11031103
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1107,7 +1107,7 @@ export class VersionController {
11071107
networkLogColumnsSetting.set(columns);
11081108
}
11091109

1110-
private updateVersionFrom25To26(): void {
1110+
updateVersionFrom25To26(): void {
11111111
const oldSetting = Settings.instance().createSetting('messageURLFilters', {});
11121112
const urls = Object.keys(oldSetting.get());
11131113
const textFilter = urls.map(url => `-url:${url}`).join(' ');
@@ -1121,7 +1121,7 @@ export class VersionController {
11211121
removeSetting(oldSetting);
11221122
}
11231123

1124-
private updateVersionFrom26To27(): void {
1124+
updateVersionFrom26To27(): void {
11251125
function renameKeyInObjectSetting(settingName: string, from: string, to: string): void {
11261126
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
11271127
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1147,14 +1147,14 @@ export class VersionController {
11471147
renameInStringSetting('panel-selectedTab', 'audits2', 'audits');
11481148
}
11491149

1150-
private updateVersionFrom27To28(): void {
1150+
updateVersionFrom27To28(): void {
11511151
const setting = Settings.instance().createSetting('uiTheme', 'systemPreferred');
11521152
if (setting.get() === 'default') {
11531153
setting.set('systemPreferred');
11541154
}
11551155
}
11561156

1157-
private updateVersionFrom28To29(): void {
1157+
updateVersionFrom28To29(): void {
11581158
function renameKeyInObjectSetting(settingName: string, from: string, to: string): void {
11591159
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
11601160
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1180,7 +1180,7 @@ export class VersionController {
11801180
renameInStringSetting('panel-selectedTab', 'audits', 'lighthouse');
11811181
}
11821182

1183-
private updateVersionFrom29To30(): void {
1183+
updateVersionFrom29To30(): void {
11841184
// Create new location agnostic setting
11851185
const closeableTabSetting = Settings.instance().createSetting('closeableTabs', {});
11861186

@@ -1199,7 +1199,7 @@ export class VersionController {
11991199
removeSetting(drawerCloseableTabSetting);
12001200
}
12011201

1202-
private updateVersionFrom30To31(): void {
1202+
updateVersionFrom30To31(): void {
12031203
// Remove recorder_recordings setting that was used for storing recordings
12041204
// by an old recorder experiment.
12051205
const recordingsSetting = Settings.instance().createSetting('recorder_recordings', []);

front_end/core/sdk/CSSPropertyParserMatchers.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,7 @@ export class LinearGradientMatcher extends matcherBase(LinearGradientMatch) {
342342

343343
export class ColorMatch implements Match {
344344
computedText: (() => string | null)|undefined;
345-
constructor(
346-
readonly text: string, readonly node: CodeMirror.SyntaxNode,
347-
private readonly currentColorCallback?: () => string | null) {
345+
constructor(readonly text: string, readonly node: CodeMirror.SyntaxNode, currentColorCallback?: () => string | null) {
348346
this.computedText = currentColorCallback;
349347
}
350348
}

front_end/core/sdk/CSSStyleSheetHeader.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import type {CSSModel} from './CSSModel.js';
1212
import {DeferredDOMNode} from './DOMModel.js';
1313
import type {FrameAssociated} from './FrameAssociated.js';
1414
import type {PageResourceLoadInitiator} from './PageResourceLoader.js';
15-
import {ResourceTreeModel} from './ResourceTreeModel.js';
1615

1716
const UIStrings = {
1817
/**
@@ -109,25 +108,6 @@ export class CSSStyleSheetHeader implements TextUtils.ContentProvider.ContentPro
109108
return this.isViaInspector() ? this.viaInspectorResourceURL() : this.sourceURL;
110109
}
111110

112-
private getFrameURLPath(): string {
113-
const model = this.#cssModelInternal.target().model(ResourceTreeModel);
114-
console.assert(Boolean(model));
115-
if (!model) {
116-
return '';
117-
}
118-
const frame = model.frameForId(this.frameId);
119-
if (!frame) {
120-
return '';
121-
}
122-
console.assert(Boolean(frame));
123-
const parsedURL = new Common.ParsedURL.ParsedURL(frame.url);
124-
let urlPath = parsedURL.host + parsedURL.folderPathComponents;
125-
if (!urlPath.endsWith('/')) {
126-
urlPath += '/';
127-
}
128-
return urlPath;
129-
}
130-
131111
private viaInspectorResourceURL(): Platform.DevToolsPath.UrlString {
132112
return `inspector:///inspector-stylesheet#${this.id}` as Platform.DevToolsPath.UrlString;
133113
}

front_end/core/sdk/LayerTreeBase.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,4 @@ export class LayerTreeBase {
167167
}|undefined {
168168
return this.#viewportSizeInternal;
169169
}
170-
171-
private nodeForId(id: Protocol.DOM.NodeId): DOMNode|null {
172-
return this.#domModel ? this.#domModel.nodeForId(id) : null;
173-
}
174170
}

front_end/core/sdk/NetworkManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ export class NetworkDispatcher implements ProtocolProxyApi.NetworkDispatcher {
13761376
* @deprecated
13771377
* This method is only kept for usage in a web test.
13781378
*/
1379-
private createNetworkRequest(
1379+
protected createNetworkRequest(
13801380
requestId: Protocol.Network.RequestId, frameId: Protocol.Page.FrameId, loaderId: Protocol.Network.LoaderId,
13811381
url: string, documentURL: string, initiator: Protocol.Network.Initiator|null): NetworkRequest {
13821382
const request = NetworkRequest.create(

front_end/models/persistence/NetworkPersistenceManager.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export class NetworkPersistenceManager extends Common.ObjectWrapper.ObjectWrappe
2525
private bindings: WeakMap<Workspace.UISourceCode.UISourceCode, PersistenceBinding>;
2626
private readonly originalResponseContentPromises: WeakMap<Workspace.UISourceCode.UISourceCode, Promise<string|null>>;
2727
private savingForOverrides: WeakSet<Workspace.UISourceCode.UISourceCode>;
28-
private readonly savingSymbol: symbol;
2928
private enabledSetting: Common.Settings.Setting<boolean>;
3029
private readonly workspace: Workspace.Workspace.WorkspaceImpl;
3130
private readonly networkUISourceCodeForEncodedPath:
@@ -34,7 +33,6 @@ export class NetworkPersistenceManager extends Common.ObjectWrapper.ObjectWrappe
3433
(interceptedRequest: SDK.NetworkManager.InterceptedRequest) => Promise<void>;
3534
private readonly updateInterceptionThrottler: Common.Throttler.Throttler;
3635
private projectInternal: Workspace.Workspace.Project|null;
37-
private readonly activeProject: Workspace.Workspace.Project|null;
3836
private activeInternal: boolean;
3937
private enabled: boolean;
4038
private eventDescriptors: Common.EventTarget.EventDescriptor[];
@@ -48,7 +46,6 @@ export class NetworkPersistenceManager extends Common.ObjectWrapper.ObjectWrappe
4846
this.bindings = new WeakMap();
4947
this.originalResponseContentPromises = new WeakMap();
5048
this.savingForOverrides = new WeakSet();
51-
this.savingSymbol = Symbol('SavingForOverrides');
5249

5350
this.enabledSetting = Common.Settings.Settings.instance().moduleSetting('persistence-network-overrides-enabled');
5451
this.enabledSetting.addChangeListener(this.enabledChanged, this);
@@ -62,7 +59,6 @@ export class NetworkPersistenceManager extends Common.ObjectWrapper.ObjectWrappe
6259
this.#headerOverridesForEventDispatch = new Set();
6360

6461
this.projectInternal = null;
65-
this.activeProject = null;
6662

6763
this.activeInternal = false;
6864
this.enabled = false;

front_end/panels/accessibility/ARIAAttributesView.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export class ARIAAttributesTreeElement extends UI.TreeOutline.TreeElement {
137137
}
138138

139139
const attributeName = (this.nameElement as HTMLSpanElement).textContent || '';
140-
this.prompt = new ARIAAttributePrompt(ariaMetadata().valuesForProperty(attributeName), this);
140+
this.prompt = new ARIAAttributePrompt(ariaMetadata().valuesForProperty(attributeName));
141141
this.prompt.setAutocompletionTimeout(0);
142142
const proxyElement =
143143
this.prompt.attachAndStartEditing(valueElement, blurListener.bind(this, previousContent)) as HTMLElement;
@@ -195,13 +195,11 @@ export class ARIAAttributesTreeElement extends UI.TreeOutline.TreeElement {
195195

196196
export class ARIAAttributePrompt extends UI.TextPrompt.TextPrompt {
197197
private readonly ariaCompletions: string[];
198-
private readonly treeElement: ARIAAttributesTreeElement;
199-
constructor(ariaCompletions: string[], treeElement: ARIAAttributesTreeElement) {
198+
constructor(ariaCompletions: string[]) {
200199
super();
201200
this.initialize(this.buildPropertyCompletions.bind(this));
202201

203202
this.ariaCompletions = ariaCompletions;
204-
this.treeElement = treeElement;
205203
}
206204

207205
private async buildPropertyCompletions(expression: string, prefix: string, force?: boolean):

0 commit comments

Comments
 (0)