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

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

Issue 573553004: Eliminate NOTIFICATION_HISTORY_LOADED notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add ScopedObserver to InMemoryHistoryBackend,PrerenderLocalPredictor,ChromeTemplateURLServiceClient Created 6 years, 1 month 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.h
diff --git a/chrome/browser/prerender/prerender_local_predictor.h b/chrome/browser/prerender/prerender_local_predictor.h
index 95ca574516c6a08e96ce2325a2c39669a20e6893..e0a5c340a7fa11f014bba73da5eea2cc9e341dde 100644
--- a/chrome/browser/prerender/prerender_local_predictor.h
+++ b/chrome/browser/prerender/prerender_local_predictor.h
@@ -11,6 +11,7 @@
#include "base/containers/hash_tables.h"
#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
+#include "base/scoped_observer.h"
#include "base/task/cancelable_task_tracker.h"
#include "base/timer/timer.h"
#include "chrome/browser/history/visit_database.h"
@@ -220,10 +221,6 @@ class PrerenderLocalPredictor : public history::HistoryServiceObserver,
// database thread early on when Chrome is starting up.
static const int kInitDelayMs = 5 * 1000;
- // Whether we're registered with the history service as a
- // history::HistoryServiceObserver.
- bool is_history_service_observer_;
-
base::CancelableTaskTracker history_db_tracker_;
scoped_ptr<std::vector<history::BriefVisitInfo> > visit_history_;
@@ -239,6 +236,9 @@ class PrerenderLocalPredictor : public history::HistoryServiceObserver,
scoped_ptr<PrefetchList> prefetch_list_;
+ ScopedObserver<HistoryService, HistoryServiceObserver>
+ history_service_observer_;
+
DISALLOW_COPY_AND_ASSIGN(PrerenderLocalPredictor);
};

Powered by Google App Engine
This is Rietveld 408576698