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

Unified Diff: content/browser/download/download_stats.cc

Issue 14947007: [Downloads] Allow acquiring dangerous download file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 7 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 | « content/browser/download/download_stats.h ('k') | content/public/browser/download_item.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_stats.cc
diff --git a/content/browser/download/download_stats.cc b/content/browser/download/download_stats.cc
index e13200e57b4a8de0914ae1b16b65121287e79d74..347f59250a6861155c3d0833f487fc5284ec0492 100644
--- a/content/browser/download/download_stats.cc
+++ b/content/browser/download/download_stats.cc
@@ -145,6 +145,28 @@ void RecordDownloadInterrupted(DownloadInterruptReason reason,
UMA_HISTOGRAM_BOOLEAN("Download.InterruptedUnknownSize", unknown_size);
}
+void RecordDangerousDownloadAccept(DownloadDangerType danger_type) {
+ UMA_HISTOGRAM_ENUMERATION("Download.DangerousDownloadValidated",
+ danger_type,
+ DOWNLOAD_DANGER_TYPE_MAX);
+}
+
+void RecordDangerousDownloadDiscard(DownloadDiscardReason reason,
+ DownloadDangerType danger_type) {
+ switch (reason) {
+ case DOWNLOAD_DISCARD_DUE_TO_USER_ACTION:
+ UMA_HISTOGRAM_ENUMERATION(
+ "Download.UserDiscard", danger_type, DOWNLOAD_DANGER_TYPE_MAX);
+ break;
+ case DOWNLOAD_DISCARD_DUE_TO_SHUTDOWN:
+ UMA_HISTOGRAM_ENUMERATION(
+ "Download.Discard", danger_type, DOWNLOAD_DANGER_TYPE_MAX);
+ break;
+ default:
+ NOTREACHED();
+ }
+}
+
void RecordDownloadWriteSize(size_t data_len) {
RecordDownloadCount(WRITE_SIZE_COUNT);
int max = 1024 * 1024; // One Megabyte.
« no previous file with comments | « content/browser/download/download_stats.h ('k') | content/public/browser/download_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698