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

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

Issue 2541543002: 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 | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_handle_impl.cc
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc
index f2b2f133ddb19e898c42a356464ef428bd77a875..ae9e5dbe57a7670f7f2835d180ace81f6c679869 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -13,6 +13,7 @@
#include "content/browser/frame_host/frame_tree_node.h"
#include "content/browser/frame_host/navigator.h"
#include "content/browser/frame_host/navigator_delegate.h"
+#include "content/browser/loader/resource_dispatcher_host_impl.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_navigation_handle.h"
#include "content/common/frame_messages.h"
@@ -38,6 +39,12 @@ void UpdateThrottleCheckResult(
*to_update = result;
}
+void NotifyAbandonedTransferNavigation(const GlobalRequestID& id) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ if (ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get())
+ rdh->CancelRequest(id.child_id, id.request_id);
+}
+
} // namespace
// static
@@ -105,6 +112,15 @@ NavigationHandleImpl::NavigationHandleImpl(
}
NavigationHandleImpl::~NavigationHandleImpl() {
+ // Transfer requests that have not matched up with another navigation request
+ // from the renderer need to be cleaned up. These are marked as protected in
+ // the RDHI, so they do not get cancelled when frames are destroyed.
+ if (is_transferring()) {
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&NotifyAbandonedTransferNavigation, GetGlobalRequestID()));
+ }
+
if (!IsRendererDebugURL(url_))
GetDelegate()->DidFinishNavigation(this);
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698