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

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: Fixing url_chain and comment. 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 4d326a509abffdeb4a9a503622bab2c2560818b4..791eb89285c912ad392802815b6a6b94c6214be6 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -467,10 +467,14 @@ void RenderFrameHostManager::DidNavigateFrame(
// 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, only if it hasn't happened yet. OK for that to happen in the
+ // background.
if (pending_render_frame_host_->render_view_host()->
- HasPendingCrossSiteRequest())
+ HasPendingCrossSiteRequest() &&
+ pending_render_frame_host_->render_view_host()->rvh_state() ==
+ RenderViewHostImpl::STATE_DEFAULT) {
SwapOutOldPage();
+ }
CommitPending();
cross_navigation_pending_ = false;

Powered by Google App Engine
This is Rietveld 408576698