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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2303733004: Eliminate spurious request cancelations (Closed)
Patch Set: Fixed dispatcher unit test Created 4 years, 3 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 | « no previous file | content/child/resource_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 1fbd0004096973802910cea4abca6b3ca02c09bd..6e53b68fbbfeb4788b9a92adba5a1bc91ec134df 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1762,13 +1762,13 @@ void ResourceDispatcherHostImpl::OnCancelRequest(int request_id) {
return;
ResourceLoader* loader = GetLoader(child_id, request_id);
- if (!loader) {
- // 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.
- DVLOG(1) << "Canceling a request that wasn't found";
+
+ // It is possible that the request has been completed and removed from the
+ // loader queue but the client has not processed the request completed message
+ // before issuing a cancel. This happens frequently for beacons which are
+ // canceled in the response received handler.
+ if (!loader)
return;
- }
loader->CancelRequest(true);
}
« no previous file with comments | « no previous file | content/child/resource_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698