Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Unified Diff: ipc/ipc_channel_proxy.cc

Issue 11823027: [Android WebView] Implement the capture picture API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed synchronous IPC problems that crashed/deadlocked tests. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_proxy.cc
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index 0202e9e27ef665d13fe5dc30c01737fe5aaa1106..2fd37553b89654247ae92096300a9897036b536d 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -258,7 +258,17 @@ void ChannelProxy::Context::OnDispatchMessage(const Message& message) {
logger->OnPreDispatchMessage(message);
#endif
- listener_->OnMessageReceived(message);
+ bool handled = listener_->OnMessageReceived(message);
+
+ // Prevent non-handled synchronous messages to deadlock waiting for a reply.
joth 2013/01/18 01:37:08 uber-nit: this is not strictly always going to res
Leandro Graciá Gil 2013/01/18 18:53:03 Comment removed when creating a separate private m
+ if (!handled && message.is_sync()) {
Leandro Graciá Gil 2013/01/18 01:31:24 Should this also happen in other places returning
Leandro Graciá Gil 2013/01/18 18:53:03 Done.
+ Message* reply = SyncMessage::GenerateReply(&message);
+ reply->set_reply_error();
+ ipc_task_runner()->PostTask(
+ FROM_HERE,
+ base::Bind(&ChannelProxy::Context::OnSendMessage,
+ this, base::Passed(scoped_ptr<Message>(reply))));
+ }
joth 2013/01/18 01:37:08 this seems pretty reasonable to me, FWIW, but I'd
Leandro Graciá Gil 2013/01/18 18:53:03 We can if either you or John have a strong opinion
#ifdef IPC_MESSAGE_LOG_ENABLED
if (logger->Enabled())
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698