2018-10-06 11:48:00 +00:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
const binding = process.atomBinding('ipc')
|
|
|
|
const v8Util = process.atomBinding('v8_util')
|
|
|
|
|
|
|
|
// Created by init.js.
|
|
|
|
const ipcRenderer = v8Util.getHiddenValue(global, 'ipc-internal')
|
|
|
|
const internal = true
|
|
|
|
|
2019-01-23 16:24:57 +00:00
|
|
|
ipcRenderer.send = function (channel, ...args) {
|
|
|
|
return binding.send(internal, channel, args)
|
2018-10-06 11:48:00 +00:00
|
|
|
}
|
|
|
|
|
2019-01-23 16:24:57 +00:00
|
|
|
ipcRenderer.sendSync = function (channel, ...args) {
|
|
|
|
return binding.sendSync(internal, channel, args)[0]
|
2018-10-06 11:48:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ipcRenderer.sendTo = function (webContentsId, channel, ...args) {
|
|
|
|
return binding.sendTo(internal, false, webContentsId, channel, args)
|
|
|
|
}
|
|
|
|
|
|
|
|
ipcRenderer.sendToAll = function (webContentsId, channel, ...args) {
|
|
|
|
return binding.sendTo(internal, true, webContentsId, channel, args)
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = ipcRenderer
|