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

Unified Diff: components/omnibox/browser/url_index_private_data.cc

Issue 2541143002: Omnibox - Boost Frequency Scores Based on Number of Matching Pages (Closed)
Patch Set: fix rebase errors Created 4 years 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 | « components/omnibox/browser/scored_history_match_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/browser/url_index_private_data.cc
diff --git a/components/omnibox/browser/url_index_private_data.cc b/components/omnibox/browser/url_index_private_data.cc
index d297b6442f395f547a2570a174220eca86a2b4f0..8088389cd365abc0af51a37e3658a86b14058399 100644
--- a/components/omnibox/browser/url_index_private_data.cc
+++ b/components/omnibox/browser/url_index_private_data.cc
@@ -715,13 +715,11 @@ void URLIndexPrivateData::HistoryIdSetToScoredMatches(
}
// Score the matches.
+ const size_t num_matches = history_id_set.size();
const base::Time now = base::Time::Now();
std::transform(
history_id_set.begin(), history_id_set.end(),
- std::back_inserter(*scored_items),
- [this, &lower_raw_string, &lower_raw_terms,
- &lower_terms_to_word_starts_offsets, &bookmark_model,
- &now](const HistoryID history_id) {
+ std::back_inserter(*scored_items), [&](const HistoryID history_id) {
auto hist_pos = history_info_map_.find(history_id);
const history::URLRow& hist_item = hist_pos->second.url_row;
auto starts_pos = word_starts_map_.find(history_id);
@@ -731,7 +729,7 @@ void URLIndexPrivateData::HistoryIdSetToScoredMatches(
lower_raw_terms, lower_terms_to_word_starts_offsets,
starts_pos->second,
bookmark_model && bookmark_model->IsBookmarked(hist_item.url()),
- now);
+ num_matches, now);
});
// Filter all matches that ended up scoring 0. (These are usually matches
« no previous file with comments | « components/omnibox/browser/scored_history_match_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698