Chromium Code Reviews| 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() { |