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

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

Issue 2696973002: Allow Safe Browsing backend to select downloads to upload. (Closed)
Patch Set: Switch histogram to use enum, per isherman Created 3 years, 10 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
Index: chrome/browser/safe_browsing/download_feedback_service.cc
diff --git a/chrome/browser/safe_browsing/download_feedback_service.cc b/chrome/browser/safe_browsing/download_feedback_service.cc
index 656c80402ce1ae8e200fe6a355bc33149169ce77..adebf92cbb9fffdccac79e6d0dbe97d6c64e79e9 100644
--- a/chrome/browser/safe_browsing/download_feedback_service.cc
+++ b/chrome/browser/safe_browsing/download_feedback_service.cc
@@ -91,19 +91,19 @@ DownloadFeedbackService::~DownloadFeedbackService() {
// static
void DownloadFeedbackService::MaybeStorePingsForDownload(
DownloadProtectionService::DownloadCheckResult result,
+ bool upload_requested,
content::DownloadItem* download,
const std::string& ping,
const std::string& response) {
- switch (result) {
- case DownloadProtectionService::UNKNOWN:
- case DownloadProtectionService::SAFE:
- case DownloadProtectionService::DANGEROUS:
- return;
- case DownloadProtectionService::UNCOMMON:
- case DownloadProtectionService::DANGEROUS_HOST:
- case DownloadProtectionService::POTENTIALLY_UNWANTED:
- break; // Fall through.
- }
+ // We never upload SAFE files.
+ if (result == DownloadProtectionService::SAFE)
+ return;
+
+ UMA_HISTOGRAM_BOOLEAN("SBDownloadFeedback.UploadRequestedByServer",
+ upload_requested);
+ if (!upload_requested)
+ return;
+
UMA_HISTOGRAM_COUNTS("SBDownloadFeedback.SizeEligibleKB",
download->GetReceivedBytes() / 1024);
if (download->GetReceivedBytes() > DownloadFeedback::kMaxUploadSize)

Powered by Google App Engine
This is Rietveld 408576698