summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history/url_database.cc
diff options
context:
space:
mode:
authormrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-24 14:08:55 +0000
committermrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-24 14:08:55 +0000
commit61623711e224217f24269ec1ba5554e3e908b92c (patch)
tree9b9eae613b98c1cfdf3547ce802426b700c16b53 /chrome/browser/history/url_database.cc
parent3cac7aad8de5684d54876306e924d2c17b7c8a02 (diff)
downloadchromium_src-61623711e224217f24269ec1ba5554e3e908b92c.zip
chromium_src-61623711e224217f24269ec1ba5554e3e908b92c.tar.gz
chromium_src-61623711e224217f24269ec1ba5554e3e908b92c.tar.bz2
Add caching of the InMemoryURLIndex (part of the HistoryQuickProvider) part 1. (Transactions will be introduced in the next submission.) Fixed a problem in the caching of search results as the user types each character in a search term. Updated the unit test associated with that code.
Added (temporary) flag which can be used to turn on the HQP (enable-history-quick-provider); also added it to about:flags. Previously reviewed as http://codereview.chromium.org/6286029/. BUG=19736,60107 TEST=Added unit tests. Review URL: http://codereview.chromium.org/6581024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75882 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/url_database.cc')
-rw-r--r--chrome/browser/history/url_database.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/history/url_database.cc b/chrome/browser/history/url_database.cc
index 24decc6..f6c041c 100644
--- a/chrome/browser/history/url_database.cc
+++ b/chrome/browser/history/url_database.cc
@@ -238,6 +238,25 @@ bool URLDatabase::InitURLEnumeratorForEverything(URLEnumerator* enumerator) {
return true;
}
+bool URLDatabase::InitURLEnumeratorForSignificant(URLEnumerator* enumerator) {
+ DCHECK(!enumerator->initialized_);
+ std::string sql("SELECT ");
+ sql.append(kURLRowFields);
+ sql.append(" FROM urls WHERE last_visit_time >= ? OR visit_count > ? OR "
+ "typed_count > ?");
+ enumerator->statement_.Assign(GetDB().GetUniqueStatement(sql.c_str()));
+ if (!enumerator->statement_) {
+ NOTREACHED() << GetDB().GetErrorMessage();
+ return false;
+ }
+ enumerator->statement_.BindInt64(
+ 0, AutocompleteAgeThreshold().ToInternalValue());
+ enumerator->statement_.BindInt(1, kLowQualityMatchVisitLimit);
+ enumerator->statement_.BindInt(2, kLowQualityMatchTypedLimit);
+ enumerator->initialized_ = true;
+ return true;
+}
+
bool URLDatabase::IsFavIconUsed(FavIconID favicon_id) {
sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE,
"SELECT id FROM urls WHERE favicon_id=? LIMIT 1"));