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

Unified Diff: content/browser/renderer_host/render_view_host.cc

Issue 9271054: Send replies to sync IPCs from swapped out renderers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test on Mac/Win Created 8 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
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 921bd94fd3a8b73eb57230fe4795b34964b2de2d..ca753331bdffac36955174d543972dcb92858846 100644
--- a/content/browser/renderer_host/render_view_host.cc
+++ b/content/browser/renderer_host/render_view_host.cc
@@ -664,10 +664,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;

Powered by Google App Engine
This is Rietveld 408576698