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

Unified Diff: chrome/browser/tab_contents/render_view_host_manager.cc

Issue 159255: Fix a race condition where rapid back/forward clicks could close a tab... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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/browser/renderer_host/resource_dispatcher_host.cc ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/render_view_host_manager.cc
===================================================================
--- chrome/browser/tab_contents/render_view_host_manager.cc (revision 21465)
+++ chrome/browser/tab_contents/render_view_host_manager.cc (working copy)
@@ -145,8 +145,14 @@
// be swapped in as part of the usual DidNavigate logic. (If the unload
// handler later finishes, this call will be ignored because the state in
// CrossSiteResourceHandler will already be cleaned up.)
- current_host()->process()->CrossSiteClosePageACK(
- pending_render_view_host_->process()->pid(), pending_request_id);
+ ViewMsg_ClosePage_Params params;
+ params.closing_process_id = render_view_host_->process()->pid();
+ params.closing_route_id = render_view_host_->routing_id();
+ params.for_cross_site_transition = true;
+ params.new_render_process_host_id =
+ pending_render_view_host_->process()->pid();
+ params.new_request_id = pending_request_id;
+ current_host()->process()->CrossSiteClosePageACK(params);
}
return false;
}
@@ -215,7 +221,7 @@
if (proceed_to_fire_unload) {
// This is not a cross-site navigation, the tab is being closed.
- render_view_host_->FirePageUnload();
+ render_view_host_->ClosePage(true, -1, -1);
}
return;
}
@@ -246,7 +252,8 @@
// will send a ClosePage_ACK to the ResourceDispatcherHost with the given
// IDs (of the pending RVH's request), allowing the pending RVH's response to
// resume.
- render_view_host_->ClosePage(new_render_process_host_id, new_request_id);
+ render_view_host_->ClosePage(true,
+ new_render_process_host_id, new_request_id);
// ResourceDispatcherHost has told us to run the onunload handler, which
// means it is not a download or unsafe page, and we are going to perform the
« no previous file with comments | « chrome/browser/renderer_host/resource_dispatcher_host.cc ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698