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

Unified Diff: chrome/browser/prerender/prerender_local_predictor.cc

Issue 10214004: Fix destruction concurrency issue in PrerenderLocalPredictor: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 months 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/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

Powered by Google App Engine
This is Rietveld 408576698