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 6ca56db8c245fcce787c720aeaa98eb36e788d4b..6caab4b391cc55bfb73f005f85a0d4ad01efc68c 100644 |
--- a/components/omnibox/browser/url_index_private_data.cc |
+++ b/components/omnibox/browser/url_index_private_data.cc |
@@ -278,7 +278,7 @@ ScoredHistoryMatches URLIndexPrivateData::HistoryItemsForTerms( |
for (SearchTermCacheMap::iterator cache_iter = search_term_cache_.begin(); |
cache_iter != search_term_cache_.end(); ) { |
if (!cache_iter->second.used_) |
- search_term_cache_.erase(cache_iter++); |
+ cache_iter = search_term_cache_.erase(cache_iter); |
else |
++cache_iter; |
} |
@@ -630,7 +630,7 @@ HistoryIDSet URLIndexPrivateData::HistoryIDsForTerm( |
for (WordIDSet::iterator word_set_iter = word_id_set.begin(); |
word_set_iter != word_id_set.end(); ) { |
if (word_list_[*word_set_iter].find(term) == base::string16::npos) |
- word_id_set.erase(word_set_iter++); |
+ word_set_iter = word_id_set.erase(word_set_iter); |
else |
++word_set_iter; |
} |
@@ -642,14 +642,15 @@ HistoryIDSet URLIndexPrivateData::HistoryIDsForTerm( |
// the sets from each word. |
HistoryIDSet history_id_set; |
if (!word_id_set.empty()) { |
+ auto unsafe = history_id_set.unsafe_access(); |
dyaroshev
2016/09/13 12:28:13
Here is the tight spot I was talking about in chro
|
for (WordIDSet::iterator word_id_iter = word_id_set.begin(); |
word_id_iter != word_id_set.end(); ++word_id_iter) { |
WordID word_id = *word_id_iter; |
WordIDHistoryMap::iterator word_iter = word_id_history_map_.find(word_id); |
if (word_iter != word_id_history_map_.end()) { |
HistoryIDSet& word_history_id_set(word_iter->second); |
- history_id_set.insert(word_history_id_set.begin(), |
- word_history_id_set.end()); |
+ unsafe->insert(unsafe->end(), word_history_id_set.begin(), |
+ word_history_id_set.end()); |
} |
} |
} |