Chromium Code Reviews| 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; |