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

Unified Diff: chrome/renderer/safe_browsing/scorer.cc

Issue 7866011: Switch to the new client-side phishing model that uses Murmurhash for word hashes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile problems and add another test Created 9 years, 3 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/renderer/safe_browsing/scorer.h ('k') | chrome/renderer/safe_browsing/scorer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/safe_browsing/scorer.cc
diff --git a/chrome/renderer/safe_browsing/scorer.cc b/chrome/renderer/safe_browsing/scorer.cc
index 6a8eaaf9cd4f309cae568305b89ccc844d8fdfab..e56bc39229235f210eced96437fa350cf59c7153 100644
--- a/chrome/renderer/safe_browsing/scorer.cc
+++ b/chrome/renderer/safe_browsing/scorer.cc
@@ -70,7 +70,7 @@ Scorer* Scorer::Create(const base::StringPiece& model_str) {
scorer->page_terms_.insert(model.hashes(model.page_term(i)));
}
for (int i = 0; i < model.page_word_size(); ++i) {
- scorer->page_words_.insert(model.hashes(model.page_word(i)));
+ scorer->page_words_.insert(model.page_word(i));
}
return scorer.release();
}
@@ -91,7 +91,7 @@ const base::hash_set<std::string>& Scorer::page_terms() const {
return page_terms_;
}
-const base::hash_set<std::string>& Scorer::page_words() const {
+const base::hash_set<uint32>& Scorer::page_words() const {
return page_words_;
}
@@ -99,6 +99,10 @@ size_t Scorer::max_words_per_term() const {
return model_.max_words_per_term();
}
+uint32 Scorer::murmurhash3_seed() const {
+ return model_.murmur_hash_seed();
+}
+
double Scorer::ComputeRuleScore(const ClientSideModel::Rule& rule,
const FeatureMap& features) const {
const base::hash_map<std::string, double>& feature_map = features.features();
« no previous file with comments | « chrome/renderer/safe_browsing/scorer.h ('k') | chrome/renderer/safe_browsing/scorer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698