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

Unified Diff: chrome/browser/android/offline_pages/downloads/resource_throttle.cc

Issue 2836163003: Stop offline page resource throttle from intercepting non http(s) urls (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/offline_pages/downloads/resource_throttle.cc
diff --git a/chrome/browser/android/offline_pages/downloads/resource_throttle.cc b/chrome/browser/android/offline_pages/downloads/resource_throttle.cc
index a09b33c4abf26c70f13b2834710a8b659e385148..d4d1d60d189fe0a32ff6c606a85575fd26de8893 100644
--- a/chrome/browser/android/offline_pages/downloads/resource_throttle.cc
+++ b/chrome/browser/android/offline_pages/downloads/resource_throttle.cc
@@ -47,8 +47,16 @@ ResourceThrottle::~ResourceThrottle() {
void ResourceThrottle::WillProcessResponse(bool* defer) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
+
+ if (request_->url_chain().empty())
Dmitry Titov 2017/04/25 07:03:01 URLRequest is constructed with at least one URL, t
qinmin 2017/04/25 18:52:45 Done.
+ return;
+ GURL url = request_->url_chain().back();
+ if (!url.SchemeIsHTTPOrHTTPS())
+ return;
+
std::string mime_type;
request_->GetMimeType(&mime_type);
+
if (CanDownloadAsOfflinePage(mime_type)) {
David Trainor- moved to gerrit 2017/04/25 03:31:16 Would it be cleaner to bake that into CanDownloadA
Dmitry Titov 2017/04/25 07:03:01 +1, good suggestion.
qinmin 2017/04/25 18:52:45 Done.
const content::ResourceRequestInfo* info =
content::ResourceRequestInfo::ForRequest(request_);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698