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

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: Send JS replies to right RVH. 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 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;
« no previous file with comments | « content/browser/javascript_dialogs.h ('k') | content/browser/tab_contents/render_view_host_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698