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

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

Issue 2776793002: Make flat containers stable, allow constructing from vector. (Closed)
Patch Set: Put back media log change lost in merge Created 3 years, 8 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 | « components/omnibox/browser/in_memory_url_index_types.cc ('k') | media/base/media_log.cc » ('j') | 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 0ba1bbecc29e1c3ab38e385e3a921ec4b1b9431c..b9f2a93ea945bc2e73e33afdb396d0bd0ef8a975 100644
--- a/components/omnibox/browser/url_index_private_data.cc
+++ b/components/omnibox/browser/url_index_private_data.cc
@@ -599,7 +599,8 @@ HistoryIDSet URLIndexPrivateData::HistoryIDsForTerm(
word_history_id_set.end());
}
}
- HistoryIDSet history_id_set(buffer.begin(), buffer.end());
+ HistoryIDSet history_id_set(buffer.begin(), buffer.end(),
+ base::KEEP_FIRST_OF_DUPES);
// Record a new cache entry for this word if the term is longer than
// a single character.
@@ -1089,7 +1090,8 @@ bool URLIndexPrivateData::RestoreCharWordMap(
return false;
base::char16 uni_char = static_cast<base::char16>(entry.char_16());
const RepeatedField<int32_t>& word_ids = entry.word_id();
- char_word_map_[uni_char] = {word_ids.begin(), word_ids.end()};
+ char_word_map_[uni_char] =
+ WordIDSet(word_ids.begin(), word_ids.end(), base::KEEP_FIRST_OF_DUPES);
}
return true;
}
@@ -1110,7 +1112,8 @@ bool URLIndexPrivateData::RestoreWordIDHistoryMap(
return false;
WordID word_id = entry.word_id();
const RepeatedField<int64_t>& history_ids = entry.history_id();
- word_id_history_map_[word_id] = {history_ids.begin(), history_ids.end()};
+ word_id_history_map_[word_id] = HistoryIDSet(
+ history_ids.begin(), history_ids.end(), base::KEEP_FIRST_OF_DUPES);
for (HistoryID history_id : history_ids)
history_id_word_map_[history_id].insert(word_id);
}
« no previous file with comments | « components/omnibox/browser/in_memory_url_index_types.cc ('k') | media/base/media_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698