refactor: create IPC_MESSAGES enum for IPC message channels (#25694)
This commit is contained in:
parent
8dfb1cf78f
commit
2c68bad631
26 changed files with 225 additions and 126 deletions
|
@ -1,5 +1,6 @@
|
|||
import { invokeSync } from '../ipc-renderer-internal-utils';
|
||||
import { deprecate } from 'electron';
|
||||
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
|
||||
|
||||
const binding = process._linkedBinding('electron_renderer_crash_reporter');
|
||||
|
||||
|
@ -13,27 +14,27 @@ export default {
|
|||
|
||||
getLastCrashReport (): Electron.CrashReport | null {
|
||||
deprecate.log('crashReporter.getLastCrashReport is deprecated in the renderer process. Call it from the main process instead.');
|
||||
return invokeSync('ELECTRON_CRASH_REPORTER_GET_LAST_CRASH_REPORT');
|
||||
return invokeSync(IPC_MESSAGES.CRASH_REPORTER_GET_LAST_CRASH_REPORT);
|
||||
},
|
||||
|
||||
getUploadedReports () {
|
||||
deprecate.log('crashReporter.getUploadedReports is deprecated in the renderer process. Call it from the main process instead.');
|
||||
return invokeSync('ELECTRON_CRASH_REPORTER_GET_UPLOADED_REPORTS');
|
||||
return invokeSync(IPC_MESSAGES.CRASH_REPORTER_GET_UPLOADED_REPORTS);
|
||||
},
|
||||
|
||||
getUploadToServer () {
|
||||
deprecate.log('crashReporter.getUploadToServer is deprecated in the renderer process. Call it from the main process instead.');
|
||||
return invokeSync('ELECTRON_CRASH_REPORTER_GET_UPLOAD_TO_SERVER');
|
||||
return invokeSync(IPC_MESSAGES.CRASH_REPORTER_GET_UPLOAD_TO_SERVER);
|
||||
},
|
||||
|
||||
setUploadToServer (uploadToServer: boolean) {
|
||||
deprecate.log('crashReporter.setUploadToServer is deprecated in the renderer process. Call it from the main process instead.');
|
||||
return invokeSync('ELECTRON_CRASH_REPORTER_SET_UPLOAD_TO_SERVER', uploadToServer);
|
||||
return invokeSync(IPC_MESSAGES.CRASH_REPORTER_SET_UPLOAD_TO_SERVER, uploadToServer);
|
||||
},
|
||||
|
||||
getCrashesDirectory () {
|
||||
deprecate.log('crashReporter.getCrashesDirectory is deprecated in the renderer process. Call it from the main process instead.');
|
||||
return invokeSync('ELECTRON_CRASH_REPORTER_GET_CRASHES_DIRECTORY');
|
||||
return invokeSync(IPC_MESSAGES.CRASH_REPORTER_GET_CRASHES_DIRECTORY);
|
||||
},
|
||||
|
||||
addExtraParameter (key: string, value: string) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue