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

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

Issue 642623004: Rename VisitDatabaseObserver to HistoryServiceObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@373326
Patch Set: Address comments & rebase Created 6 years, 2 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
« no previous file with comments | « chrome/browser/prerender/prerender_local_predictor.h ('k') | components/history.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_local_predictor.cc
diff --git a/chrome/browser/prerender/prerender_local_predictor.cc b/chrome/browser/prerender/prerender_local_predictor.cc
index 18b0117afed9cd4ad6d5e12a3ce0a6f10e365c70..32ee19bdd337e1cfa30452aba6ad28da0df52be7 100644
--- a/chrome/browser/prerender/prerender_local_predictor.cc
+++ b/chrome/browser/prerender/prerender_local_predictor.cc
@@ -528,7 +528,7 @@ class PrerenderLocalPredictor::PrefetchList {
PrerenderLocalPredictor::PrerenderLocalPredictor(
PrerenderManager* prerender_manager)
: prerender_manager_(prerender_manager),
- is_visit_database_observer_(false),
+ is_history_service_observer_(false),
prefetch_list_(new PrefetchList()),
weak_factory_(this) {
RecordEvent(EVENT_CONSTRUCTED);
@@ -583,15 +583,16 @@ PrerenderLocalPredictor::~PrerenderLocalPredictor() {
void PrerenderLocalPredictor::Shutdown() {
timer_.Stop();
- if (is_visit_database_observer_) {
+ if (is_history_service_observer_) {
HistoryService* history = GetHistoryIfExists();
CHECK(history);
- history->RemoveVisitDatabaseObserver(this);
- is_visit_database_observer_ = false;
+ history->RemoveObserver(this);
+ is_history_service_observer_ = false;
}
}
-void PrerenderLocalPredictor::OnAddVisit(const history::BriefVisitInfo& info) {
+void PrerenderLocalPredictor::OnAddVisit(HistoryService* history_service,
+ const history::BriefVisitInfo& info) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
RecordEvent(EVENT_ADD_VISIT);
if (!visit_history_.get())
@@ -1138,13 +1139,13 @@ void PrerenderLocalPredictor::Init() {
}
HistoryService* history = GetHistoryIfExists();
if (history) {
- CHECK(!is_visit_database_observer_);
+ CHECK(!is_history_service_observer_);
history->ScheduleDBTask(
scoped_ptr<history::HistoryDBTask>(
new GetVisitHistoryTask(this, kMaxVisitHistory)),
&history_db_tracker_);
- history->AddVisitDatabaseObserver(this);
- is_visit_database_observer_ = true;
+ history->AddObserver(this);
+ is_history_service_observer_ = true;
} else {
RecordEvent(EVENT_INIT_FAILED_NO_HISTORY);
}
« no previous file with comments | « chrome/browser/prerender/prerender_local_predictor.h ('k') | components/history.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698