@@ -63,7 +63,8 @@ import { UserDataAutoSync } from 'vs/platform/userDataSync/electron-browser/user
6363import { SettingsSynchroniser } from 'vs/platform/userDataSync/common/settingsSync' ;
6464import { UserDataAuthTokenService } from 'vs/platform/userDataSync/common/userDataAuthTokenService' ;
6565import { GlobalStorageDatabaseChannelClient } from 'vs/platform/storage/node/storageIpc' ;
66- import { IStorageMainService , SimpleStorageMainService } from 'vs/platform/storage/node/storageMainService' ;
66+ import { NativeStorageService } from 'vs/platform/storage/node/storageService' ;
67+ import { IStorageService } from 'vs/platform/storage/common/storage' ;
6768
6869export interface ISharedProcessConfiguration {
6970 readonly machineId : string ;
@@ -115,23 +116,25 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat
115116 disposables . add ( logService ) ;
116117 logService . info ( 'main' , JSON . stringify ( configuration ) ) ;
117118
119+ const mainProcessService = new MainProcessService ( server , mainRouter ) ;
120+ services . set ( IMainProcessService , mainProcessService ) ;
121+
118122 const configurationService = new ConfigurationService ( environmentService . settingsResource ) ;
119123 disposables . add ( configurationService ) ;
120124 await configurationService . initialize ( ) ;
121125
126+ const storageService = new NativeStorageService ( new GlobalStorageDatabaseChannelClient ( mainProcessService . getChannel ( 'storage' ) ) , logService , environmentService ) ;
127+ await storageService . initialize ( ) ;
128+ services . set ( IStorageService , storageService ) ;
129+ disposables . add ( toDisposable ( ( ) => storageService . flush ( ) ) ) ;
130+
122131 services . set ( IEnvironmentService , environmentService ) ;
123132 services . set ( IProductService , { _serviceBrand : undefined , ...product } ) ;
124133 services . set ( ILogService , logService ) ;
125134 services . set ( IConfigurationService , configurationService ) ;
126135 services . set ( IRequestService , new SyncDescriptor ( RequestService ) ) ;
127136 services . set ( ILoggerService , new SyncDescriptor ( LoggerService ) ) ;
128137
129- const mainProcessService = new MainProcessService ( server , mainRouter ) ;
130- services . set ( IMainProcessService , mainProcessService ) ;
131-
132- const storageMainService = new SimpleStorageMainService ( new GlobalStorageDatabaseChannelClient ( mainProcessService . getChannel ( 'storage' ) ) ) ;
133- await storageMainService . initialize ( ) ;
134- services . set ( IStorageMainService , storageMainService ) ;
135138
136139 const electronService = createChannelSender < IElectronService > ( mainProcessService . getChannel ( 'electron' ) , { context : configuration . windowId } ) ;
137140 services . set ( IElectronService , electronService ) ;
0 commit comments