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> |