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

Unified Diff: content/browser/renderer_host/resource_dispatcher_host.cc

Issue 6319001: Support window.opener after a process swap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with trunk. Created 9 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
Index: content/browser/renderer_host/resource_dispatcher_host.cc
diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc
index ce775c73c9d14fcd6cbedd06040baafe20df7d8f..a9525dd6ce333fc861154d2dafc8c81e96b0a0e6 100644
--- a/content/browser/renderer_host/resource_dispatcher_host.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host.cc
@@ -345,7 +345,7 @@ bool ResourceDispatcherHost::OnMessageReceived(const IPC::Message& message,
IPC_MESSAGE_HANDLER(ResourceHostMsg_UploadProgress_ACK, OnUploadProgressACK)
IPC_MESSAGE_HANDLER(ResourceHostMsg_CancelRequest, OnCancelRequest)
IPC_MESSAGE_HANDLER(ResourceHostMsg_FollowRedirect, OnFollowRedirect)
- IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnClosePageACK)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_SwapOut_ACK, OnSwapOutACK)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP_EX()
@@ -717,30 +717,23 @@ ResourceDispatcherHost::CreateRequestInfoForBrowserRequest(
&context);
}
-void ResourceDispatcherHost::OnClosePageACK(
- const ViewMsg_ClosePage_Params& params) {
- if (params.for_cross_site_transition) {
- // Closes for cross-site transitions are handled such that the cross-site
- // transition continues.
- GlobalRequestID global_id(params.new_render_process_host_id,
- params.new_request_id);
- PendingRequestList::iterator i = pending_requests_.find(global_id);
- if (i != pending_requests_.end()) {
- // The response we were meant to resume could have already been canceled.
- ResourceDispatcherHostRequestInfo* info = InfoForRequest(i->second);
- if (info->cross_site_handler())
- info->cross_site_handler()->ResumeResponse();
- }
- } else {
- // This is a tab close, so we will close the tab in OnClosePageACK.
- DCHECK(params.new_render_process_host_id == -1);
- DCHECK(params.new_request_id == -1);
+void ResourceDispatcherHost::OnSwapOutACK(
+ const ViewMsg_SwapOut_Params& params) {
+ // Closes for cross-site transitions are handled such that the cross-site
+ // transition continues.
+ GlobalRequestID global_id(params.new_render_process_host_id,
+ params.new_request_id);
+ PendingRequestList::iterator i = pending_requests_.find(global_id);
+ if (i != pending_requests_.end()) {
+ // The response we were meant to resume could have already been canceled.
+ ResourceDispatcherHostRequestInfo* info = InfoForRequest(i->second);
+ if (info->cross_site_handler())
+ info->cross_site_handler()->ResumeResponse();
}
// Update the RenderViewHost's internal state after the ACK.
CallRenderViewHost(params.closing_process_id,
params.closing_route_id,
- &RenderViewHost::OnClosePageACK,
- params.for_cross_site_transition);
+ &RenderViewHost::OnSwapOutACK);
}
// We are explicitly forcing the download of 'url'.

Powered by Google App Engine
This is Rietveld 408576698