diff options
author | sergeygs@chromium.org <sergeygs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-27 14:33:59 +0000 |
---|---|---|
committer | sergeygs@chromium.org <sergeygs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-27 14:33:59 +0000 |
commit | 7098382b9d525021c59493b63f3cfe4bcb925355 (patch) | |
tree | b125debbe3319a8287800399c590fdeac4d957ef /content/browser/loader/resource_dispatcher_host_impl.cc | |
parent | f1d109f3b735b696cc5e539c8b585e8df2066cc7 (diff) | |
download | chromium_src-7098382b9d525021c59493b63f3cfe4bcb925355.zip chromium_src-7098382b9d525021c59493b63f3cfe4bcb925355.tar.gz chromium_src-7098382b9d525021c59493b63f3cfe4bcb925355.tar.bz2 |
Explicitly prevent URL-to-app redirection for forced downloads
There are 2 parts:
1) Replace ResourceRequestInfoImpl::is_download() with virtual ResourceRequestInfo::IsDownload().
2) Use it in app_url_redirector.cpp to explicitly avoid redirection of forced downloads.
@darin: In my testing, forced downloads were fine even without this (apparently, resource throttling is disabled in this case). Let me know if you still think explicit prevention is a good idea (I do think so).
BUG=302904
Review URL: https://codereview.chromium.org/62463004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237570 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 | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc index 5f6733d..84cfb57 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc @@ -429,7 +429,7 @@ void ResourceDispatcherHostImpl::CancelRequestsForContext( // 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() || + DCHECK((*i)->GetRequestInfo()->IsDownload() || (*i)->GetRequestInfo()->is_stream() || ((*i)->GetRequestInfo()->detachable_handler() && (*i)->GetRequestInfo()->detachable_handler()->is_detached()) || @@ -1387,10 +1387,9 @@ void ResourceDispatcherHostImpl::CancelRequestsForRoute(int child_id, // Don't cancel navigations that are expected to live beyond this process. if (IsTransferredNavigation(id)) any_requests_transferring = true; - if (info->detachable_handler()) { info->detachable_handler()->Detach(); - } else if (!info->is_download() && !info->is_stream() && + } else if (!info->IsDownload() && !info->is_stream() && !IsTransferredNavigation(id) && (route_id == -1 || route_id == info->GetRouteID())) { matching_requests.push_back(id); |