4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
6
import { CancellationToken } from 'vs/base/common/cancellation' ;
7
+ import { isBoolean } from 'vs/base/common/types' ;
7
8
import { IRequestContext , IRequestOptions } from 'vs/base/parts/request/common/request' ;
8
9
import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
9
10
import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/services' ;
10
11
import { ILogService } from 'vs/platform/log/common/log' ;
12
+ import { IProductService } from 'vs/platform/product/common/productService' ;
11
13
import { RequestService } from 'vs/platform/request/browser/requestService' ;
12
14
import { IRequestService } from 'vs/platform/request/common/request' ;
13
15
import { RequestChannelClient } from 'vs/platform/request/common/requestIpc' ;
@@ -22,6 +24,7 @@ export class SharedProcessRequestService implements IRequestService {
22
24
constructor (
23
25
mainProcessService : IMainProcessService ,
24
26
private readonly configurationService : IConfigurationService ,
27
+ private readonly productService : IProductService ,
25
28
private readonly logService : ILogService ,
26
29
) {
27
30
this . browserRequestService = new RequestService ( configurationService , logService ) ;
@@ -37,11 +40,19 @@ export class SharedProcessRequestService implements IRequestService {
37
40
}
38
41
39
42
private getRequestService ( ) : IRequestService {
40
- if ( this . configurationService . getValue ( 'developer.sharedProcess.redirectRequestsToMain' ) === true ) {
43
+ if ( this . isMainRequestServiceEnabled ( ) ) {
41
44
this . logService . trace ( 'Using main request service' ) ;
42
45
return this . mainRequestService ;
43
46
}
44
47
this . logService . trace ( 'Using browser request service' ) ;
45
48
return this . browserRequestService ;
46
49
}
50
+
51
+ private isMainRequestServiceEnabled ( ) : boolean {
52
+ const value = this . configurationService . getValue ( 'developer.sharedProcess.redirectRequestsToMain' ) ;
53
+ if ( isBoolean ( value ) ) {
54
+ return value ;
55
+ }
56
+ return this . productService . quality !== 'stable' ;
57
+ }
47
58
}
0 commit comments