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

Unified Diff: chrome/browser/renderer_host/render_view_host.cc

Issue 2945003: AutoFill DCHECK in RenderViewHost::AutocompleteSuggestionsReturned fails. (Closed)
Patch Set: Created 10 years, 5 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/autofill/autofill_manager_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/render_view_host.cc
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index 28b44a35396d236a4f65fd4377f9915599eed87a..4905ad55d874ef15546019ad2c31e3456f9e8e02 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -1659,7 +1659,15 @@ void RenderViewHost::AutoFillSuggestionsReturned(
void RenderViewHost::AutocompleteSuggestionsReturned(
int query_id, const std::vector<string16>& suggestions) {
- DCHECK_EQ(autofill_query_id_, query_id);
+ // When query ids match we are responding to an AutoFill and Autocomplete
+ // combined query response.
+ // Otherwise Autocomplete is cancelling, so we only send suggestions (usually
+ // an empty list).
+ if (autofill_query_id_ != query_id) {
+ // Autocomplete is cancelling.
+ autofill_values_.clear();
+ autofill_labels_.clear();
+ }
// Combine AutoFill and Autocomplete values into values and labels.
for (size_t i = 0; i < suggestions.size(); ++i) {
« no previous file with comments | « chrome/browser/autofill/autofill_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698