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

Unified Diff: content/browser/web_contents/render_view_host_manager.cc

Issue 15742019: Avoid DidStopLoading messages from the old renderer process during a transfer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clarify comment. Created 7 years, 7 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 | « chrome/test/data/beforeunload.html ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/render_view_host_manager.cc
diff --git a/content/browser/web_contents/render_view_host_manager.cc b/content/browser/web_contents/render_view_host_manager.cc
index 208829ab3f7882a414b0497dfc1cef5c7b2d00d6..4cbd0fc4f7d6cbe424b7bbe592b79eb1652f073d 100644
--- a/content/browser/web_contents/render_view_host_manager.cc
+++ b/content/browser/web_contents/render_view_host_manager.cc
@@ -832,10 +832,6 @@ RenderViewHostImpl* RenderViewHostManager::UpdateRendererStateForNavigate(
}
// Otherwise, it's safe to treat this as a pending cross-site transition.
- // Make sure the old render view stops, in case a load is in progress.
- render_view_host_->Send(
- new ViewMsg_Stop(render_view_host_->GetRoutingID()));
-
// We need to wait until the beforeunload handler has run, unless we are
// transferring an existing request (in which case it has already run).
// Suspend the new render view (i.e., don't let it send the cross-site
@@ -846,6 +842,12 @@ RenderViewHostImpl* RenderViewHostManager::UpdateRendererStateForNavigate(
bool is_transfer =
entry.transferred_global_request_id() != GlobalRequestID();
if (!is_transfer) {
+ // Also make sure the old render view stops, in case a load is in
+ // progress. (We don't want to do this for transfers, since it will
+ // interrupt the transfer with an unexpected DidStopLoading.)
+ render_view_host_->Send(
+ new ViewMsg_Stop(render_view_host_->GetRoutingID()));
+
pending_render_view_host_->SetNavigationsSuspended(true,
base::TimeTicks());
}
« no previous file with comments | « chrome/test/data/beforeunload.html ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698