This partially reverts "extends Disposable" changes

This commit is contained in:
Johannes Rieken
2019-06-06 15:46:25 +02:00
parent a1041f77b8
commit 078da2bca6
23 changed files with 273 additions and 179 deletions

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { localize } from 'vs/nls';
import { Disposable } from 'vs/base/common/lifecycle';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows';
import { Event } from 'vs/base/common/event';
import { BrowserWindow, app } from 'electron';
@@ -22,18 +22,18 @@ type Credentials = {
password: string;
};
export class ProxyAuthHandler extends Disposable {
export class ProxyAuthHandler {
_serviceBrand: any;
private retryCount = 0;
private disposables: IDisposable[] = [];
constructor(
@IWindowsMainService private readonly windowsMainService: IWindowsMainService
) {
super();
const onLogin = Event.fromNodeEventEmitter<LoginEvent>(app, 'login', (event, webContents, req, authInfo, cb) => ({ event, webContents, req, authInfo, cb }));
this._register(onLogin(this.onLogin, this));
onLogin(this.onLogin, this, this.disposables);
}
private onLogin({ event, authInfo, cb }: LoginEvent): void {
@@ -85,4 +85,8 @@ export class ProxyAuthHandler extends Disposable {
win.close();
});
}
dispose(): void {
this.disposables = dispose(this.disposables);
}
}