refactor: create IPC_MESSAGES enum for IPC message channels (#25694)

This commit is contained in:
Milan Burda 2020-10-13 23:11:06 +02:00 committed by GitHub
parent 8dfb1cf78f
commit 2c68bad631
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 225 additions and 126 deletions

View file

@ -1,5 +1,6 @@
import { webFrame, WebFrame } from 'electron';
import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-internal-utils';
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
// All keys of WebFrame that extend Function
type WebFrameMethod = {
@ -9,7 +10,7 @@ type WebFrameMethod = {
export const webFrameInit = () => {
// Call webFrame method
ipcRendererUtils.handle('ELECTRON_INTERNAL_RENDERER_WEB_FRAME_METHOD', (
ipcRendererUtils.handle(IPC_MESSAGES.RENDERER_WEB_FRAME_METHOD, (
event, method: keyof WebFrameMethod, ...args: any[]
) => {
// TODO(MarshallOfSound): Remove once the world-safe-execute-javascript deprecation warning is removed