src/vs/platform/lifecycle/electron-main/lifecycleMainService.ts/LifecycleMainService/onBeforeUnloadWindowInRenderer
class LifecycleMainService:	private onBeforeUnloadWindowInRenderer(window: ICodeWindow, reason: UnloadReason): Promise<boolean /* veto */> {
		return new Promise<boolean>(resolve => {
			const oneTimeEventToken = this.oneTimeListenerTokenGenerator++;
			const okChannel = `vscode:ok${oneTimeEventToken}`;
			const cancelChannel = `vscode:cancel${oneTimeEventToken}`;

			ipcMain.once(okChannel, () => {
				resolve(false); // no veto
			});

			ipcMain.once(cancelChannel, () => {
				resolve(true); // veto
			});

			window.send('vscode:onBeforeUnload', { okChannel, cancelChannel, reason });
		});
	}