diff options
author | rdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-15 14:11:13 +0000 |
---|---|---|
committer | rdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-15 14:11:13 +0000 |
commit | ecb39230ec425c9f554c2e775499758e3b02204b (patch) | |
tree | e187a2dd03faf0c7d380bb302a799c352a4f8c50 /content/browser/loader/resource_dispatcher_host_impl.cc | |
parent | d527fcd87d3a42cfc9e873ee0d89376f929bae08 (diff) | |
download | chromium_src-ecb39230ec425c9f554c2e775499758e3b02204b.zip chromium_src-ecb39230ec425c9f554c2e775499758e3b02204b.tar.gz chromium_src-ecb39230ec425c9f554c2e775499758e3b02204b.tar.bz2 |
Make ResourceDispatcherHostImpl::CancelRequest() tear down the loader.
This matches the behavior of all the other CancelRequestsFor*() on
ResourceDispatcherHostImpl.
BUG=324525
R=darin@chromium.org
R=asanka@chromium.org
Review URL: https://codereview.chromium.org/103553004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244882 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/loader/resource_dispatcher_host_impl.cc')
-rw-r--r-- | content/browser/loader/resource_dispatcher_host_impl.cc | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc index 3153063..5dfc44f 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc @@ -1247,8 +1247,26 @@ void ResourceDispatcherHostImpl::OnUploadProgressACK(int request_id) { loader->OnUploadProgressACK(); } +// Note that this cancel is subtly different from the other +// CancelRequest methods in this file, which also tear down the loader. void ResourceDispatcherHostImpl::OnCancelRequest(int request_id) { - CancelRequest(filter_->child_id(), request_id, true); + int child_id = filter_->child_id(); + + // When the old renderer dies, it sends a message to us to cancel its + // requests. + if (IsTransferredNavigation(GlobalRequestID(child_id, 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"; + return; + } + + loader->CancelRequest(true); } ResourceRequestInfoImpl* ResourceDispatcherHostImpl::CreateRequestInfo( @@ -1502,15 +1520,7 @@ void ResourceDispatcherHostImpl::RemovePendingLoader( } void ResourceDispatcherHostImpl::CancelRequest(int child_id, - int request_id, - bool from_renderer) { - if (from_renderer) { - // When the old renderer dies, it sends a message to us to cancel its - // requests. - if (IsTransferredNavigation(GlobalRequestID(child_id, request_id))) - return; - } - + int request_id) { ResourceLoader* loader = GetLoader(child_id, request_id); if (!loader) { // We probably want to remove this warning eventually, but I wanted to be @@ -1520,7 +1530,7 @@ void ResourceDispatcherHostImpl::CancelRequest(int child_id, return; } - loader->CancelRequest(from_renderer); + RemovePendingRequest(child_id, request_id); } ResourceDispatcherHostImpl::OustandingRequestsStats |