From: Cheng Zhao Date: Tue, 23 Apr 2013 14:21:49 +0000 (+0800) Subject: No more plan for ipc.sendSync in browser. X-Git-Tag: v0.1.0~266 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=f8899242c5263f6fda7f5f91067ea427e6641945;p=electron.git No more plan for ipc.sendSync in browser. I want the browser to be fully asynchronous, so sending synchronous messages from browser to renderer will be unacceptable. --- diff --git a/common/api/api_messages.h b/common/api/api_messages.h index cc6d5f68..48f6d0e2 100644 --- a/common/api/api_messages.h +++ b/common/api/api_messages.h @@ -27,8 +27,3 @@ IPC_SYNC_MESSAGE_ROUTED2_1(AtomViewHostMsg_Message_Sync, IPC_MESSAGE_ROUTED2(AtomViewMsg_Message, std::string /* channel */, ListValue /* arguments */) - -IPC_SYNC_MESSAGE_ROUTED2_1(AtomViewMsg_Message_Sync, - std::string /* channel */, - ListValue /* arguments */, - DictionaryValue /* result */) diff --git a/renderer/api/lib/ipc.coffee b/renderer/api/lib/ipc.coffee index 4c21c48b..05929406 100644 --- a/renderer/api/lib/ipc.coffee +++ b/renderer/api/lib/ipc.coffee @@ -5,11 +5,9 @@ class Ipc extends EventEmitter constructor: -> process.on 'ATOM_INTERNAL_MESSAGE', (args...) => @emit(args...) - process.on 'ATOM_INTERNAL_MESSAGE_SYNC', (args...) => - @emit(args...) send: (args...) -> - @sendChannel('message', args...) + ipc.send('ATOM_INTERNAL_MESSAGE', 'message', args...) sendChannel: (args...) -> ipc.send('ATOM_INTERNAL_MESSAGE', args...)