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 71c81a77018e278f0e573d4c045737ab2a929b3a..11bc6652e5b894dbba3be4411d3e6f40ab34282a 100644 |
| --- a/chrome/browser/safe_browsing/download_protection_service.cc |
| +++ b/chrome/browser/safe_browsing/download_protection_service.cc |
| @@ -669,8 +669,16 @@ class DownloadProtectionService::CheckClientDownloadRequest |
| } |
| #endif // defined(OS_MACOSX) |
| - static void RecordCountOfSignedOrWhitelistedDownload() { |
| - UMA_HISTOGRAM_COUNTS("SBClientDownload.SignedOrWhitelistedDownload", 1); |
| + enum WhitelistType { |
| + URL_WHITELIST, |
| + SIGNATURE_WHITELIST, |
| + WHITELIST_TYPE_MAX |
| + }; |
| + |
| + static void RecordCountOfWhitelistedDownload(WhitelistType type) { |
| + UMA_HISTOGRAM_ENUMERATION("SBClientDownload.WhitelistedDownload", |
| + type, |
| + WHITELIST_TYPE_MAX); |
| } |
| void CheckWhitelists() { |
| @@ -685,7 +693,7 @@ class DownloadProtectionService::CheckClientDownloadRequest |
| // TODO(asanka): This may acquire a lock on the SB DB on the IO thread. |
| if (url.is_valid() && database_manager_->MatchDownloadWhitelistUrl(url)) { |
| DVLOG(2) << url << " is on the download whitelist."; |
| - RecordCountOfSignedOrWhitelistedDownload(); |
| + RecordCountOfWhitelistedDownload(URL_WHITELIST); |
| // TODO(grt): Continue processing without uploading so that |
| // ClientDownloadRequest callbacks can be run even for this type of safe |
| // download. |
| @@ -694,7 +702,7 @@ class DownloadProtectionService::CheckClientDownloadRequest |
| } |
| if (signature_info_.trusted()) { |
| - RecordCountOfSignedOrWhitelistedDownload(); |
| + RecordCountOfWhitelistedDownload(SIGNATURE_WHITELIST); |
|
mattm
2016/03/18 22:44:05
This needs to go inside the "if CertificateChainIs
Jialiu Lin
2016/03/18 23:02:27
Nice catch! I was blindly following.... haha
|
| for (int i = 0; i < signature_info_.certificate_chain_size(); ++i) { |
| if (CertificateChainIsWhitelisted( |
| signature_info_.certificate_chain(i))) { |