Use a uuid as our webview handles

Avoid having duplicated ids/handles
This commit is contained in:
Matt Bierner
2019-07-10 11:18:42 -07:00
parent f57ff0b25c
commit ca7605f339

View File

@@ -18,8 +18,6 @@ import { generateUuid } from 'vs/base/common/uuid';
type IconPath = URI | { light: URI, dark: URI };
export class ExtHostWebview implements vscode.Webview {
private readonly _uuid: string = generateUuid();
private _html: string;
private _isDisposed: boolean = false;
@@ -38,7 +36,7 @@ export class ExtHostWebview implements vscode.Webview {
}
public toWebviewResource(resource: vscode.Uri): vscode.Uri {
return toWebviewResource(this._initData, this._uuid, resource);
return toWebviewResource(this._initData, this._handle, resource);
}
public get cspSource(): string {
@@ -234,10 +232,9 @@ export class ExtHostWebviewPanel implements vscode.WebviewPanel {
}
export class ExtHostWebviews implements ExtHostWebviewsShape {
private static webviewHandlePool = 1;
private static newHandle(): WebviewPanelHandle {
return ExtHostWebviews.webviewHandlePool++ + '';
return generateUuid();
}
private readonly _proxy: MainThreadWebviewsShape;