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

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

Issue 7647003: Update routing id of pending resource requests for reparented iframes. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixed Copyright that presubmit complains about. Created 9 years, 4 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 a3c4bd4a6ff4560da43f314677ec4ef88b5fde1d..b81722d9a12782c7c9a3e83c81737f4682715daa 100644
--- a/content/browser/renderer_host/resource_dispatcher_host.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host.cc
@@ -345,6 +345,8 @@ bool ResourceDispatcherHost::OnMessageReceived(const IPC::Message& message,
IPC_MESSAGE_HANDLER(ResourceHostMsg_DataDownloaded_ACK, OnDataDownloadedACK)
IPC_MESSAGE_HANDLER(ResourceHostMsg_UploadProgress_ACK, OnUploadProgressACK)
IPC_MESSAGE_HANDLER(ResourceHostMsg_CancelRequest, OnCancelRequest)
+ IPC_MESSAGE_HANDLER(ResourceHostMsg_TransferRequestToNewPage,
+ OnTransferRequestToNewPage)
IPC_MESSAGE_HANDLER(ResourceHostMsg_FollowRedirect, OnFollowRedirect)
IPC_MESSAGE_HANDLER(ViewHostMsg_SwapOut_ACK, OnSwapOutACK)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidLoadResourceFromMemoryCache,
@@ -641,6 +643,24 @@ void ResourceDispatcherHost::OnCancelRequest(int request_id) {
CancelRequest(filter_->child_id(), request_id, true);
}
+// Assigns the pending request a new routing_id because it was transferred
+// to a new page.
+void ResourceDispatcherHost::OnTransferRequestToNewPage(int new_routing_id,
+ int request_id) {
+ PendingRequestList::iterator i = pending_requests_.find(
+ GlobalRequestID(filter_->child_id(), request_id));
+ if (i == pending_requests_.end()) {
+ // We probably want to remove this warning eventually, but I wanted to be
+ // able to notice when this happens during initial development since it
+ // should be rare and may indicate a bug.
+ DLOG(WARNING) << "Updating a request that wasn't found";
+ return;
+ }
+ net::URLRequest* request = i->second;
+ ResourceDispatcherHostRequestInfo* info = InfoForRequest(request);
+ info->set_route_id(new_routing_id);
+}
+
void ResourceDispatcherHost::OnFollowRedirect(
int request_id,
bool has_new_first_party_for_cookies,

Powered by Google App Engine
This is Rietveld 408576698