| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_PREDICTORS_AUTOCOMPLETE_ACTION_PREDICTOR_H_ | 5 #ifndef CHROME_BROWSER_PREDICTORS_AUTOCOMPLETE_ACTION_PREDICTOR_H_ |
| 6 #define CHROME_BROWSER_PREDICTORS_AUTOCOMPLETE_ACTION_PREDICTOR_H_ | 6 #define CHROME_BROWSER_PREDICTORS_AUTOCOMPLETE_ACTION_PREDICTOR_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 typedef std::map<DBCacheKey, DBCacheValue> DBCacheMap; | 150 typedef std::map<DBCacheKey, DBCacheValue> DBCacheMap; |
| 151 typedef std::map<DBCacheKey, AutocompleteActionPredictorTable::Row::Id> | 151 typedef std::map<DBCacheKey, AutocompleteActionPredictorTable::Row::Id> |
| 152 DBIdCacheMap; | 152 DBIdCacheMap; |
| 153 | 153 |
| 154 static const int kMaximumDaysToKeepEntry; | 154 static const int kMaximumDaysToKeepEntry; |
| 155 | 155 |
| 156 // NotificationObserver | 156 // NotificationObserver |
| 157 virtual void Observe(int type, | 157 virtual void Observe(int type, |
| 158 const content::NotificationSource& source, | 158 const content::NotificationSource& source, |
| 159 const content::NotificationDetails& details) OVERRIDE; | 159 const content::NotificationDetails& details) override; |
| 160 | 160 |
| 161 // The first step in initializing the predictor is accessing the database and | 161 // The first step in initializing the predictor is accessing the database and |
| 162 // building the local cache. This should be delayed until after critical DB | 162 // building the local cache. This should be delayed until after critical DB |
| 163 // and IO processes have completed. | 163 // and IO processes have completed. |
| 164 void CreateLocalCachesFromDatabase(); | 164 void CreateLocalCachesFromDatabase(); |
| 165 | 165 |
| 166 // Removes all rows from the database and caches. | 166 // Removes all rows from the database and caches. |
| 167 void DeleteAllRows(); | 167 void DeleteAllRows(); |
| 168 | 168 |
| 169 // Removes rows from the database and caches that contain a URL in |rows|. | 169 // Removes rows from the database and caches that contain a URL in |rows|. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 DBIdCacheMap db_id_cache_; | 245 DBIdCacheMap db_id_cache_; |
| 246 | 246 |
| 247 bool initialized_; | 247 bool initialized_; |
| 248 | 248 |
| 249 DISALLOW_COPY_AND_ASSIGN(AutocompleteActionPredictor); | 249 DISALLOW_COPY_AND_ASSIGN(AutocompleteActionPredictor); |
| 250 }; | 250 }; |
| 251 | 251 |
| 252 } // namespace predictors | 252 } // namespace predictors |
| 253 | 253 |
| 254 #endif // CHROME_BROWSER_PREDICTORS_AUTOCOMPLETE_ACTION_PREDICTOR_H_ | 254 #endif // CHROME_BROWSER_PREDICTORS_AUTOCOMPLETE_ACTION_PREDICTOR_H_ |
| OLD | NEW |