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

Unified Diff: chrome/browser/predictors/autocomplete_action_predictor.h

Issue 10548015: Reorder functions in AutocompleteActionPredictor so that if A calls B calls C, they're listed A, B,… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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
« no previous file with comments | « no previous file | chrome/browser/predictors/autocomplete_action_predictor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « no previous file | chrome/browser/predictors/autocomplete_action_predictor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698