Skip to content

Commit 229602b

Browse files
committed
Use createChannelReceiver for webview manager
From microsoft#98131 (comment)
1 parent 7a4880a commit 229602b

4 files changed

Lines changed: 3 additions & 40 deletions

File tree

src/vs/code/electron-main/app.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common
7878
import { StorageKeysSyncRegistryChannel } from 'vs/platform/userDataSync/common/userDataSyncIpc';
7979
import { INativeEnvironmentService } from 'vs/platform/environment/node/environmentService';
8080
import { mnemonicButtonLabel, getPathLabel } from 'vs/base/common/labels';
81-
import { IFileService } from 'vs/platform/files/common/files';
82-
import { WebviewChannel } from 'vs/platform/webview/electron-main/webviewIpcs';
8381
import { WebviewMainService } from 'vs/platform/webview/electron-main/webviewMainService';
8482
import { IWebviewManagerService } from 'vs/platform/webview/common/webviewManagerService';
8583

@@ -90,7 +88,6 @@ export class CodeApplication extends Disposable {
9088
constructor(
9189
private readonly mainIpcServer: Server,
9290
private readonly userEnv: IProcessEnvironment,
93-
@IFileService fileService: IFileService,
9491
@IInstantiationService private readonly instantiationService: IInstantiationService,
9592
@ILogService private readonly logService: ILogService,
9693
@IEnvironmentService private readonly environmentService: INativeEnvironmentService,
@@ -580,7 +577,7 @@ export class CodeApplication extends Disposable {
580577
electronIpcServer.registerChannel('url', urlChannel);
581578

582579
const webviewManagerService = accessor.get(IWebviewManagerService);
583-
const webviewChannel = new WebviewChannel(webviewManagerService);
580+
const webviewChannel = createChannelReceiver(webviewManagerService);
584581
electronIpcServer.registerChannel('webview', webviewChannel);
585582

586583
const storageMainService = accessor.get(IStorageMainService);

src/vs/platform/webview/common/webviewManagerService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface IWebviewManagerService {
1515
unregisterWebview(id: string): Promise<void>;
1616
updateLocalResourceRoots(id: string, roots: UriComponents[]): Promise<void>;
1717

18-
setIgnoreMenuShortcuts(webContentsId: number, enabled: boolean): void;
18+
setIgnoreMenuShortcuts(webContentsId: number, enabled: boolean): Promise<void>;
1919
}
2020

2121
export interface RegisterWebviewMetadata {

src/vs/platform/webview/electron-main/webviewIpcs.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/vs/platform/webview/electron-main/webviewMainService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class WebviewMainService implements IWebviewManagerService {
3636
this.protocolProvider.updateLocalResourceRoots(id, roots.map((x: UriComponents) => URI.from(x)));
3737
}
3838

39-
public setIgnoreMenuShortcuts(webContentsId: number, enabled: boolean): void {
39+
public async setIgnoreMenuShortcuts(webContentsId: number, enabled: boolean): Promise<void> {
4040
const contents = webContents.fromId(webContentsId);
4141
if (!contents) {
4242
throw new Error(`Invalid webContentsId: ${webContentsId}`);

0 commit comments

Comments
 (0)