Skip to content

Commit 11f5f04

Browse files
bmeurerDevtools-frontend LUCI CQ
authored andcommitted
[application] Remove ability to inspect non-attached service workers.
This seems to be effectively dead code by now, since the intended workflow is that we auto attach to all service worker targets relevant to the debuggee these days, and should therefore never need the ability to open a dedicated DevTools windows to debug such a service worker (if there's such a case, it's likely a bug that we need to fix). Bug: 40123886 Change-Id: Ia19b3ed19f9833431ef9925974ba02e6ead910f1 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6695212 Reviewed-by: Danil Somsikov <[email protected]> Auto-Submit: Benedikt Meurer <[email protected]> Commit-Queue: Benedikt Meurer <[email protected]> Commit-Queue: Danil Somsikov <[email protected]>
1 parent 8a73923 commit 11f5f04

File tree

2 files changed

+0
-42
lines changed

2 files changed

+0
-42
lines changed

front_end/core/sdk/ServiceWorkerManager.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,6 @@ export class ServiceWorkerManager extends SDKModel<EventTypes> {
221221
await this.#agent.invoke_stopWorker({versionId});
222222
}
223223

224-
async inspectWorker(versionId: string): Promise<void> {
225-
await this.#agent.invoke_inspectWorker({versionId});
226-
}
227-
228224
workerRegistrationUpdated(registrations: Protocol.ServiceWorker.ServiceWorkerRegistration[]): void {
229225
for (const payload of registrations) {
230226
let registration = this.#registrationsInternal.get(payload.registrationId);

front_end/panels/application/ServiceWorkersView.ts

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,6 @@ const UIStrings = {
137137
*@description Text in Service Workers View of the Application panel
138138
*/
139139
stopString: 'Stop',
140-
/**
141-
*@description Text in Service Workers View of the Application panel
142-
*/
143-
inspect: 'Inspect',
144140
/**
145141
*@description Text in Service Workers View of the Application panel
146142
*/
@@ -585,14 +581,6 @@ export class Section {
585581
void this.throttler.schedule(this.update.bind(this));
586582
}
587583

588-
private targetForVersionId(versionId: string): SDK.Target.Target|null {
589-
const version = this.manager.findVersion(versionId);
590-
if (!version?.targetId) {
591-
return null;
592-
}
593-
return SDK.TargetManager.TargetManager.instance().targetById(version.targetId);
594-
}
595-
596584
private addVersion(versionsStack: Element, icon: string, label: string): Element {
597585
const installingEntry = versionsStack.createChild('div', 'service-worker-version');
598586
installingEntry.createChild('div', icon);
@@ -682,12 +670,6 @@ export class Section {
682670
const stopButton = UI.UIUtils.createTextButton(
683671
i18nString(UIStrings.stopString), this.stopButtonClicked.bind(this, active.id), {jslogContext: 'stop'});
684672
activeEntry.appendChild(stopButton);
685-
if (!this.targetForVersionId(active.id)) {
686-
const inspectButton = UI.UIUtils.createTextButton(
687-
i18nString(UIStrings.inspect), this.inspectButtonClicked.bind(this, active.id),
688-
{jslogContext: 'inspect'});
689-
activeEntry.appendChild(inspectButton);
690-
}
691673
} else if (active.isStartable()) {
692674
const startButton = UI.UIUtils.createTextButton(
693675
i18nString(UIStrings.startString), this.startButtonClicked.bind(this), {jslogContext: 'start'});
@@ -715,14 +697,6 @@ export class Section {
715697
waitingEntry.createChild('div', 'service-worker-subtitle').textContent =
716698
i18nString(UIStrings.receivedS, {PH1: new Date(waiting.scriptResponseTime * 1000).toLocaleString()});
717699
}
718-
if (!this.targetForVersionId(waiting.id) && (waiting.isRunning() || waiting.isStarting())) {
719-
const inspectButton = UI.UIUtils.createTextButton(
720-
i18nString(UIStrings.inspect), this.inspectButtonClicked.bind(this, waiting.id), {
721-
title: i18nString(UIStrings.inspect),
722-
jslogContext: 'waiting-entry-inspect',
723-
});
724-
waitingEntry.appendChild(inspectButton);
725-
}
726700
}
727701
if (installing) {
728702
const installingEntry = this.addVersion(
@@ -733,14 +707,6 @@ export class Section {
733707
PH1: new Date(installing.scriptResponseTime * 1000).toLocaleString(),
734708
});
735709
}
736-
if (!this.targetForVersionId(installing.id) && (installing.isRunning() || installing.isStarting())) {
737-
const inspectButton = UI.UIUtils.createTextButton(
738-
i18nString(UIStrings.inspect), this.inspectButtonClicked.bind(this, installing.id), {
739-
title: i18nString(UIStrings.inspect),
740-
jslogContext: 'installing-entry-inspect',
741-
});
742-
installingEntry.appendChild(inspectButton);
743-
}
744710
}
745711

746712
this.updateCycleView.refresh();
@@ -882,10 +848,6 @@ export class Section {
882848
void this.manager.stopWorker(versionId);
883849
}
884850

885-
private inspectButtonClicked(versionId: string): void {
886-
void this.manager.inspectWorker(versionId);
887-
}
888-
889851
private wrapWidget(container: Element): Element {
890852
const shadowRoot = UI.UIUtils.createShadowRootWithCoreStyles(container, {
891853
cssFile: [

0 commit comments

Comments
 (0)