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

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

Issue 2538763002: Data from the autocomplete predictor wasn't deleted immediately when deleting browsing history. (Closed)
Patch Set: fix prefetch predictor as well Created 4 years, 1 month 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/predictors/autocomplete_action_predictor.cc
diff --git a/chrome/browser/predictors/autocomplete_action_predictor.cc b/chrome/browser/predictors/autocomplete_action_predictor.cc
index 90fd37d1c6711e49854d7c5977724d415fdc1517..5a643d906bc9625ea60ebaad417ab35b04c06822 100644
--- a/chrome/browser/predictors/autocomplete_action_predictor.cc
+++ b/chrome/browser/predictors/autocomplete_action_predictor.cc
@@ -442,12 +442,9 @@ void AutocompleteActionPredictor::CreateCaches(
history::HistoryService* history_service =
HistoryServiceFactory::GetForProfile(profile_,
ServiceAccessType::EXPLICIT_ACCESS);
- if (!TryDeleteOldEntries(history_service)) {
- // Wait for the notification that the history service is ready and the URL
- // DB is loaded.
- if (history_service)
- history_service_observer_.Add(history_service);
- }
+ TryDeleteOldEntries(history_service);
pasko 2016/11/29 18:01:00 after this change the return value is never checke
dullweber 2016/11/30 11:49:21 Done.
+ if (history_service)
+ history_service_observer_.Add(history_service);
pasko 2016/11/29 18:01:00 what if the history service is not ready by the ti
dullweber 2016/11/30 11:49:21 I think I handled the following cases: 1. history_
pasko 2016/12/01 17:26:41 I think calling TryDeleteOldEntries twice is not s
dullweber 2016/12/05 13:07:57 OnHistoryServiceLoaded() and OnURLsDeleted() are b
}
bool AutocompleteActionPredictor::TryDeleteOldEntries(
@@ -580,8 +577,8 @@ void AutocompleteActionPredictor::OnURLsDeleted(
void AutocompleteActionPredictor::OnHistoryServiceLoaded(
history::HistoryService* history_service) {
- TryDeleteOldEntries(history_service);
- history_service_observer_.Remove(history_service);
+ if (!initialized_)
pasko 2016/11/29 18:01:00 would it break something if we try to delete old e
dullweber 2016/11/30 11:49:21 I don't think anything would break but TryDeleteOl
+ TryDeleteOldEntries(history_service);
}
AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch() {

Powered by Google App Engine
This is Rietveld 408576698