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

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

Issue 9316109: Move Ownership of IMUI to HistoryService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 11 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/url_index_private_data.h
===================================================================
--- chrome/browser/history/url_index_private_data.h (revision 120346)
+++ chrome/browser/history/url_index_private_data.h (working copy)
@@ -19,6 +19,8 @@
namespace imui = in_memory_url_index;
+class HistoryDatabase;
+
// A structure describing the InMemoryURLIndex's internal data and providing for
// restoring, rebuilding and updating that internal data.
class URLIndexPrivateData {
@@ -130,13 +132,15 @@
// profile directory and returns true if successful.
bool RestoreFromFile(const FilePath& file_path);
+ // Constructs a new object by rebuilding its contents from the history
+ // database in |history_db|. Returns the new URLIndexPrivateData which on
+ // success will contain the rebuilt data but upon failure will be empty.
+ static URLIndexPrivateData* RebuildFromHistory(HistoryDatabase* history_db);
+
// Caches the index private data and writes the cache file to the profile
// directory.
bool SaveToFile(const FilePath& file_path);
- // Reloads the history index from |history_db|.
- bool ReloadFromHistory(URLDatabase* history_db);
-
// Initializes all index data members in preparation for restoring the index
// from the cache or a complete rebuild from the history database.
void Clear();
@@ -153,17 +157,22 @@
// URL History indexing support functions.
- // Indexes one URL history item.
- void IndexRow(const URLRow& row);
+ // Indexes one URL history item as described by |row|. Returns true if the
+ // row was actually indexed.
+ bool IndexRow(const URLRow& row);
- // Updates or adds an history item to the index if it meets the minimum
- // 'quick' criteria.
- void UpdateURL(URLID row_id, const URLRow& row);
+ // Adds the history item in |row| to the index if it does not already already
+ // exist and it meets the minimum 'quick' criteria. If the row already exists
+ // in the index then the index will be updated if the row still meets the
+ // criteria, otherwise the row will be removed from the index. Returns true
+ // if the index was actually updated.
+ bool UpdateURL(const URLRow& row);
- // Deletes indexing data for an history item. The item may not have actually
- // been indexed (which is the case if it did not previously meet minimum
- // 'quick' criteria).
- void DeleteURL(URLID row_id);
+ // Deletes indexing data for the history item with the URL given in |url|.
+ // The item may not have actually been indexed, which is the case if it did
+ // not previously meet minimum 'quick' criteria. Returns true if the index
+ // was actually updated.
+ bool DeleteURL(const GURL& url);
// Parses and indexes the words in the URL and page title of |row|.
void AddRowWordsToIndex(const URLRow& row);

Powered by Google App Engine
This is Rietveld 408576698