mirror of
https://github.com/HackPlan/atom-shell.git
synced 2026-04-24 11:56:08 +08:00
Pass synchronous messages by JSON string.
We are going to use IPC_MESSAGE_HANDLER_DELAY_REPLY to handle synchronous messages but DictionaryValue is not copyable, so we pass the JSON string instead.
This commit is contained in:
@@ -17,10 +17,10 @@ class Ipc extends EventEmitter
|
||||
|
||||
sendSync: (args...) ->
|
||||
msg = ipc.sendSync('ATOM_INTERNAL_MESSAGE_SYNC', 'sync-message', args...)
|
||||
msg.returnValue ? msg.result
|
||||
JSON.parse(msg)
|
||||
|
||||
sendChannelSync: (args...) ->
|
||||
msg = ipc.sendSync('ATOM_INTERNAL_MESSAGE_SYNC', args...)
|
||||
msg.returnValue ? msg.result
|
||||
JSON.parse(msg)
|
||||
|
||||
module.exports = new Ipc
|
||||
|
||||
Reference in New Issue
Block a user