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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2508973006: Kill vestigial transfer requests (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 1e0a5f400a3e0047253f150f9aaa62def2b6ca7d..b0521ed1daeb3e6af425e05e9dc561befe89ea39 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -198,10 +198,18 @@ void GrantFileAccess(int child_id,
}
}
-void NotifyRenderFrameDetachedOnIO(int render_process_id, int render_frame_id) {
+void NotifyRenderFrameDetachedOnIO(int render_process_id,
+ int render_frame_id,
+ GlobalRequestID transfer_request_id) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
SharedWorkerServiceImpl::GetInstance()->RenderFrameDetached(render_process_id,
render_frame_id);
+ if (transfer_request_id.child_id != -1) {
Charlie Reis 2016/11/18 04:52:24 Let's add a comment saying that we need to clean u
+ ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get();
+ DCHECK(rdh);
+ rdh->CancelRequest(transfer_request_id.child_id,
+ transfer_request_id.request_id);
+ }
}
} // namespace
@@ -355,9 +363,15 @@ RenderFrameHostImpl::~RenderFrameHostImpl() {
GetProcess()->RemoveRoute(routing_id_);
g_routing_id_frame_map.Get().erase(
RenderFrameHostID(GetProcess()->GetID(), routing_id_));
+
+ GlobalRequestID transfer_navigation_id;
+ if (navigation_handle_ && navigation_handle_->is_transferring()) {
+ transfer_navigation_id = navigation_handle_->GetGlobalRequestID();
+ }
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&NotifyRenderFrameDetachedOnIO,
- GetProcess()->GetID(), routing_id_));
+ GetProcess()->GetID(), routing_id_,
+ transfer_navigation_id));
site_instance_->RemoveObserver(this);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698