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

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

Issue 1827303002: Report and parse .img, .iso, and .smi as DMGs when downloading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix namespacing 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 | chrome/common/safe_browsing/download_protection_util.cc » ('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 7a546441f2c9644080256bb22431c3bcf73fcbb2..6a1ff000b0780116fb814d82e27fe5af32e3ab56 100644
--- a/chrome/browser/safe_browsing/download_protection_service.cc
+++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -335,7 +335,13 @@ class DownloadProtectionService::CheckClientDownloadRequest
StartExtractZipFeatures();
#if defined(OS_MACOSX)
} else if (item_->GetTargetFilePath().MatchesExtension(
- FILE_PATH_LITERAL(".dmg"))) {
+ FILE_PATH_LITERAL(".dmg")) ||
+ item_->GetTargetFilePath().MatchesExtension(
+ FILE_PATH_LITERAL(".img")) ||
+ item_->GetTargetFilePath().MatchesExtension(
+ FILE_PATH_LITERAL(".iso")) ||
+ item_->GetTargetFilePath().MatchesExtension(
+ FILE_PATH_LITERAL(".smi"))) {
StartExtractDmgFeatures();
#endif
} else {
@@ -625,6 +631,8 @@ class DownloadProtectionService::CheckClientDownloadRequest
}
#if defined(OS_MACOSX)
+ // This is called for .DMGs and other files that can be parsed by
+ // SandboxedDMGAnalyzer.
void StartExtractDmgFeatures() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(item_);
@@ -651,9 +659,26 @@ class DownloadProtectionService::CheckClientDownloadRequest
<< ", has_executable=" << results.has_executable
<< ", success=" << results.success;
- UMA_HISTOGRAM_BOOLEAN("SBClientDownload.DmgFileSuccess", results.success);
- UMA_HISTOGRAM_BOOLEAN("SBClientDownload.DmgFileHasExecutable",
- archived_executable_);
+ int uma_file_type =
+ download_protection_util::GetSBClientDownloadExtensionValueForUMA(
+ item_->GetTargetFilePath());
+
+ if (results.success) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY("SBClientDownload.DmgFileSuccessByType",
+ uma_file_type);
+ } else {
+ UMA_HISTOGRAM_SPARSE_SLOWLY("SBClientDownload.DmgFileFailureByType",
+ uma_file_type);
+ }
+
+ if (archived_executable_) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY("SBClientDownload.DmgFileHasExecutableByType",
+ uma_file_type);
+ } else {
+ UMA_HISTOGRAM_SPARSE_SLOWLY(
+ "SBClientDownload.DmgFileHasNoExecutableByType", uma_file_type);
+ }
+
UMA_HISTOGRAM_TIMES("SBClientDownload.ExtractDmgFeaturesTime",
base::TimeTicks::Now() - dmg_analysis_start_time_);
« no previous file with comments | « no previous file | chrome/common/safe_browsing/download_protection_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698