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

Unified Diff: chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc

Issue 2772853002: Fix an issue that OMA download is not intercepted on Android (Closed)
Patch Set: Created 3 years, 9 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 | « chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
index 0ddcbdb3c45b0666edd2a90a5135fac4c72cf7b5..ecc07c0b3e8ccbf793657a32b8fcb8e336906570 100644
--- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
@@ -562,14 +562,21 @@ void ChromeResourceDispatcherHostDelegate::DownloadStarting(
content::RESOURCE_TYPE_MAIN_FRAME,
throttles);
#if defined(OS_ANDROID)
- throttles->push_back(
- base::MakeUnique<InterceptDownloadResourceThrottle>(
- request, info->GetWebContentsGetterForRequest()));
// On Android, forward text/html downloads to OfflinePages backend.
throttles->push_back(
base::MakeUnique<offline_pages::downloads::ResourceThrottle>(request));
#endif
}
+
+#if defined(OS_ANDROID)
+ // Add the InterceptDownloadResourceThrottle after calling
+ // AppendStandardResourceThrottles so the download will not bypass
+ // safebrowsing checks.
+ if (is_content_initiated) {
+ throttles->push_back(base::MakeUnique<InterceptDownloadResourceThrottle>(
+ request, info->GetWebContentsGetterForRequest()));
+ }
+#endif
}
ResourceDispatcherHostLoginDelegate*
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698