| Index: chrome/browser/predictors/resource_prefetch_predictor.cc
|
| diff --git a/chrome/browser/predictors/resource_prefetch_predictor.cc b/chrome/browser/predictors/resource_prefetch_predictor.cc
|
| index ded4d178be9778a85db793248ddce189d89781de..2e8f4ca746e298130aefec0e06707f54f4849672 100644
|
| --- a/chrome/browser/predictors/resource_prefetch_predictor.cc
|
| +++ b/chrome/browser/predictors/resource_prefetch_predictor.cc
|
| @@ -1125,8 +1125,7 @@ void ResourcePrefetchPredictor::OnURLsDeleted(
|
| const history::URLRows& deleted_rows,
|
| const std::set<GURL>& favicon_urls) {
|
| DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| - if (INITIALIZED != initialization_state_)
|
| - return;
|
| + DCHECK(initialization_state_ == INITIALIZED);
|
|
|
| if (all_history) {
|
| DeleteAllUrls();
|
| @@ -1144,7 +1143,6 @@ void ResourcePrefetchPredictor::OnURLsDeleted(
|
| void ResourcePrefetchPredictor::OnHistoryServiceLoaded(
|
| history::HistoryService* history_service) {
|
| OnHistoryAndCacheLoaded();
|
| - history_service_observer_.Remove(history_service);
|
| }
|
|
|
| void ResourcePrefetchPredictor::ConnectToHistoryService() {
|
| @@ -1152,16 +1150,13 @@ void ResourcePrefetchPredictor::ConnectToHistoryService() {
|
| history::HistoryService* history_service =
|
| HistoryServiceFactory::GetForProfile(profile_,
|
| ServiceAccessType::EXPLICIT_ACCESS);
|
| - if (!history_service)
|
| - return;
|
| + DCHECK(history_service);
|
| + DCHECK(!history_service_observer_.IsObserving(history_service));
|
| + history_service_observer_.Add(history_service);
|
| if (history_service->BackendLoaded()) {
|
| // HistoryService is already loaded. Continue with Initialization.
|
| OnHistoryAndCacheLoaded();
|
| - return;
|
| }
|
| - DCHECK(!history_service_observer_.IsObserving(history_service));
|
| - history_service_observer_.Add(history_service);
|
| - return;
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
|
|