summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete
diff options
context:
space:
mode:
authormpearson@chromium.org <mpearson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-26 12:21:33 +0000
committermpearson@chromium.org <mpearson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-26 12:21:33 +0000
commit2cdf117b32136eae2b71ca10e1e23a39da17f119 (patch)
tree642eba4d67185c8b79178a6ddc4d8ebb55cb7f9c /chrome/browser/autocomplete
parented0f0beaa106ff23e2d7217d195a5cc13e6a4c35 (diff)
downloadchromium_src-2cdf117b32136eae2b71ca10e1e23a39da17f119.zip
chromium_src-2cdf117b32136eae2b71ca10e1e23a39da17f119.tar.gz
chromium_src-2cdf117b32136eae2b71ca10e1e23a39da17f119.tar.bz2
Fix Omnibox search provider's confusing internal variable semantics
As a side effect, the count in the histogram Omnibox.SuggestRequests's number of requests invalidated bucket will be more accurate. BUG= TEST=by hand using about:histograms Review URL: https://chromiumcodereview.appspot.com/10860068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r--chrome/browser/autocomplete/search_provider.cc12
-rw-r--r--chrome/browser/autocomplete/search_provider.h2
2 files changed, 4 insertions, 10 deletions
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index 94112fa..0ed0ee8 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -506,12 +506,6 @@ void SearchProvider::StartOrStopSuggestQuery(bool minimal_changes) {
if (input_.matches_requested() != AutocompleteInput::ALL_MATCHES)
return;
- // We'll have at least one pending fetch. Set it to 1 now, but the value is
- // correctly set in Run. As Run isn't invoked immediately we need to set this
- // now, else we won't think we're waiting on results from the server when we
- // really are.
- suggest_results_pending_ = 1;
-
// Kick off a timer that will start the URL fetch if it completes before
// the user types another character. Requests may be delayed to avoid
// flooding the server with requests that are likely to be thrown away later
@@ -1244,8 +1238,8 @@ AutocompleteMatch SearchProvider::NavigationToMatch(
}
void SearchProvider::UpdateDone() {
- // We're done when there are no more suggest queries pending (this is set to 1
- // when the timer is started) and we're not waiting on instant.
- done_ = ((suggest_results_pending_ == 0) &&
+ // We're done when the timer isn't running, there are no suggest queries
+ // pending, and we're not waiting on instant.
+ done_ = (!timer_.IsRunning() && (suggest_results_pending_ == 0) &&
(instant_finalized_ || !InstantController::IsEnabled(profile_)));
}
diff --git a/chrome/browser/autocomplete/search_provider.h b/chrome/browser/autocomplete/search_provider.h
index 5063157..171a208 100644
--- a/chrome/browser/autocomplete/search_provider.h
+++ b/chrome/browser/autocomplete/search_provider.h
@@ -336,7 +336,7 @@ class SearchProvider : public AutocompleteProvider,
HistoryResults default_history_results_;
// Number of suggest results that haven't yet arrived. If greater than 0 it
- // indicates either |timer_| or one of the URLFetchers is still running.
+ // indicates one of the URLFetchers is still running.
int suggest_results_pending_;
// A timer to start a query to the suggest server after the user has stopped