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

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

Issue 1819503002: Separate SBClientDownload.SignedOrWhitelistedDownload metric into two buckets, (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update histogram description Created 4 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..08c1ff2b7c77c5ba8ff4f5d4b30ec818e2b8a666 100644
--- a/chrome/browser/safe_browsing/download_protection_service.cc
+++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -669,8 +669,17 @@ class DownloadProtectionService::CheckClientDownloadRequest
}
#endif // defined(OS_MACOSX)
- static void RecordCountOfSignedOrWhitelistedDownload() {
- UMA_HISTOGRAM_COUNTS("SBClientDownload.SignedOrWhitelistedDownload", 1);
+ enum WhitelistType {
+ NO_WHITELIST_MATCH,
+ URL_WHITELIST,
+ SIGNATURE_WHITELIST,
+ WHITELIST_TYPE_MAX
+ };
+
+ static void RecordCountOfWhitelistedDownload(WhitelistType type) {
+ UMA_HISTOGRAM_ENUMERATION("SBClientDownload.CheckWhitelistResult",
+ type,
+ WHITELIST_TYPE_MAX);
}
void CheckWhitelists() {
@@ -685,7 +694,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,10 +703,10 @@ class DownloadProtectionService::CheckClientDownloadRequest
}
if (signature_info_.trusted()) {
- RecordCountOfSignedOrWhitelistedDownload();
for (int i = 0; i < signature_info_.certificate_chain_size(); ++i) {
if (CertificateChainIsWhitelisted(
signature_info_.certificate_chain(i))) {
+ RecordCountOfWhitelistedDownload(SIGNATURE_WHITELIST);
// TODO(grt): Continue processing without uploading so that
// ClientDownloadRequest callbacks can be run even for this type of
// safe download.
@@ -707,17 +716,19 @@ class DownloadProtectionService::CheckClientDownloadRequest
}
}
+ RecordCountOfWhitelistedDownload(NO_WHITELIST_MATCH);
+
if (!pingback_enabled_) {
PostFinishTask(UNKNOWN, REASON_PING_DISABLED);
return;
}
- // The URLFetcher is owned by the UI thread, so post a message to
- // start the pingback.
- BrowserThread::PostTask(
- BrowserThread::UI,
- FROM_HERE,
- base::Bind(&CheckClientDownloadRequest::GetTabRedirects, this));
+ // The URLFetcher is owned by the UI thread, so post a message to
+ // start the pingback.
+ BrowserThread::PostTask(
+ BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(&CheckClientDownloadRequest::GetTabRedirects, this));
}
void GetTabRedirects() {
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698