Index: chrome/browser/predictors/autocomplete_action_predictor.h |
=================================================================== |
--- chrome/browser/predictors/autocomplete_action_predictor.h (revision 141606) |
+++ chrome/browser/predictors/autocomplete_action_predictor.h (working copy) |
@@ -124,19 +124,20 @@ |
const content::NotificationSource& source, |
const content::NotificationDetails& details) OVERRIDE; |
+ // Removes all rows from the database and caches. |
+ void DeleteAllRows(); |
+ |
+ // Removes rows from the database and caches that contain a URL in |rows|. |
+ void DeleteRowsWithURLs(const history::URLRows& rows); |
+ |
// Called when NOTIFICATION_OMNIBOX_OPENED_URL is observed. |
void OnOmniboxOpenedUrl(const AutocompleteLog& log); |
- // Deletes any old or invalid entries from the local caches. |url_db| and |
- // |id_list| must not be NULL. Every row id deleted will be added to id_list. |
- void DeleteOldIdsFromCaches( |
- history::URLDatabase* url_db, |
- std::vector<AutocompleteActionPredictorTable::Row::Id>* id_list); |
+ // Adds and updates rows in the database and caches. |
+ void AddAndUpdateRows( |
+ const AutocompleteActionPredictorTable::Rows& rows_to_add, |
+ const AutocompleteActionPredictorTable::Rows& rows_to_update); |
- // Called to delete any old or invalid entries from the database. Called after |
- // the local caches are created once the history service is available. |
- void DeleteOldEntries(history::URLDatabase* url_db); |
- |
// Called to populate the local caches. This also calls DeleteOldEntries |
// if the history service is available, or registers for the notification of |
// it becoming available. |
@@ -147,6 +148,16 @@ |
// by |service|. Returns success as a boolean. |
bool TryDeleteOldEntries(HistoryService* service); |
+ // Called to delete any old or invalid entries from the database. Called after |
+ // the local caches are created once the history service is available. |
+ void DeleteOldEntries(history::URLDatabase* url_db); |
+ |
+ // Deletes any old or invalid entries from the local caches. |url_db| and |
+ // |id_list| must not be NULL. Every row id deleted will be added to id_list. |
+ void DeleteOldIdsFromCaches( |
+ history::URLDatabase* url_db, |
+ std::vector<AutocompleteActionPredictorTable::Row::Id>* id_list); |
+ |
// Uses local caches to calculate an exact percentage prediction that the user |
// will take a particular match given what they have typed. |is_in_db| is set |
// to differentiate trivial zero results resulting from a match not being |
@@ -158,17 +169,6 @@ |
// Calculates the confidence for an entry in the DBCacheMap. |
double CalculateConfidenceForDbEntry(DBCacheMap::const_iterator iter) const; |
- // Adds and updates rows in the database and caches. |
- void AddAndUpdateRows( |
- const AutocompleteActionPredictorTable::Rows& rows_to_add, |
- const AutocompleteActionPredictorTable::Rows& rows_to_update); |
- |
- // Removes all rows from the database and caches. |
- void DeleteAllRows(); |
- |
- // Removes rows from the database and caches that contain a URL in |rows|. |
- void DeleteRowsWithURLs(const history::URLRows& rows); |
- |
Profile* profile_; |
scoped_refptr<AutocompleteActionPredictorTable> table_; |
content::NotificationRegistrar notification_registrar_; |
@@ -177,7 +177,7 @@ |
std::vector<TransitionalMatch> transitional_matches_; |
// This allows us to predict the effect of confidence threshold changes on |
- // accuracy. |
+ // accuracy. This is cleared after every omnibox navigation. |
mutable std::vector<std::pair<GURL, double> > tracked_urls_; |
DBCacheMap db_cache_; |