diff options
author | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-03 05:29:48 +0000 |
---|---|---|
committer | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-03 05:29:48 +0000 |
commit | b65871b78901b3e19e5ab1539492112e9ae9e7bc (patch) | |
tree | a37a5e3d47c25d621ede6ba92b1774cb3d8cf7c2 /content/browser/loader/resource_dispatcher_host_impl.cc | |
parent | 24ee99a93ec52e0e82a2f8e75dc87e65f46b54a6 (diff) | |
download | chromium_src-b65871b78901b3e19e5ab1539492112e9ae9e7bc.zip chromium_src-b65871b78901b3e19e5ab1539492112e9ae9e7bc.tar.gz chromium_src-b65871b78901b3e19e5ab1539492112e9ae9e7bc.tar.bz2 |
Don't cancel Requests that are owned by streams.
Once a request is redirected to a Stream, its lifetime should be controlled by the Stream object instead of the renderer that created it. Currently, the stream will be closed if the user navigates elsewhere in the tab that created it. This patch changes it to behave like Downloads currently do, and persist until completed or cancelled.
BUG=225604
Review URL: https://chromiumcodereview.appspot.com/13441003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191995 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 | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc index 3b44a0e..d69582e 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc @@ -414,11 +414,13 @@ void ResourceDispatcherHostImpl::CancelRequestsForContext( for (LoaderList::iterator i = loaders_to_cancel.begin(); i != loaders_to_cancel.end(); ++i) { // There is no strict requirement that this be the case, but currently - // downloads and transferred requests are the only requests that aren't - // cancelled when the associated processes go away. It may be OK for this - // invariant to change in the future, but if this assertion fires without - // the invariant changing, then it's indicative of a leak. - DCHECK((*i)->GetRequestInfo()->is_download() || (*i)->is_transferring()); + // downloads, streams and transferred requests are the only requests that + // aren't cancelled when the associated processes go away. It may be OK for + // this invariant to change in the future, but if this assertion fires + // without the invariant changing, then it's indicative of a leak. + DCHECK((*i)->GetRequestInfo()->is_download() || + (*i)->GetRequestInfo()->is_stream() || + (*i)->is_transferring()); } #endif @@ -1324,7 +1326,8 @@ void ResourceDispatcherHostImpl::CancelRequestsForRoute(int child_id, // Don't cancel navigations that are transferring to another process, // since they belong to another process now. - if (!info->is_download() && !IsTransferredNavigation(id) && + if (!info->is_download() && !info->is_stream() && + !IsTransferredNavigation(id) && (route_id == -1 || route_id == info->GetRouteID())) { matching_requests.push_back(id); } |