Use ipcRenderer in Electron's code

This commit is contained in:
Cheng Zhao 2015-11-10 15:29:43 +08:00
parent 828d911ed1
commit 6515a445a0
20 changed files with 32 additions and 34 deletions

View file

@ -1,4 +1,4 @@
ipc = require 'ipc'
ipc = require 'ipc-renderer'
v8Util = process.atomBinding 'v8_util'
CallbacksRegistry = require 'callbacks-registry'
@ -119,11 +119,11 @@ metaToPlainObject = (meta) ->
obj
# Browser calls a callback in renderer.
ipc.on 'ATOM_RENDERER_CALLBACK', (id, args) ->
ipc.on 'ATOM_RENDERER_CALLBACK', (event, id, args) ->
callbacksRegistry.apply id, metaToValue(args)
# A callback in browser is released.
ipc.on 'ATOM_RENDERER_RELEASE_CALLBACK', (id) ->
ipc.on 'ATOM_RENDERER_RELEASE_CALLBACK', (event, id) ->
callbacksRegistry.remove id
# Get remote module.