From ce569ebf78207f7385bb725d9343d7ab7fb6d5fb Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 10 Jul 2013 12:36:02 +0800 Subject: [PATCH] Enable the UI thread in browser to receive synchronous messages. This is required to send synchronous message from renderer to browser. --- renderer/api/atom_api_renderer_ipc.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/renderer/api/atom_api_renderer_ipc.cc b/renderer/api/atom_api_renderer_ipc.cc index cc2cc7cfc908..022ad28741d2 100644 --- a/renderer/api/atom_api_renderer_ipc.cc +++ b/renderer/api/atom_api_renderer_ipc.cc @@ -98,11 +98,14 @@ v8::Handle RendererIPC::SendSync(const v8::Arguments &args) { RenderView* render_view = GetCurrentRenderView(); base::DictionaryValue result; - bool success = render_view->Send(new AtomViewHostMsg_Message_Sync( + IPC::SyncMessage* message = new AtomViewHostMsg_Message_Sync( render_view->GetRoutingID(), channel, *static_cast(arguments.get()), - &result)); + &result); + // Enable the UI thread in browser to receive messages. + message->EnableMessagePumping(); + bool success = render_view->Send(message); if (!success) return node::ThrowError("Unable to send AtomViewHostMsg_Message_Sync");