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

Unified Diff: content/renderer/render_view_impl.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 | « content/browser/web_contents/render_view_host_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 7f2172b76eafde1f96ae015c7bbe1a412344aa27..b263a86691589046b61124947278e2a21fa83e46 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -5461,9 +5461,6 @@ void RenderViewImpl::OnShouldClose() {
}
void RenderViewImpl::OnSwapOut(const ViewMsg_SwapOut_Params& params) {
- // Ensure that no other in-progress navigation continues.
- OnStop();
-
// Only run unload if we're not swapped out yet, but send the ack either way.
if (!is_swapped_out_) {
// Swap this RenderView out so the tab can navigate to a page rendered by a
@@ -5480,6 +5477,11 @@ void RenderViewImpl::OnSwapOut(const ViewMsg_SwapOut_Params& params) {
// Swap out and stop sending any IPC messages that are not ACKs.
SetSwappedOut(true);
+ // Now that we're swapped out and filtering IPC messages, stop loading to
+ // ensure that no other in-progress navigation continues. We do this here
+ // to avoid sending a DidStopLoading message to the browser process.
+ OnStop();
+
// Replace the page with a blank dummy URL. The unload handler will not be
// run a second time, thanks to a check in FrameLoader::stopLoading.
// TODO(creis): Need to add a better way to do this that avoids running the
« no previous file with comments | « content/browser/web_contents/render_view_host_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698