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

Unified Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 196133032: Add test for filtering of IPC messages when RenderFrameHost is swapped out. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit tests for cross-site navigation and SwapOut. Created 6 years, 9 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/frame_host/render_frame_host_manager.cc
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index d697e186d0c4dae004a901635c31d549514bffb9..33ef7fd8ac51ccccd0e5df51beb6785422e05e86 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -468,10 +468,14 @@ void RenderFrameHostManager::DidNavigateMainFrame(
// The pending cross-site navigation completed, so show the renderer.
// If it committed without sending network requests (e.g., data URLs),
// then we still need to swap out the old RFH first and run its unload
- // handler. OK for that to happen in the background.
+ // handler. OK for that to happen in the background, only if it hasn't
+ // happened yet.
Charlie Reis 2014/03/21 21:35:13 Please move "if it hasn't happened yet" to the end
nasko 2014/03/24 17:48:11 Done.
if (pending_render_frame_host_->render_view_host()->
- HasPendingCrossSiteRequest())
+ HasPendingCrossSiteRequest() &&
+ pending_render_frame_host_->render_view_host()->rvh_state() !=
+ RenderViewHostImpl::STATE_WAITING_FOR_COMMIT) {
Charlie Reis 2014/03/21 21:35:13 What if it were STATE_WAITING_FOR_UNLOAD_ACK? Tha
nasko 2014/03/24 17:48:11 Done.
SwapOutOldPage();
+ }
CommitPending();
cross_navigation_pending_ = false;

Powered by Google App Engine
This is Rietveld 408576698