diff options
Diffstat (limited to 'chromium/content/browser/loader/navigation_url_loader_impl.cc')
-rw-r--r-- | chromium/content/browser/loader/navigation_url_loader_impl.cc | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/chromium/content/browser/loader/navigation_url_loader_impl.cc b/chromium/content/browser/loader/navigation_url_loader_impl.cc index 3d6c804d28e..1341eba3b01 100644 --- a/chromium/content/browser/loader/navigation_url_loader_impl.cc +++ b/chromium/content/browser/loader/navigation_url_loader_impl.cc @@ -4,7 +4,9 @@ #include "content/browser/loader/navigation_url_loader_impl.h" +#include <map> #include <memory> +#include <set> #include <utility> #include "base/bind.h" @@ -307,21 +309,6 @@ void UnknownSchemeCallback( handled_externally ? net::ERR_ABORTED : net::ERR_UNKNOWN_URL_SCHEME)); } -// Determines whether it is safe to redirect from |from_url| to |to_url|. -bool IsRedirectSafe(const GURL& from_url, - const GURL& to_url, - BrowserContext* browser_context, - ResourceContext* resource_context) { - if (NavigationURLLoaderImpl::IsNavigationLoaderOnUIEnabled()) { - return IsSafeRedirectTarget(from_url, to_url) && - GetContentClient()->browser()->IsSafeRedirectTarget(to_url, - browser_context); - } - return IsSafeRedirectTarget(from_url, to_url) && - GetContentClient()->browser()->IsSafeRedirectTargetOnIO( - to_url, resource_context); -} - // Runs |task| on the thread specified by |thread_id| if already on that thread, // otherwise posts a task to that thread. void RunOrPostTaskIfNecessary(const base::Location& from_here, @@ -1366,8 +1353,7 @@ class NavigationURLLoaderImpl::URLLoaderRequestController const network::ResourceResponseHead& head) override { if (base::FeatureList::IsEnabled(network::features::kNetworkService) && !bypass_redirect_checks_ && - !IsRedirectSafe(url_, redirect_info.new_url, browser_context_, - resource_context_)) { + !IsSafeRedirectTarget(url_, redirect_info.new_url)) { // Call CancelWithError instead of OnComplete so that if there is an // intercepting URLLoaderFactory (created through the embedder's // ContentBrowserClient::WillCreateURLLoaderFactory) it gets notified. |