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

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

Issue 2829163004: Remove uses of base::hash_map from //chrome (Closed)
Patch Set: Downloads back Created 3 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/renderer/safe_browsing/phishing_classifier.cc
diff --git a/chrome/renderer/safe_browsing/phishing_classifier.cc b/chrome/renderer/safe_browsing/phishing_classifier.cc
index d42f506723a3c0758d73025abdcdcfbc94cd188a..0eac4451879c13f116ecfff89dd20c09d94861fa 100644
--- a/chrome/renderer/safe_browsing/phishing_classifier.cc
+++ b/chrome/renderer/safe_browsing/phishing_classifier.cc
@@ -194,20 +194,17 @@ void PhishingClassifier::TermExtractionFinished(bool success) {
ClientPhishingRequest verdict;
verdict.set_model_version(scorer_->model_version());
verdict.set_url(main_frame->GetDocument().Url().GetString().Utf8());
- for (base::hash_map<std::string, double>::const_iterator it =
- features_->features().begin();
- it != features_->features().end(); ++it) {
- DVLOG(2) << "Feature: " << it->first << " = " << it->second;
+ for (const auto& it : features_->features()) {
+ DVLOG(2) << "Feature: " << it.first << " = " << it.second;
bool result = hashed_features.AddRealFeature(
- crypto::SHA256HashString(it->first), it->second);
+ crypto::SHA256HashString(it.first), it.second);
DCHECK(result);
ClientPhishingRequest::Feature* feature = verdict.add_feature_map();
- feature->set_name(it->first);
- feature->set_value(it->second);
+ feature->set_name(it.first);
+ feature->set_value(it.second);
}
- for (std::set<uint32_t>::const_iterator it = shingle_hashes_->begin();
- it != shingle_hashes_->end(); ++it) {
- verdict.add_shingle_hashes(*it);
+ for (const auto& it : *shingle_hashes_) {
+ verdict.add_shingle_hashes(it);
}
float score = static_cast<float>(scorer_->ComputeScore(hashed_features));
verdict.set_client_score(score);
« no previous file with comments | « chrome/renderer/safe_browsing/features.h ('k') | chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698