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

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

Issue 9288037: Do not filter IPC messages until the new RVH commits, to avoid a race. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comment as well. 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
« no previous file with comments | « no previous file | content/browser/tab_contents/render_view_host_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4efd32d0795135638dc1c0fbe08ed0dc7e144357 100644
--- a/content/browser/renderer_host/render_view_host.cc
+++ b/content/browser/renderer_host/render_view_host.cc
@@ -333,12 +333,6 @@ void RenderViewHost::FirePageBeforeUnload(bool for_cross_site_transition) {
void RenderViewHost::SwapOut(int new_render_process_host_id,
int new_request_id) {
- // Start filtering IPC messages to avoid confusing the delegate. This will
- // prevent any dialogs from appearing during unload handlers, but we've
- // already decided to silence them in crbug.com/68780. We will set it back
- // to false in SetNavigationsSuspended if we swap back in.
battre 2012/01/26 16:49:40 Has the situation changed for crbug.com/68780 ("Di
Charlie Reis 2012/01/26 17:03:16 That situation has not changed, but I view this as
- is_swapped_out_ = true;
-
// This will be set back to false in OnSwapOutACK, just before we replace
// this RVH with the pending RVH.
is_waiting_for_unload_ack_ = true;
@@ -371,6 +365,14 @@ void RenderViewHost::WasSwappedOut() {
// Don't bother reporting hung state anymore.
StopHangMonitorTimeout();
+ // Now that we're no longer the active RVH in the tab, start filtering out
+ // most IPC messages. Usually the renderer will have stopped sending
+ // messages as of OnSwapOutACK. However, we may have timed out waiting
+ // for that message, and additional IPC messages may keep streaming in.
+ // We filter them out, as long as that won't cause problems (e.g., we
+ // still allow synchronous messages through).
+ is_swapped_out_ = true;
+
// Inform the renderer that it can exit if no one else is using it.
Send(new ViewMsg_WasSwappedOut(routing_id()));
}
« no previous file with comments | « no previous file | content/browser/tab_contents/render_view_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698