Skip to content

Commit 12cf866

Browse files
paulirishDevtools-frontend LUCI CQ
authored andcommitted
RPP: Delete unused methods
I found these all with some shell scripts, but them double-checked each and then excluded ones used in tests. Bug: 390743134 Change-Id: If30d5f23514941cc39e492f0e1033bbec794f9b9 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6236186 Reviewed-by: Jack Franklin <[email protected]> Auto-Submit: Paul Irish <[email protected]> Commit-Queue: Jack Franklin <[email protected]>
1 parent efcc7b9 commit 12cf866

File tree

16 files changed

+5
-81
lines changed

16 files changed

+5
-81
lines changed

front_end/models/trace/ModelImpl.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,3 @@ declare global {
251251
export function isModelUpdateDataComplete(eventData: ModelUpdateEventData): eventData is ModelUpdateEventComplete {
252252
return eventData.type === ModelUpdateType.COMPLETE;
253253
}
254-
255-
export function isModelUpdateDataProgress(eventData: ModelUpdateEventData): eventData is ModelUpdateEventProgress {
256-
return eventData.type === ModelUpdateType.PROGRESS_UPDATE;
257-
}

front_end/models/trace/helpers/Timing.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,6 @@ export function traceWindowMilliSeconds(bounds: Types.Timing.TraceWindowMicro):
9494
};
9595
}
9696

97-
export function traceWindowMillisecondsToMicroSeconds(bounds: Types.Timing.TraceWindowMilli):
98-
Types.Timing.TraceWindowMicro {
99-
return {
100-
min: milliToMicro(bounds.min),
101-
max: milliToMicro(bounds.max),
102-
range: milliToMicro(bounds.range),
103-
};
104-
}
10597
export function traceWindowMicroSecondsToMilliSeconds(bounds: Types.Timing.TraceWindowMicro):
10698
Types.Timing.TraceWindowMilli {
10799
return {

front_end/models/trace/helpers/Trace.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -669,11 +669,6 @@ export function eventHasCategory(event: Types.Events.Event, category: string): b
669669
return parsedCategoriesForEvent.has(category);
670670
}
671671

672-
export function nodeIdForInvalidationEvent(event: Types.Events.InvalidationTrackingEvent): Protocol.DOM.BackendNodeId|
673-
null {
674-
return event.args.data.nodeId ?? null;
675-
}
676-
677672
/**
678673
* This compares Types.Events.CallFrame with Protocol.Runtime.CallFrame and checks for equality.
679674
*/

front_end/models/trace/lantern/graph/BaseNode.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ class BaseNode<T = Lantern.AnyNetworkObject> {
132132
this.dependencies.splice(this.dependencies.indexOf(node), 1);
133133
}
134134

135+
// Unused in devtools, but used in LH.
135136
removeAllDependencies(): void {
136137
for (const node of this.dependencies.slice()) {
137138
this.removeDependency(node);

front_end/models/trace/lantern/graph/PageDependencyGraph.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ class PageDependencyGraph {
556556
return rootNode;
557557
}
558558

559+
// Unused, but useful for debugging.
559560
static printGraph(rootNode: Node, widthInCharacters = 100): void {
560561
function padRight(str: string, target: number, padChar = ' '): string {
561562
return str + padChar.repeat(Math.max(target - str.length, 0));

front_end/models/trace/lantern/simulation/Simulator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ class Simulator<T = Lantern.AnyNetworkObject> {
535535
return Math.round(wastedMs / 10) * 10;
536536
}
537537

538+
// Used by Lighthouse asset-saver
538539
static get allNodeTimings(): Map<string, Map<Graph.Node, CompleteNodeTiming>> {
539540
return ALL_SIMULATION_NODE_TIMINGS;
540541
}

front_end/models/trace/lantern/simulation/TCPConnection.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ class TCPConnection {
7070
this.warmed = warmed;
7171
}
7272

73-
isWarm(): boolean {
74-
return this.warmed;
75-
}
76-
7773
isH2(): boolean {
7874
return this.h2;
7975
}

front_end/models/trace/types/Extensions.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ export const extensionPalette = [
2424

2525
export type ExtensionColorFromPalette = typeof extensionPalette[number];
2626

27-
export function colorIsValid(color: string): boolean {
28-
return (extensionPalette as readonly string[]).includes(color);
29-
}
30-
3127
export interface ExtensionDataPayloadBase {
3228
color?: ExtensionColorFromPalette;
3329
properties?: [string, string][];

front_end/models/trace/types/TraceEvents.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,17 +1678,6 @@ export function isDrawFrame(event: Event): event is DrawFrame {
16781678
// The extra check for INSTANT here is because in the past DrawFrame events had an ASYNC_NESTABLE_START and ASYNC_NESTABLE_END pair. We don't want to support those old events, so we have to check we are dealing with an instant event.
16791679
return event.name === Name.DRAW_FRAME && event.ph === Phase.INSTANT;
16801680
}
1681-
export interface LegacyDrawFrameBegin extends Async {
1682-
name: Name.DRAW_FRAME;
1683-
ph: Phase.ASYNC_NESTABLE_START;
1684-
args: Args&{
1685-
layerTreeId: number,
1686-
frameSeqId: number,
1687-
};
1688-
}
1689-
export function isLegacyTraceEventDrawFrameBegin(event: Event): event is LegacyDrawFrameBegin {
1690-
return event.name === Name.DRAW_FRAME && event.ph === Phase.ASYNC_NESTABLE_START;
1691-
}
16921681

16931682
export interface BeginFrame extends Instant {
16941683
name: Name.BEGIN_FRAME;

front_end/panels/lighthouse/LighthouseReportSelector.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ export class ReportSelector {
6161
return this.itemByOptionElement.get(option as Element) as Item;
6262
}
6363

64-
hasCurrentSelection(): boolean {
65-
return Boolean(this.selectedItem());
66-
}
67-
6864
hasItems(): boolean {
6965
return this.itemByOptionElement.size > 0;
7066
}

0 commit comments

Comments
 (0)