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

Side by Side Diff: chrome/browser/predictors/autocomplete_action_predictor.h

Issue 2538763002: Data from the autocomplete predictor wasn't deleted immediately when deleting browsing history. (Closed)
Patch Set: assume history_service always exist to ensure we definitly delete data when requested Created 4 years 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 unified diff | Download patch
OLDNEW
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 #include <memory> 9 #include <memory>
10 #include <tuple> 10 #include <tuple>
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 const AutocompleteActionPredictorTable::Rows& rows_to_add, 180 const AutocompleteActionPredictorTable::Rows& rows_to_add,
181 const AutocompleteActionPredictorTable::Rows& rows_to_update); 181 const AutocompleteActionPredictorTable::Rows& rows_to_update);
182 182
183 // Called to populate the local caches. This also calls DeleteOldEntries 183 // Called to populate the local caches. This also calls DeleteOldEntries
184 // if the history service is available, or registers for the notification of 184 // if the history service is available, or registers for the notification of
185 // it becoming available. 185 // it becoming available.
186 void CreateCaches( 186 void CreateCaches(
187 std::vector<AutocompleteActionPredictorTable::Row>* row_buffer); 187 std::vector<AutocompleteActionPredictorTable::Row>* row_buffer);
188 188
189 // Attempts to call DeleteOldEntries if the in-memory database has been loaded 189 // Attempts to call DeleteOldEntries if the in-memory database has been loaded
190 // by |service|. Returns success as a boolean. 190 // by |service|.
191 bool TryDeleteOldEntries(history::HistoryService* service); 191 void TryDeleteOldEntries(history::HistoryService* service);
192 192
193 // Called to delete any old or invalid entries from the database. Called after 193 // Called to delete any old or invalid entries from the database. Called after
194 // the local caches are created once the history service is available. 194 // the local caches are created once the history service is available.
195 void DeleteOldEntries(history::URLDatabase* url_db); 195 void DeleteOldEntries(history::URLDatabase* url_db);
196 196
197 // Deletes any old or invalid entries from the local caches. |url_db| and 197 // Deletes any old or invalid entries from the local caches. |url_db| and
198 // |id_list| must not be NULL. Every row id deleted will be added to id_list. 198 // |id_list| must not be NULL. Every row id deleted will be added to id_list.
199 void DeleteOldIdsFromCaches( 199 void DeleteOldIdsFromCaches(
200 history::URLDatabase* url_db, 200 history::URLDatabase* url_db,
201 std::vector<AutocompleteActionPredictorTable::Row::Id>* id_list); 201 std::vector<AutocompleteActionPredictorTable::Row::Id>* id_list);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 263
264 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> 264 ScopedObserver<history::HistoryService, history::HistoryServiceObserver>
265 history_service_observer_; 265 history_service_observer_;
266 266
267 DISALLOW_COPY_AND_ASSIGN(AutocompleteActionPredictor); 267 DISALLOW_COPY_AND_ASSIGN(AutocompleteActionPredictor);
268 }; 268 };
269 269
270 } // namespace predictors 270 } // namespace predictors
271 271
272 #endif // CHROME_BROWSER_PREDICTORS_AUTOCOMPLETE_ACTION_PREDICTOR_H_ 272 #endif // CHROME_BROWSER_PREDICTORS_AUTOCOMPLETE_ACTION_PREDICTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698