Skip to content

Commit f03f57f

Browse files
committed
Move socketFactory to AbstractRemoteAgentService
1 parent 2991f3e commit f03f57f

3 files changed

Lines changed: 6 additions & 11 deletions

File tree

src/vs/workbench/services/remote/browser/remoteAgentServiceImpl.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@ import { AbstractRemoteAgentService, RemoteAgentConnection } from 'vs/workbench/
1010
import { IProductService } from 'vs/platform/product/common/productService';
1111
import { IWebSocketFactory, BrowserSocketFactory } from 'vs/platform/remote/browser/browserSocketFactory';
1212
import { ISignService } from 'vs/platform/sign/common/sign';
13-
import { ISocketFactory } from 'vs/platform/remote/common/remoteAgentConnection';
1413
import { ILogService } from 'vs/platform/log/common/log';
1514

1615
export class RemoteAgentService extends AbstractRemoteAgentService implements IRemoteAgentService {
1716

18-
public readonly socketFactory: ISocketFactory;
19-
2017
private readonly _connection: IRemoteAgentConnection | null = null;
2118

2219
constructor(
@@ -27,9 +24,8 @@ export class RemoteAgentService extends AbstractRemoteAgentService implements IR
2724
@ISignService signService: ISignService,
2825
@ILogService logService: ILogService
2926
) {
30-
super(environmentService, remoteAuthorityResolverService);
27+
super(new BrowserSocketFactory(webSocketFactory), environmentService, remoteAuthorityResolverService);
3128

32-
this.socketFactory = new BrowserSocketFactory(webSocketFactory);
3329
const remoteAuthority = environmentService.configuration.remoteAuthority;
3430
if (remoteAuthority) {
3531
this._connection = this._register(new RemoteAgentConnection(remoteAuthority, productService.commit, this.socketFactory, remoteAuthorityResolverService, signService, logService));

src/vs/workbench/services/remote/common/abstractRemoteAgentService.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,20 @@ import { ISignService } from 'vs/platform/sign/common/sign';
2323
import { ILogService } from 'vs/platform/log/common/log';
2424
import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry';
2525

26-
export abstract class AbstractRemoteAgentService extends Disposable {
26+
export abstract class AbstractRemoteAgentService extends Disposable implements IRemoteAgentService {
2727

2828
declare readonly _serviceBrand: undefined;
2929

30+
public readonly socketFactory: ISocketFactory;
3031
private _environment: Promise<IRemoteAgentEnvironment | null> | null;
3132

3233
constructor(
34+
socketFactory: ISocketFactory,
3335
@IEnvironmentService protected readonly _environmentService: IEnvironmentService,
3436
@IRemoteAuthorityResolverService private readonly _remoteAuthorityResolverService: IRemoteAuthorityResolverService
3537
) {
3638
super();
39+
this.socketFactory = socketFactory;
3740
this._environment = null;
3841
}
3942

src/vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@ import { IProductService } from 'vs/platform/product/common/productService';
99
import { nodeSocketFactory } from 'vs/platform/remote/node/nodeSocketFactory';
1010
import { AbstractRemoteAgentService, RemoteAgentConnection } from 'vs/workbench/services/remote/common/abstractRemoteAgentService';
1111
import { ISignService } from 'vs/platform/sign/common/sign';
12-
import { ISocketFactory } from 'vs/platform/remote/common/remoteAgentConnection';
1312
import { ILogService } from 'vs/platform/log/common/log';
1413
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
1514

1615
export class RemoteAgentService extends AbstractRemoteAgentService implements IRemoteAgentService {
1716

18-
public readonly socketFactory: ISocketFactory;
19-
2017
private readonly _connection: IRemoteAgentConnection | null = null;
2118

2219
constructor(
@@ -26,8 +23,7 @@ export class RemoteAgentService extends AbstractRemoteAgentService implements IR
2623
@ILogService logService: ILogService,
2724
@IProductService productService: IProductService
2825
) {
29-
super(environmentService, remoteAuthorityResolverService);
30-
this.socketFactory = nodeSocketFactory;
26+
super(nodeSocketFactory, environmentService, remoteAuthorityResolverService);
3127
if (environmentService.configuration.remoteAuthority) {
3228
this._connection = this._register(new RemoteAgentConnection(environmentService.configuration.remoteAuthority, productService.commit, nodeSocketFactory, remoteAuthorityResolverService, signService, logService));
3329
}

0 commit comments

Comments
 (0)