Merge pull request #115530 from microsoft/joh/norpc

Hide API implementation proxies, add tests to check for "proxy leakage"
This commit is contained in:
Johannes Rieken
2021-02-03 09:17:56 +01:00
committed by GitHub
33 changed files with 623 additions and 629 deletions

View File

@@ -89,7 +89,7 @@ export abstract class ExtHostDebugServiceBase implements IExtHostDebugService, E
get onDidReceiveDebugSessionCustomEvent(): Event<vscode.DebugSessionCustomEvent> { return this._onDidReceiveDebugSessionCustomEvent.event; }
private _activeDebugConsole: ExtHostDebugConsole;
get activeDebugConsole(): ExtHostDebugConsole { return this._activeDebugConsole; }
get activeDebugConsole(): vscode.DebugConsole { return this._activeDebugConsole.value; }
private _breakpoints: Map<string, vscode.Breakpoint>;
private _breakpointEventsActive: boolean;
@@ -911,20 +911,20 @@ export class ExtHostDebugSession implements vscode.DebugSession {
}
}
export class ExtHostDebugConsole implements vscode.DebugConsole {
export class ExtHostDebugConsole {
private _debugServiceProxy: MainThreadDebugServiceShape;
readonly value: vscode.DebugConsole;
constructor(proxy: MainThreadDebugServiceShape) {
this._debugServiceProxy = proxy;
}
append(value: string): void {
this._debugServiceProxy.$appendDebugConsole(value);
}
appendLine(value: string): void {
this.append(value + '\n');
this.value = Object.freeze({
append(value: string): void {
proxy.$appendDebugConsole(value);
},
appendLine(value: string): void {
this.append(value + '\n');
}
});
}
}