refactor: enforce naming of ipcMainInternal (#16689)
This commit is contained in:
parent
cacb56b103
commit
af64140100
10 changed files with 45 additions and 43 deletions
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
const ipcMain = require('@electron/internal/browser/ipc-main-internal')
|
||||
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal')
|
||||
const errorUtils = require('@electron/internal/common/error-utils')
|
||||
|
||||
const callHandler = async function (handler, event, args, reply) {
|
||||
|
@ -13,7 +13,7 @@ const callHandler = async function (handler, event, args, reply) {
|
|||
}
|
||||
|
||||
exports.handle = function (channel, handler) {
|
||||
ipcMain.on(channel, (event, requestId, ...args) => {
|
||||
ipcMainInternal.on(channel, (event, requestId, ...args) => {
|
||||
callHandler(handler, event, args, responseArgs => {
|
||||
event._replyInternal(`${channel}_RESPONSE_${requestId}`, ...responseArgs)
|
||||
})
|
||||
|
@ -21,7 +21,7 @@ exports.handle = function (channel, handler) {
|
|||
}
|
||||
|
||||
exports.handleSync = function (channel, handler) {
|
||||
ipcMain.on(channel, (event, ...args) => {
|
||||
ipcMainInternal.on(channel, (event, ...args) => {
|
||||
callHandler(handler, event, args, responseArgs => {
|
||||
event.returnValue = responseArgs
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue