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

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

Issue 1262753002: [SafeBrowsing] Send pings for Zip files that contain other archives. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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_protection_service.cc
diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc
index 58f9e89d2f17b9c9c52be9cb92ae00e560d85119..4f111952af9e8b744b6b71bf73c0edd4a01e1555 100644
--- a/chrome/browser/safe_browsing/download_protection_service.cc
+++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -321,6 +321,7 @@ class DownloadProtectionService::CheckClientDownloadRequest
tab_url_(item->GetTabUrl()),
tab_referrer_url_(item->GetTabReferrerUrl()),
zipped_executable_(false),
+ zipped_archive_(false),
callback_(callback),
service_(service),
binary_feature_extractor_(binary_feature_extractor),
@@ -601,10 +602,12 @@ class DownloadProtectionService::CheckClientDownloadRequest
void OnZipAnalysisFinished(const zip_analyzer::Results& results) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ DCHECK_EQ(ClientDownloadRequest::ZIPPED_EXECUTABLE, type_);
if (!service_)
return;
if (results.success) {
zipped_executable_ = results.has_executable;
+ zipped_archive_ = results.has_archive;
archived_binary_.CopyFrom(results.archived_binary);
DVLOG(1) << "Zip analysis finished for " << item_->GetFullPath().value()
<< ", has_executable=" << results.has_executable
@@ -615,14 +618,16 @@ class DownloadProtectionService::CheckClientDownloadRequest
UMA_HISTOGRAM_BOOLEAN("SBClientDownload.ZipFileHasExecutable",
zipped_executable_);
UMA_HISTOGRAM_BOOLEAN("SBClientDownload.ZipFileHasArchiveButNoExecutable",
- results.has_archive && !zipped_executable_);
+ zipped_archive_ && !zipped_executable_);
UMA_HISTOGRAM_TIMES("SBClientDownload.ExtractZipFeaturesTime",
base::TimeTicks::Now() - zip_analysis_start_time_);
- if (!zipped_executable_) {
+ if (!zipped_executable_ && !zipped_archive_) {
PostFinishTask(UNKNOWN, REASON_ARCHIVE_WITHOUT_BINARIES);
return;
}
+ if (!zipped_executable_ && zipped_archive_)
+ type_ = ClientDownloadRequest::ZIPPED_ARCHIVE;
OnFileFeatureExtractionDone();
}
@@ -912,6 +917,7 @@ class DownloadProtectionService::CheckClientDownloadRequest
GURL tab_referrer_url_;
bool zipped_executable_;
+ bool zipped_archive_;
ClientDownloadRequest_SignatureInfo signature_info_;
scoped_ptr<ClientDownloadRequest_ImageHeaders> image_headers_;
google::protobuf::RepeatedPtrField<ClientDownloadRequest_ArchivedBinary>

Powered by Google App Engine
This is Rietveld 408576698