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

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

Issue 118453: Add a couple CHECK()s in hopes of helping to track down a crash.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_popup_model.cc
===================================================================
--- chrome/browser/autocomplete/autocomplete_popup_model.cc (revision 17736)
+++ chrome/browser/autocomplete/autocomplete_popup_model.cc (working copy)
@@ -129,6 +129,11 @@
// call us back to get data about the old selection), and we must not call
// UpdateWindow() before updating |selected_line_| (since the paint routine
// relies on knowing the correct selected line).
+ //
+ // NOTE: We should never reach here with no selected line; the same code that
+ // opened the popup and made it possible to get here should have also set a
+ // selected line.
+ CHECK(selected_line_ != kNoMatch);
view_->InvalidateLine(selected_line_);
selected_line_ = line;
view_->InvalidateLine(selected_line_);
@@ -302,6 +307,8 @@
case NotificationType::AUTOCOMPLETE_CONTROLLER_RESULT_UPDATED: {
selected_line_ = (result->default_match() == result->end()) ?
kNoMatch : (result->default_match() - result->begin());
+ // There had better not be a nonempty result set with no default match.
+ CHECK((selected_line_ != kNoMatch) || result->empty());
// If we're going to trim the window size to no longer include the hovered
// line, turn hover off. Practically, this shouldn't happen, but it
// doesn't hurt to be defensive.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698