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

Unified Diff: chrome/browser/autocomplete/url_index_private_data.cc

Issue 1163963004: [Omnibox] Changing scheme from https:// to http:// results in DCHECK (Always). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « chrome/browser/autocomplete/url_index_private_data.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/url_index_private_data.cc
diff --git a/chrome/browser/autocomplete/url_index_private_data.cc b/chrome/browser/autocomplete/url_index_private_data.cc
index 68943f411a6a9870c2798837692749211000ffe2..ed493249264c194e3ffa92b211bbd0b5dabba767 100644
--- a/chrome/browser/autocomplete/url_index_private_data.cc
+++ b/chrome/browser/autocomplete/url_index_private_data.cc
@@ -1289,11 +1289,12 @@ URLIndexPrivateData::AddHistoryMatch::AddHistoryMatch(
// If the iterator doesn't work, assume an offset of 0.
if (!iter.Init())
continue;
- // Find the first word start.
+ // Find the first word start. If the iterator didn't find a word break, set
+ // an offset of term size. For example, the offset for "://" should be 3,
+ // indicating that the word-part is missing.
while (iter.Advance() && !iter.IsWord()) {}
- if (iter.IsWord())
- lower_terms_to_word_starts_offsets_[i] = iter.prev();
- // Else: the iterator didn't find a word break. Assume an offset of 0.
+
+ lower_terms_to_word_starts_offsets_[i] = iter.prev();
}
}
« no previous file with comments | « chrome/browser/autocomplete/url_index_private_data.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698