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

Unified Diff: chrome/browser/history/visit_database.h

Issue 16776004: Replace FTS in the history_service with a brute force text search. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address scotts comments & fix unit tests. Created 7 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
Index: chrome/browser/history/visit_database.h
diff --git a/chrome/browser/history/visit_database.h b/chrome/browser/history/visit_database.h
index 18efc3c9ca6c2e5c71036e40a70d2f80aed0ee78..166af98a68817394606e3412be2590cbf19f640a 100644
--- a/chrome/browser/history/visit_database.h
+++ b/chrome/browser/history/visit_database.h
@@ -63,6 +63,15 @@ class VisitDatabase {
// Returns true on success (although there may still be no matches).
bool GetIndexedVisitsForURL(URLID url_id, VisitVector* visits);
+ // Fills in the given vector with the visits for the given page ID which
+ // match the set of options passed, sorted in ascending order of date.
+ //
+ // Returns true if there are more results available, i.e. if the number of
+ // results was restricted by |options.max_count|.
+ bool GetVisitsForURLWithOptions(URLID url_id,
+ const QueryOptions& options,
+ VisitVector* visits);
+
// Fills the vector with all visits with times in the given list.
//
// The results will be in no particular order. Also, no duplicate
@@ -202,6 +211,12 @@ class VisitDatabase {
// hasn't happened yet.
static bool FillVisitVector(sql::Statement& statement, VisitVector* visits);
+ // Convenience to fill a VisitVector while respecting the set of options.
+ // Assumes that statement.step() hasn't happened yet.
+ static bool FillVisitVectorWithOptions(sql::Statement& statement,
+ const QueryOptions& options,
+ VisitVector* visits);
+
// Called by the derived classes to migrate the older visits table which
// don't have visit_duration column yet.
bool MigrateVisitsWithoutDuration();
@@ -216,6 +231,6 @@ class VisitDatabase {
" id,url,visit_time,from_visit,transition,segment_id,is_indexed," \
"visit_duration "
-} // history
+} // namespace history
#endif // CHROME_BROWSER_HISTORY_VISIT_DATABASE_H_

Powered by Google App Engine
This is Rietveld 408576698