Index: chrome/browser/prerender/prerender_local_predictor.cc |
=================================================================== |
--- chrome/browser/prerender/prerender_local_predictor.cc (revision 133717) |
+++ chrome/browser/prerender/prerender_local_predictor.cc (working copy) |
@@ -88,9 +88,8 @@ |
} |
PrerenderLocalPredictor::~PrerenderLocalPredictor() { |
- HistoryService* history = GetHistoryIfExists(); |
- if (history) |
- history->RemoveVisitDatabaseObserver(this); |
+ if (observing_history_service_.get()) |
+ observing_history_service_->RemoveVisitDatabaseObserver(this); |
} |
void PrerenderLocalPredictor::OnAddVisit(const history::BriefVisitInfo& info) { |
@@ -133,7 +132,8 @@ |
history->ScheduleDBTask( |
new GetVisitHistoryTask(this, kMaxVisitHistory), |
&history_db_consumer_); |
- history->AddVisitDatabaseObserver(this); |
+ observing_history_service_ = history; |
+ observing_history_service_->AddVisitDatabaseObserver(this); |
} |
} // namespace prerender |