Commit 2ba496e5 authored by Daniel Rubery's avatar Daniel Rubery Committed by Commit Bot

Add metric for file types download within archives

One of the considerations for whether to send download pings for a given
file type is how often that file type is downloaded, as recorded by
SBClientDownload.DownloadExtensions. But we also send download pings for
archives containing dangerous file types, so we should record how often
that is occurring as well. This CL adds a metric to do that.

Bug: 1048215
Change-Id: If897244cf5954844ac51e0ce86bafb89a17a26e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2036210Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Commit-Queue: Daniel Rubery <drubery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738022}
parent 1034fe3b
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/files/file.h" #include "base/files/file.h"
#include "base/i18n/streaming_utf8_validator.h" #include "base/i18n/streaming_utf8_validator.h"
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/common/safe_browsing/archive_analyzer_results.h" #include "chrome/common/safe_browsing/archive_analyzer_results.h"
...@@ -177,6 +178,10 @@ void UpdateArchiveAnalyzerResultsWithFile(base::FilePath path, ...@@ -177,6 +178,10 @@ void UpdateArchiveAnalyzerResultsWithFile(base::FilePath path,
} else { } else {
DVLOG(3) << "Ignoring non-binary file: " << path.value(); DVLOG(3) << "Ignoring non-binary file: " << path.value();
} }
base::UmaHistogramSparse(
"SBClientDownload.ArchiveDownloadExtensions",
FileTypePolicies::GetInstance()->UmaValueForFile(path));
} }
} // namespace safe_browsing } // namespace safe_browsing
...@@ -133834,6 +133834,16 @@ Safe Browsing lookups, which is critical for security. --> ...@@ -133834,6 +133834,16 @@ Safe Browsing lookups, which is critical for security. -->
</summary> </summary>
</histogram> </histogram>
<histogram name="SBClientDownload.ArchiveDownloadExtensions"
enum="SBClientDownloadExtensions" expires_after="2020-05-31">
<owner>drubery@chromium.org</owner>
<owner>chrome-safebrowsing-alerts@google.com</owner>
<summary>
Records a histogram of how often users download a file with a possibly
dangerous file extension (e.g., exe, class) within an archive.
</summary>
</histogram>
<histogram name="SBClientDownload.CheckDownloadStats" <histogram name="SBClientDownload.CheckDownloadStats"
enum="SBClientDownloadCheckDownloadStats" expires_after="2020-05-31"> enum="SBClientDownloadCheckDownloadStats" expires_after="2020-05-31">
<owner>vakh@chromium.org</owner> <owner>vakh@chromium.org</owner>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment