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

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

Issue 342112: Try to add more sanity checking to help track down a crash.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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
Index: chrome/browser/autocomplete/autocomplete.cc
===================================================================
--- chrome/browser/autocomplete/autocomplete.cc (revision 30836)
+++ chrome/browser/autocomplete/autocomplete.cc (working copy)
@@ -511,7 +511,7 @@
void AutocompleteProvider::SetProfile(Profile* profile) {
DCHECK(profile);
- Stop(); // It makes no sense to continue running a query from an old profile.
+ DCHECK(done_); // The controller should have already stopped us.
profile_ = profile;
}
@@ -688,6 +688,7 @@
}
void AutocompleteController::SetProfile(Profile* profile) {
+ Stop(true);
for (ACProviders::iterator i(providers_.begin()); i != providers_.end(); ++i)
(*i)->SetProfile(profile);
input_.Clear(); // Ensure we don't try to do a "minimal_changes" query on a
@@ -756,7 +757,7 @@
updated_latest_result_ = false;
delay_interval_has_passed_ = false;
done_ = true;
- if (clear_result) {
+ if (clear_result && !result_.empty()) {
result_.Reset();
NotificationService::current()->Notify(
NotificationType::AUTOCOMPLETE_CONTROLLER_RESULT_UPDATED,

Powered by Google App Engine
This is Rietveld 408576698