Skip to content

Commit 77a381a

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored and
Devtools-frontend LUCI CQ
committed
[cleanup] Remove unused code
This is all the dead code that was unused and simple to remove. Bug: 409278895 Change-Id: I9f0f07440e83d0127ade86e12f447b052770983e Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6439641 Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org> Auto-Submit: Nikolay Vitkov <nvitkov@chromium.org> Reviewed-by: Alina Varkki <alinavarkki@chromium.org> Commit-Queue: Alina Varkki <alinavarkki@chromium.org>
1 parent 3252009 commit 77a381a

16 files changed

+3
-54
lines changed

front_end/panels/application/ApplicationPanelSidebar.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,10 +1004,6 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe
10041004
this.resourcesSection.revealAndSelectFrame(frame);
10051005
}
10061006

1007-
private innerShowView(view: UI.Widget.Widget): void {
1008-
this.panel.showView(view);
1009-
}
1010-
10111007
showPreloadingRuleSetView(revealInfo: PreloadingHelper.PreloadingForward.RuleSetView): void {
10121008
if (this.preloadingSummaryTreeElement) {
10131009
this.preloadingSummaryTreeElement.expandAndRevealRuleSet(revealInfo);
@@ -2170,7 +2166,6 @@ export class ResourcesSection implements SDK.TargetManager.Observer {
21702166
export class FrameTreeElement extends ApplicationPanelTreeElement {
21712167
private section: ResourcesSection;
21722168
private frame: SDK.ResourceTreeModel.ResourceTreeFrame;
2173-
private frameId: string;
21742169
private readonly categoryElements: Map<string, ExpandableApplicationPanelTreeElement>;
21752170
private readonly treeElementForResource: Map<string, FrameResourceTreeElement>;
21762171
private treeElementForWindow: Map<Protocol.Target.TargetID, FrameWindowTreeElement>;
@@ -2182,7 +2177,6 @@ export class FrameTreeElement extends ApplicationPanelTreeElement {
21822177
super(section.panel, '', false, 'frame');
21832178
this.section = section;
21842179
this.frame = frame;
2185-
this.frameId = frame.id;
21862180
this.categoryElements = new Map();
21872181
this.treeElementForResource = new Map();
21882182
this.treeElementForWindow = new Map();
@@ -2207,7 +2201,6 @@ export class FrameTreeElement extends ApplicationPanelTreeElement {
22072201
this.setLeadingIcons([icon]);
22082202
this.invalidateChildren();
22092203

2210-
this.frameId = frame.id;
22112204
if (this.title !== frame.displayName()) {
22122205
this.title = frame.displayName();
22132206
UI.ARIAUtils.setLabel(this.listItemElement, this.title);

front_end/panels/application/CookieItemsView.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ class CookiePreviewWidget extends UI.Widget.VBox {
165165
export class CookieItemsView extends StorageItemsView {
166166
private model: SDK.CookieModel.CookieModel;
167167
private cookieDomain: string;
168-
private totalSize: number;
169168
private cookiesTable: CookieTable.CookiesTable.CookiesTable;
170169
private readonly splitWidget: UI.SplitWidget.SplitWidget;
171170
private readonly previewPanel: UI.Widget.VBox;
@@ -185,7 +184,6 @@ export class CookieItemsView extends StorageItemsView {
185184
this.model = model;
186185
this.cookieDomain = cookieDomain;
187186

188-
this.totalSize = 0;
189187
this.cookiesTable = new CookieTable.CookiesTable.CookiesTable(
190188
/* renderInline */ false, this.saveCookie.bind(this), this.refreshItems.bind(this),
191189
this.handleCookieSelected.bind(this), this.deleteCookie.bind(this));
@@ -266,7 +264,6 @@ export class CookieItemsView extends StorageItemsView {
266264

267265
private updateWithCookies(allCookies: SDK.Cookie.Cookie[]): void {
268266
this.allCookies = allCookies;
269-
this.totalSize = allCookies.reduce((size, cookie) => size + cookie.size(), 0);
270267

271268
const parsedURL = Common.ParsedURL.ParsedURL.fromString(this.cookieDomain);
272269
const host = parsedURL ? parsedURL.host : '';

front_end/panels/application/ServiceWorkersView.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,6 @@ export class Section {
492492
private sourceField: Element;
493493
private readonly statusField: Element;
494494
private readonly clientsField: Element;
495-
private readonly linkifier: Components.Linkifier.Linkifier;
496495
private readonly clientInfoCache: Map<string, Protocol.Target.TargetInfo>;
497496
private readonly throttler: Common.Throttler.Throttler;
498497
private updateCycleField?: Element;
@@ -552,7 +551,6 @@ export class Section {
552551
this.createUpdateCycleField();
553552
this.maybeCreateRouterField();
554553

555-
this.linkifier = new Components.Linkifier.Linkifier();
556554
this.clientInfoCache = new Map();
557555
this.throttler = new Common.Throttler.Throttler(500);
558556
}

front_end/panels/application/preloading/PreloadingView.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ function pageURL(): Platform.DevToolsPath.UrlString {
202202
export class PreloadingRuleSetView extends UI.Widget.VBox {
203203
private model: SDK.PreloadingModel.PreloadingModel;
204204
private focusedRuleSetId: Protocol.Preload.RuleSetId|null = null;
205-
private focusedPreloadingAttemptId: SDK.PreloadingModel.PreloadingAttemptId|null = null;
206205

207206
private readonly warningsContainer: HTMLDivElement;
208207
private readonly warningsView = new PreloadingWarningsView();

front_end/panels/layer_viewer/PaintProfilerView.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,13 +495,11 @@ export class PaintProfilerCommandLogView extends UI.ThrottledWidget.ThrottledWid
495495
export class LogTreeElement extends UI.TreeOutline.TreeElement {
496496
readonly logItem: SDK.PaintProfiler.PaintProfilerLogItem;
497497
private readonly ownerView: PaintProfilerCommandLogView;
498-
private readonly filled: boolean;
499498

500499
constructor(ownerView: PaintProfilerCommandLogView, logItem: SDK.PaintProfiler.PaintProfilerLogItem) {
501500
super('', Boolean(logItem.params));
502501
this.logItem = logItem;
503502
this.ownerView = ownerView;
504-
this.filled = false;
505503
}
506504

507505
override onattach(): void {

front_end/panels/layers/LayerTreeModel.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ export class AgentLayer implements SDK.LayerTreeBase.Layer {
230230
private scrollRectsInternal!: Protocol.LayerTree.ScrollRect[];
231231
private quadInternal!: number[];
232232
private childrenInternal!: AgentLayer[];
233-
private image!: HTMLImageElement|null;
234233
private parentInternal!: AgentLayer|null;
235234
private layerPayload!: Protocol.LayerTree.Layer;
236235
private layerTreeModel: LayerTreeModel;
@@ -378,7 +377,6 @@ export class AgentLayer implements SDK.LayerTreeBase.Layer {
378377
didPaint(rect: Protocol.DOM.Rect): void {
379378
this.lastPaintRectInternal = rect;
380379
this.paintCountInternal = this.paintCount() + 1;
381-
this.image = null;
382380
}
383381

384382
reset(layerPayload: Protocol.LayerTree.Layer): void {
@@ -387,7 +385,6 @@ export class AgentLayer implements SDK.LayerTreeBase.Layer {
387385
this.parentInternal = null;
388386
this.paintCountInternal = 0;
389387
this.layerPayload = layerPayload;
390-
this.image = null;
391388
this.scrollRectsInternal = this.layerPayload.scrollRects || [];
392389
this.stickyPositionConstraintInternal = this.layerPayload.stickyPositionConstraint ?
393390
new SDK.LayerTreeBase.StickyPositionConstraint(

front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ const {LinearMemoryInspectorController} = LinearMemoryInspector;
1212
const {ValueInterpreterDisplayUtils} = LinearMemoryInspectorComponents;
1313

1414
class MockRemoteObject extends SDK.RemoteObject.LocalJSONObject {
15-
private objSubtype?: string;
16-
1715
constructor(array: ArrayBuffer) {
1816
super(array);
1917
}

front_end/panels/media/PlayerMessagesView.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ class MessageLevelSelector implements UI.SoftDropDown.Delegate<SelectableLevel>
9999
private readonly itemMap: Map<number, SelectableLevel>;
100100
private hiddenLevels: string[];
101101
private bitFieldValue: MessageLevelBitfield;
102-
private readonly savedBitFieldValue: MessageLevelBitfield;
103102
private readonly defaultTitleInternal: Common.UIString.LocalizedString;
104103
private readonly customTitle: Common.UIString.LocalizedString;
105104
private readonly allTitle: Common.UIString.LocalizedString;
@@ -113,7 +112,6 @@ class MessageLevelSelector implements UI.SoftDropDown.Delegate<SelectableLevel>
113112
this.hiddenLevels = [];
114113

115114
this.bitFieldValue = MessageLevelBitfield.DEFAULT;
116-
this.savedBitFieldValue = MessageLevelBitfield.DEFAULT;
117115

118116
this.defaultTitleInternal = i18nString(UIStrings.default);
119117
this.customTitle = i18nString(UIStrings.custom);

front_end/panels/media/PlayerPropertiesView.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ export const enum PlayerPropertyKeys {
172172
}
173173

174174
export class PropertyRenderer extends UI.Widget.VBox {
175-
private readonly title: Platform.UIString.LocalizedString;
176175
private readonly contents: HTMLElement;
177176
private value: string|null;
178177
private pseudoColorProtectionElement: HTMLDivElement|null;
@@ -183,7 +182,6 @@ export class PropertyRenderer extends UI.Widget.VBox {
183182
const titleElement = this.contentElement.createChild('span', 'media-property-renderer-title');
184183
this.contents = this.contentElement.createChild('div', 'media-property-renderer-contents');
185184
UI.UIUtils.createTextChild(titleElement, title);
186-
this.title = title;
187185
this.value = null;
188186
this.pseudoColorProtectionElement = null;
189187
this.contentElement.classList.add('media-property-renderer-hidden');
@@ -437,7 +435,6 @@ export class PlayerPropertiesView extends UI.Widget.VBox {
437435
private readonly mediaElements: PropertyRenderer[];
438436
private readonly videoDecoderElements: PropertyRenderer[];
439437
private readonly audioDecoderElements: PropertyRenderer[];
440-
private readonly textTrackElements: PropertyRenderer[];
441438
private readonly attributeMap: Map<string, PropertyRenderer|TrackManager>;
442439
private readonly videoProperties: AttributesView;
443440
private readonly videoDecoderProperties: AttributesView;
@@ -457,7 +454,6 @@ export class PlayerPropertiesView extends UI.Widget.VBox {
457454
this.mediaElements = [];
458455
this.videoDecoderElements = [];
459456
this.audioDecoderElements = [];
460-
this.textTrackElements = [];
461457
this.attributeMap = new Map();
462458

463459
this.populateAttributesAndElements();

front_end/panels/media/TickingFlameChart.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export interface EventProperties {
5353
duration?: number;
5454
name: string;
5555
color?: string;
56-
hoverData?: Object|null;
5756
}
5857

5958
/**
@@ -69,12 +68,11 @@ export class Event {
6968
title: string;
7069
private colorInternal: string;
7170
private fontColorInternal: string;
72-
private readonly hoverData: Object;
7371

7472
constructor(
7573
timelineData: PerfUI.FlameChart.FlameChartTimelineData, eventHandlers: EventHandlers,
7674
eventProperties: EventProperties|
77-
undefined = {color: undefined, duration: undefined, hoverData: {}, level: 0, name: '', startTime: 0}) {
75+
undefined = {color: undefined, duration: undefined, level: 0, name: '', startTime: 0}) {
7876
// These allow the event to privately change it's own data in the timeline.
7977
this.timelineData = timelineData;
8078
this.setLive = eventHandlers.setLive;
@@ -100,7 +98,6 @@ export class Event {
10098
this.title = eventProperties['name'] || '';
10199
this.colorInternal = eventProperties['color'] || HotColorScheme[0];
102100
this.fontColorInternal = calculateFontColor(this.colorInternal);
103-
this.hoverData = eventProperties['hoverData'] || {};
104101
}
105102

106103
/**

front_end/panels/network/NetworkDataGridNode.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,6 @@ export const _backgroundColors: {
555555
};
556556

557557
export class NetworkRequestNode extends NetworkNode {
558-
private nameCell: Element|null;
559558
private initiatorCell: Element|null;
560559
private requestInternal: SDK.NetworkRequest.NetworkRequest;
561560
private readonly isNavigationRequestInternal: boolean;
@@ -566,7 +565,6 @@ export class NetworkRequestNode extends NetworkNode {
566565

567566
constructor(parentView: NetworkLogViewInterface, request: SDK.NetworkRequest.NetworkRequest) {
568567
super(parentView);
569-
this.nameCell = null;
570568
this.initiatorCell = null;
571569
this.requestInternal = request;
572570
this.isNavigationRequestInternal = false;
@@ -912,7 +910,6 @@ export class NetworkRequestNode extends NetworkNode {
912910
}
913911

914912
override createCells(element: Element): void {
915-
this.nameCell = null;
916913
this.initiatorCell = null;
917914

918915
element.classList.toggle('network-warning-row', this.isWarning());
@@ -1086,7 +1083,6 @@ export class NetworkRequestNode extends NetworkNode {
10861083
const leftPadding = this.leftPadding ? this.leftPadding + 'px' : '';
10871084
cell.style.setProperty('padding-left', leftPadding);
10881085
cell.tabIndex = -1;
1089-
this.nameCell = cell;
10901086
cell.addEventListener('dblclick', this.openInNewTab.bind(this), false);
10911087
cell.addEventListener('mousedown', () => {
10921088
// When the request panel isn't visible yet, firing the RequestActivated event

front_end/panels/network/NetworkLogView.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2663,7 +2663,6 @@ export class MoreFiltersDropDownUI extends Common.ObjectWrapper.ObjectWrapper<UI
26632663
private networkShowBlockedCookiesOnlySetting: Common.Settings.Setting<boolean>;
26642664
private networkOnlyBlockedRequestsSetting: Common.Settings.Setting<boolean>;
26652665
private networkOnlyThirdPartySetting: Common.Settings.Setting<boolean>;
2666-
private contextMenu?: UI.ContextMenu.ContextMenu;
26672666
private activeFiltersCount: HTMLElement;
26682667
private activeFiltersCountAdorner: Adorners.Adorner.Adorner;
26692668

front_end/panels/network/ResourceWebSocketFrameView.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ export class ResourceWebSocketFrameView extends UI.Widget.VBox {
159159
private readonly filterTextInput: UI.Toolbar.ToolbarInput;
160160
private filterRegex: RegExp|null;
161161
private readonly frameEmptyWidget: UI.EmptyWidget.EmptyWidget;
162-
private readonly selectedNode: ResourceWebSocketFrameNode|null;
163162
private currentSelectedNode?: ResourceWebSocketFrameNode|null;
164163

165164
private messageFilterSetting: Common.Settings.Setting<string> =
@@ -246,7 +245,6 @@ export class ResourceWebSocketFrameView extends UI.Widget.VBox {
246245
i18nString(UIStrings.noMessageSelected), i18nString(UIStrings.selectMessageToBrowseItsContent));
247246
this.splitWidget.setSidebarWidget(this.frameEmptyWidget);
248247

249-
this.selectedNode = null;
250248
if (filter) {
251249
this.applyFilter(filter);
252250
}

front_end/panels/sources/NavigatorView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,7 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
12321232
}
12331233
}
12341234

1235-
private resetForTest(): void {
1235+
protected resetForTest(): void {
12361236
this.reset();
12371237
this.workspaceInternal.uiSourceCodes().forEach(this.addUISourceCode.bind(this));
12381238
}

front_end/panels/timeline/TimelinePanel.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,6 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
423423
private fileSelectorElement?: HTMLInputElement;
424424
private selection: TimelineSelection|null = null;
425425
private traceLoadStart!: Trace.Types.Timing.Milli|null;
426-
private primaryPageTargetPromiseCallback = (_target: SDK.Target.Target): void => {};
427-
// Note: this is technically unused, but we need it to define the promiseCallback function above.
428-
private primaryPageTargetPromise = new Promise<SDK.Target.Target>(res => {
429-
this.primaryPageTargetPromiseCallback = res;
430-
});
431426

432427
#traceEngineModel: Trace.TraceModel.Model;
433428
#sourceMapsResolver: Utils.SourceMapsResolver.SourceMapsResolver|null = null;
@@ -704,15 +699,6 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
704699
},
705700
},
706701
);
707-
SDK.TargetManager.TargetManager.instance().observeTargets({
708-
targetAdded: (target: SDK.Target.Target) => {
709-
if (target !== SDK.TargetManager.TargetManager.instance().primaryPageTarget()) {
710-
return;
711-
}
712-
this.primaryPageTargetPromiseCallback(target);
713-
},
714-
targetRemoved: (_: SDK.Target.Target) => {},
715-
});
716702
}
717703

718704
/**
@@ -1681,7 +1667,7 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
16811667
// If we profile all target, but this will cause some bugs like time for the function is calculated wrong,
16821668
// because the profiles will be concated and sorted together, so the total time will be amplified.
16831669
// Multiple targets problem might happen when you inspect multiple node servers on different port at same time,
1684-
// or when you let DevTools listen to both locolhost:9229 & 127.0.0.1:9229.
1670+
// or when you let DevTools listen to both localhost:9229 & 127.0.0.1:9229.
16851671
const firstNodeTarget =
16861672
SDK.TargetManager.TargetManager.instance().targets().find(target => target.type() === SDK.Target.Type.NODE);
16871673
if (!firstNodeTarget) {

front_end/ui/legacy/Context.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import * as Common from '../../core/common/common.js';
66
import type * as Platform from '../../core/platform/platform.js';
7-
import * as Root from '../../core/root/root.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
87

98
import type {ContextFlavorListener} from './ContextFlavorListener.js';
109

0 commit comments

Comments
 (0)