Skip to content

Commit 71b427b

Browse files
paulirishDevtools-frontend LUCI CQ
authored andcommitted
Remove unused methods
Bug: 396301196 Change-Id: Ia1a32ff886baa7c1d68be172d873ec0cbf03536d Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6649316 Commit-Queue: Paul Irish <paulirish@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
1 parent 43a22d0 commit 71b427b

File tree

22 files changed

+3
-266
lines changed

22 files changed

+3
-266
lines changed

front_end/core/common/EventTarget.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,5 @@ const untypedEmitter = new UntypedEventEmitter();
162162
untypedEmitter.addEventListener('foo', genericListener());
163163
untypedEmitter.addEventListener(Symbol('foo'), genericListener());
164164
untypedEmitter.addEventListener(Events.VOID_EVENT, genericListener());
165+
untypedEmitter.testDispatch();
165166
})();

front_end/core/common/SimpleHistoryManager.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -91,23 +91,6 @@ export class SimpleHistoryManager {
9191
return Boolean(this.#coalescingReadonly);
9292
}
9393

94-
filterOut(filterOutCallback: (arg0: HistoryEntry) => boolean): void {
95-
if (this.readOnly()) {
96-
return;
97-
}
98-
const filteredEntries = [];
99-
let removedBeforeActiveEntry = 0;
100-
for (let i = 0; i < this.#entries.length; ++i) {
101-
if (!filterOutCallback(this.#entries[i])) {
102-
filteredEntries.push(this.#entries[i]);
103-
} else if (i <= this.#activeEntryIndex) {
104-
++removedBeforeActiveEntry;
105-
}
106-
}
107-
this.#entries = filteredEntries;
108-
this.#activeEntryIndex = Math.max(0, this.#activeEntryIndex - removedBeforeActiveEntry);
109-
}
110-
11194
empty(): boolean {
11295
return !this.#entries.length;
11396
}

front_end/core/i18n/time-utilities.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,11 @@ export function formatMicroSecondsAsSeconds(time: Platform.Timing.MicroSeconds):
8585
return narrowSecondsDecimal.format(seconds);
8686
}
8787

88-
export function formatPartsMicroSecondsAsSeconds(time: Platform.Timing.MicroSeconds): Intl.NumberFormatPart[] {
89-
const milliseconds = Platform.Timing.microSecondsToMilliSeconds(time);
90-
const seconds = Platform.Timing.milliSecondsToSeconds(milliseconds);
91-
return narrowSecondsDecimal.formatToParts(seconds);
92-
}
93-
9488
export function formatMicroSecondsAsMillisFixed(time: Platform.Timing.MicroSeconds): string {
9589
const milliseconds = Platform.Timing.microSecondsToMilliSeconds(time);
9690
return narrowMillisecondsInteger.format(milliseconds);
9791
}
9892

99-
export function formatPartsMicroSecondsAsMillisFixed(time: Platform.Timing.MicroSeconds): Intl.NumberFormatPart[] {
100-
const milliseconds = Platform.Timing.microSecondsToMilliSeconds(time);
101-
return narrowMillisecondsInteger.formatToParts(milliseconds);
102-
}
103-
10493
export function formatMicroSecondsAsMillisFixedExpanded(time: Platform.Timing.MicroSeconds): string {
10594
const milliseconds = Platform.Timing.microSecondsToMilliSeconds(time);
10695
return longMilliseconds.format(milliseconds);

front_end/core/sdk/NetworkManager.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,10 +1775,6 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
17751775
}
17761776
}
17771777

1778-
userAgentOverride(): string {
1779-
return this.#userAgentOverrideInternal;
1780-
}
1781-
17821778
setCustomUserAgentOverride(
17831779
userAgent: string, userAgentMetadataOverride: Protocol.Emulation.UserAgentMetadata|null = null): void {
17841780
this.#customUserAgent = userAgent;
@@ -2098,12 +2094,6 @@ export class InterceptedRequest {
20982094
void this.#fetchAgent.invoke_continueRequest({requestId: this.requestId});
20992095
}
21002096

2101-
continueRequestWithError(errorReason: Protocol.Network.ErrorReason): void {
2102-
console.assert(!this.#hasRespondedInternal);
2103-
this.#hasRespondedInternal = true;
2104-
void this.#fetchAgent.invoke_failRequest({requestId: this.requestId, errorReason});
2105-
}
2106-
21072097
async responseBody(): Promise<TextUtils.ContentData.ContentDataOrError> {
21082098
const response = await this.#fetchAgent.invoke_getResponseBody({requestId: this.requestId});
21092099
const error = response.getError();

front_end/core/sdk/OverlayModel.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,6 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
463463
this.#sourceOrderModeActiveInternal = isActive;
464464
}
465465

466-
sourceOrderModeActive(): boolean {
467-
return this.#sourceOrderModeActiveInternal;
468-
}
469-
470466
private delayedHideHighlight(delay: number): void {
471467
if (this.#hideHighlightTimeout === null) {
472468
this.#hideHighlightTimeout = window.setTimeout(() => this.highlightInOverlay({clear: true}), delay);

front_end/core/sdk/PreloadingModel.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ export class PreloadPipeline {
561561
}
562562

563563
// Returns attempts in the order: prefetch < prerender.
564+
// Currently unused.
564565
getAttempts(): PreloadingAttempt[] {
565566
const ret = [];
566567

front_end/models/issues_manager/MarkdownIssueDescription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const validPlaceholderNamePattern = /PLACEHOLDER_[a-zA-Z][a-zA-Z0-9]*/;
105105
*
106106
* Example:
107107
* const str = "This is markdown with `code` and two placeholders, namely {PLACEHOLDER_PH1} and {PLACEHOLDER_PH2}".
108-
* const result = substitePlaceholders(str, new Map([['PLACEHOLDER_PH1', 'foo'], ['PLACEHOLDER_PH2', 'bar']]));
108+
* const result = substitutePlaceholders(str, new Map([['PLACEHOLDER_PH1', 'foo'], ['PLACEHOLDER_PH2', 'bar']]));
109109
*
110110
* Exported only for unit testing.
111111
*/

front_end/models/trace/extras/TraceTree.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,6 @@ export class TopDownNode extends Node {
243243
this.childrenInternal = children;
244244
return children;
245245
}
246-
247-
getRoot(): TopDownRootNode|null {
248-
return this.root;
249-
}
250246
}
251247

252248
export class TopDownRootNode extends TopDownNode {

front_end/models/trace/types/TraceEvents.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,9 +2524,6 @@ export interface FireAnimationFrame extends Complete {
25242524
},
25252525
};
25262526
}
2527-
export function isFireAnimationFrame(event: Event): event is FireAnimationFrame {
2528-
return event.name === Name.FIRE_ANIMATION_FRAME;
2529-
}
25302527

25312528
export interface RequestAnimationFrame extends Instant {
25322529
name: Name.REQUEST_ANIMATION_FRAME;
@@ -2538,9 +2535,6 @@ export interface RequestAnimationFrame extends Instant {
25382535
},
25392536
};
25402537
}
2541-
export function isRequestAnimationFrame(event: Event): event is RequestAnimationFrame {
2542-
return event.name === Name.REQUEST_ANIMATION_FRAME;
2543-
}
25442538

25452539
export interface TimerInstall extends Instant {
25462540
name: Name.TIMER_INSTALL;
@@ -2583,9 +2577,6 @@ export interface RequestIdleCallback extends Instant {
25832577

25842578
};
25852579
}
2586-
export function isRequestIdleCallback(event: Event): event is RequestIdleCallback {
2587-
return event.name === Name.REQUEST_IDLE_CALLBACK;
2588-
}
25892580

25902581
export interface WebSocketCreate extends Instant {
25912582
name: Name.WEB_SOCKET_CREATE;
@@ -2649,10 +2640,6 @@ export interface WebSocketSend extends Instant {
26492640
};
26502641
}
26512642

2652-
export function isWebSocketSend(event: Event): event is WebSocketSend {
2653-
return event.name === Name.WEB_SOCKET_SEND;
2654-
}
2655-
26562643
export interface WebSocketReceive extends Instant {
26572644
name: Name.WEB_SOCKET_RECEIVE;
26582645
args: Args&{
@@ -2665,9 +2652,6 @@ export interface WebSocketReceive extends Instant {
26652652
},
26662653
};
26672654
}
2668-
export function isWebSocketReceive(event: Event): event is WebSocketReceive {
2669-
return event.name === Name.WEB_SOCKET_RECEIVE;
2670-
}
26712655

26722656
export interface WebSocketSendHandshakeRequest extends Instant {
26732657
name: Name.WEB_SOCKET_SEND_HANDSHAKE_REQUEST;
@@ -3232,11 +3216,6 @@ export interface V8SourceRundownSourcesStubScriptCatchupEvent extends Event {
32323216
};
32333217
}
32343218

3235-
export function isV8SourceRundownSourcesStubScriptCatchupEvent(event: Event):
3236-
event is V8SourceRundownSourcesStubScriptCatchupEvent {
3237-
return event.cat === 'disabled-by-default-devtools.v8-source-rundown-sources' && event.name === 'StubScriptCatchup';
3238-
}
3239-
32403219
export function isAnyScriptCatchupEvent(event: Event): event is V8SourceRundownSourcesScriptCatchupEvent|
32413220
V8SourceRundownSourcesLargeScriptCatchupEvent|V8SourceRundownSourcesStubScriptCatchupEvent {
32423221
return event.cat === 'disabled-by-default-devtools.v8-source-rundown-sources';

front_end/panels/application/components/StorageMetadataView.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,6 @@ export class StorageMetadataView extends LegacyWrapper.LegacyWrapper.WrappableCo
119119
#storageKey: SDK.StorageKeyManager.StorageKey|null = null;
120120
#storageBucket: Protocol.Storage.StorageBucketInfo|null = null;
121121

122-
getShadow(): ShadowRoot {
123-
return this.#shadow;
124-
}
125-
126122
setStorageKey(storageKey: string): void {
127123
this.#storageKey = SDK.StorageKeyManager.parseStorageKey(storageKey);
128124
void this.render();

0 commit comments

Comments
 (0)