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

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

Issue 343051: Make sure we can still navigate to URLs when the History DB can't be loaded.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 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/history_url_provider.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/history_url_provider.cc
===================================================================
--- chrome/browser/autocomplete/history_url_provider.cc (revision 30468)
+++ chrome/browser/autocomplete/history_url_provider.cc (working copy)
@@ -36,6 +36,7 @@
input(input),
trim_http(trim_http),
cancel(false),
+ failed(false),
languages(languages) {
}
@@ -103,8 +104,10 @@
history::URLDatabase* db,
HistoryURLProviderParams* params) {
// We may get called with a NULL database if it couldn't be properly
- // initialized. In this case we just say the query is complete.
- if (db && !params->cancel) {
+ // initialized.
+ if (!db) {
+ params->failed = true;
+ } else if (!params->cancel) {
TimeTicks beginning_time = TimeTicks::Now();
DoAutocomplete(backend, db, params);
@@ -222,9 +225,14 @@
if (params->cancel)
return; // Already set done_ when we canceled, no need to set it again.
+ // Don't modify |matches_| if the query failed, since it might have a default
+ // match in it, whereas |params->matches| will be empty.
+ if (!params->failed) {
+ matches_.swap(params->matches);
+ UpdateStarredStateOfMatches();
+ }
+
done_ = true;
- matches_.swap(params->matches);
- UpdateStarredStateOfMatches();
listener_->OnProviderUpdate(true);
}
« no previous file with comments | « chrome/browser/autocomplete/history_url_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698