@@ -103,7 +103,7 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat
103
103
104
104
const onExit = ( ) => disposables . dispose ( ) ;
105
105
process . once ( 'exit' , onExit ) ;
106
- ipcRenderer . once ( 'handshake:mainprocess-goodbye ' , onExit ) ;
106
+ ipcRenderer . once ( 'electron-main->shared-process: exit ' , onExit ) ;
107
107
108
108
disposables . add ( server ) ;
109
109
@@ -280,18 +280,19 @@ function setupIPC(hook: string): Promise<Server> {
280
280
281
281
async function handshake ( configuration : ISharedProcessConfiguration ) : Promise < void > {
282
282
283
- // shared process -> main: give me payload for IPC connection
284
- // main -> shared process: payload for IPC connection
283
+ // receive payload from electron-main to start things
285
284
const data = await new Promise < ISharedProcessInitData > ( c => {
286
- ipcRenderer . once ( 'handshake:main-payload' , ( _ : any , r : ISharedProcessInitData ) => c ( r ) ) ;
287
- ipcRenderer . send ( 'handshake:sharedprocess-hello' ) ;
285
+ ipcRenderer . once ( 'electron-main->shared-process: payload' , ( _ : any , r : ISharedProcessInitData ) => c ( r ) ) ;
286
+
287
+ // tell electron-main we are ready to receive payload
288
+ ipcRenderer . send ( 'shared-process->electron-main: ready-for-payload' ) ;
288
289
} ) ;
289
290
290
- // shared process => main: IPC connection established
291
+ // await IPC connection and signal this back to electron-main
291
292
const server = await setupIPC ( data . sharedIPCHandle ) ;
292
- ipcRenderer . send ( 'handshake:sharedprocess- ipc-ready' ) ;
293
+ ipcRenderer . send ( 'shared-process->electron-main: ipc-ready' ) ;
293
294
294
- // shared process => main: initialization done
295
+ // await initialization and signal this back to electron-main
295
296
await main ( server , data , configuration ) ;
296
- ipcRenderer . send ( 'handshake:sharedprocess- init-ready ' ) ;
297
+ ipcRenderer . send ( 'shared-process->electron-main: init-done ' ) ;
297
298
}
0 commit comments