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

Unified Diff: chrome/browser/safe_browsing/download_protection_service.cc

Issue 750773003: Safebrowsing download protection: also check blob URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
Index: chrome/browser/safe_browsing/download_protection_service.cc
diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc
index 30f2523adcc4a3b1dee68117ff172c565c557bdc..c8f2e7ffdda87f11caeae3bfb15ca9e6205951cb 100644
--- a/chrome/browser/safe_browsing/download_protection_service.cc
+++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -312,6 +312,7 @@ class DownloadProtectionService::CheckClientDownloadRequest
switch (reason) {
case REASON_EMPTY_URL_CHAIN:
case REASON_INVALID_URL:
+ case REASON_UNSUPPORTED_URL_SCHEME:
PostFinishTask(UNKNOWN, reason);
return;
@@ -462,11 +463,15 @@ class DownloadProtectionService::CheckClientDownloadRequest
return false;
}
const GURL& final_url = item.GetUrlChain().back();
- if (!final_url.is_valid() || final_url.is_empty() ||
- !final_url.IsStandard() || final_url.SchemeIsFile()) {
+ if (!final_url.is_valid() || final_url.is_empty()) {
*reason = REASON_INVALID_URL;
return false;
}
+ if ((!final_url.IsStandard() && !final_url.SchemeIsBlob()) ||
+ final_url.SchemeIsFile()) {
+ *reason = REASON_UNSUPPORTED_URL_SCHEME;
noé 2014/12/03 00:56:40 What other schemes are there? Just curious.
+ return false;
+ }
if (!download_protection_util::IsBinaryFile(target_path)) {
*reason = REASON_NOT_BINARY_FILE;
return false;

Powered by Google App Engine
This is Rietveld 408576698