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

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

Issue 337723004: [Safe browsing] Clean up code to scan hash results for threats. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/safe_browsing_util.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_util.cc b/chrome/browser/safe_browsing/safe_browsing_util.cc
index be5748489931d94b8b10bd62528376177dcd9b60..799be07e8ce0c61c05b40f9c712f36855a993bc5 100644
--- a/chrome/browser/safe_browsing/safe_browsing_util.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_util.cc
@@ -465,32 +465,6 @@ void GeneratePatternsToCheck(const GURL& url, std::vector<std::string>* urls) {
}
}
-int GetHashIndex(const SBFullHash& hash,
- const std::vector<SBFullHashResult>& full_hashes) {
- for (size_t i = 0; i < full_hashes.size(); ++i) {
- if (SBFullHashEqual(hash, full_hashes[i].hash))
- return static_cast<int>(i);
- }
- return -1;
-}
-
-int GetUrlHashIndex(const GURL& url,
- const std::vector<SBFullHashResult>& full_hashes) {
- if (full_hashes.empty())
- return -1;
-
- std::vector<std::string> patterns;
- GeneratePatternsToCheck(url, &patterns);
-
- for (size_t i = 0; i < patterns.size(); ++i) {
- SBFullHash key = SBFullHashForString(patterns[i]);
- int index = GetHashIndex(key, full_hashes);
- if (index != -1)
- return index;
- }
- return -1;
-}
-
GURL GeneratePhishingReportUrl(const std::string& report_page,
const std::string& url_to_report,
bool is_client_side_detection) {
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_util.h ('k') | chrome/browser/safe_browsing/safe_browsing_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698