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

Unified Diff: chrome/common/safe_browsing/zip_analyzer.cc

Issue 1979153002: Use FileTypePolicies for is_archive and is_supported classifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@split_by_platform
Patch Set: Fix comment, per asanka's review Created 4 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 | « chrome/common/safe_browsing/file_type_policies_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/safe_browsing/zip_analyzer.cc
diff --git a/chrome/common/safe_browsing/zip_analyzer.cc b/chrome/common/safe_browsing/zip_analyzer.cc
index 9a4b9e8a847abf3cacb4608034ef6f655f136a75..b352ca339a73792689f5009ad80116bd8cbd1b3d 100644
--- a/chrome/common/safe_browsing/zip_analyzer.cc
+++ b/chrome/common/safe_browsing/zip_analyzer.cc
@@ -16,6 +16,7 @@
#include "chrome/common/safe_browsing/binary_feature_extractor.h"
#include "chrome/common/safe_browsing/csd.pb.h"
#include "chrome/common/safe_browsing/download_protection_util.h"
+#include "chrome/common/safe_browsing/file_type_policies.h"
#include "chrome/common/safe_browsing/zip_analyzer_results.h"
#include "crypto/secure_hash.h"
#include "crypto/sha2.h"
@@ -116,11 +117,11 @@ void AnalyzeZipFile(base::File zip_file,
continue;
}
const base::FilePath& file = reader.current_entry_info()->file_path();
- if (download_protection_util::IsArchiveFile(file)) {
+ if (FileTypePolicies::GetInstance()->IsArchiveFile(file)) {
DVLOG(2) << "Downloaded a zipped archive: " << file.value();
results->has_archive = true;
archived_archive_filenames.insert(file.BaseName());
- } else if (download_protection_util::IsSupportedBinaryFile(file)) {
+ } else if (FileTypePolicies::GetInstance()->IsCheckedBinaryFile(file)) {
DVLOG(2) << "Downloaded a zipped executable: " << file.value();
results->has_executable = true;
AnalyzeContainedFile(binary_feature_extractor, file, &reader, &temp_file,
« no previous file with comments | « chrome/common/safe_browsing/file_type_policies_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698