Index: content/browser/renderer_host/render_view_host.cc |
diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc |
index 22d9b89b03f31bccf2ae1d54f0538890f105cb60..3b6ba750a14377d50d66a8a1be1fad48b5efd001 100644 |
--- a/content/browser/renderer_host/render_view_host.cc |
+++ b/content/browser/renderer_host/render_view_host.cc |
@@ -666,10 +666,21 @@ bool RenderViewHost::OnMessageReceived(const IPC::Message& msg) { |
return true; |
// Filter out most IPC messages if this renderer is swapped out. |
- // We still want to certain ACKs to keep our state consistent. |
- if (is_swapped_out_) |
- if (!content::SwappedOutMessages::CanHandleWhileSwappedOut(msg)) |
+ // We still want to handle certain ACKs to keep our state consistent. |
+ if (is_swapped_out_) { |
+ if (!content::SwappedOutMessages::CanHandleWhileSwappedOut(msg)) { |
+ // If this is a synchronous message and we decided not to handle it, |
+ // we must send an error reply, or else the renderer will be stuck |
+ // and won't respond to future requests. |
+ if (msg.is_sync()) { |
+ IPC::Message* reply = IPC::SyncMessage::GenerateReply(&msg); |
+ reply->set_reply_error(); |
+ Send(reply); |
+ } |
+ // Don't continue looking for someone to handle it. |
return true; |
+ } |
+ } |
ObserverListBase<content::RenderViewHostObserver>::Iterator it(observers_); |
content::RenderViewHostObserver* observer; |