Deprecate ipc module for ipcRenderer

This commit is contained in:
Cheng Zhao 2015-11-10 15:12:07 +08:00
parent bd1f6e2edf
commit 828d911ed1
4 changed files with 32 additions and 14 deletions

View file

@ -0,0 +1,16 @@
binding = process.atomBinding 'ipc'
v8Util = process.atomBinding 'v8_util'
# Created by init.coffee.
ipcRenderer = v8Util.getHiddenValue global, 'ipc'
ipcRenderer.send = (args...) ->
binding.send 'ipc-message', [args...]
ipcRenderer.sendSync = (args...) ->
JSON.parse binding.sendSync('ipc-message-sync', [args...])
ipcRenderer.sendToHost = (args...) ->
binding.send 'ipc-message-host', [args...]
module.exports = ipcRenderer