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

Unified Diff: components/offline_pages/core/prefetch/prefetch_service_impl.cc

Issue 2879013002: Create skeleton for the Prefetching store and initial pipeline step. (Closed)
Patch Set: Fixed store not used build errors. Created 3 years, 7 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: components/offline_pages/core/prefetch/prefetch_service_impl.cc
diff --git a/components/offline_pages/core/prefetch/prefetch_service_impl.cc b/components/offline_pages/core/prefetch/prefetch_service_impl.cc
index 4f557e5e6b4d4b76a96c6bcdbd9333a29f229a9f..0522133bf4f8352345d74c9062ca89edb302d26f 100644
--- a/components/offline_pages/core/prefetch/prefetch_service_impl.cc
+++ b/components/offline_pages/core/prefetch/prefetch_service_impl.cc
@@ -9,26 +9,26 @@
#include "base/memory/ptr_util.h"
#include "components/offline_pages/core/prefetch/offline_metrics_collector.h"
#include "components/offline_pages/core/prefetch/prefetch_dispatcher_impl.h"
+#include "components/offline_pages/core/prefetch/prefetch_store.h"
namespace offline_pages {
PrefetchServiceImpl::PrefetchServiceImpl(
+ std::unique_ptr<PrefetchDispatcher> dispatcher,
+ std::unique_ptr<OfflineMetricsCollector> offline_metrics_collector,
std::unique_ptr<PrefetchGCMHandler> gcm_handler,
- std::unique_ptr<OfflineMetricsCollector> offline_metrics_collector)
- : gcm_handler_(std::move(gcm_handler)),
- dispatcher_(base::MakeUnique<PrefetchDispatcherImpl>()),
- offline_metrics_collector_(std::move(offline_metrics_collector)) {}
+ std::unique_ptr<PrefetchStore> store)
+ : prefetch_dispatcher_(std::move(dispatcher)),
+ offline_metrics_collector_(std::move(offline_metrics_collector)),
+ gcm_handler_(std::move(gcm_handler)),
+ prefetch_store_(std::move(store)) {
+ prefetch_dispatcher_->SetService(this);
+}
PrefetchServiceImpl::~PrefetchServiceImpl() = default;
-void PrefetchServiceImpl::ObserveContentSuggestionsService(
- ntp_snippets::ContentSuggestionsService* service) {
- suggested_articles_observer_ =
- base::MakeUnique<SuggestedArticlesObserver>(service, this);
-}
-
-PrefetchDispatcher* PrefetchServiceImpl::GetDispatcher() {
- return dispatcher_.get();
+PrefetchDispatcher* PrefetchServiceImpl::GetPrefetchDispatcher() {
+ return prefetch_dispatcher_.get();
}
OfflineMetricsCollector* PrefetchServiceImpl::GetOfflineMetricsCollector() {
@@ -39,6 +39,16 @@ PrefetchGCMHandler* PrefetchServiceImpl::GetPrefetchGCMHandler() {
return gcm_handler_.get();
}
+PrefetchStore* PrefetchServiceImpl::GetPrefetchStore() {
+ return prefetch_store_.get();
+}
+
+void PrefetchServiceImpl::ObserveContentSuggestionsService(
+ ntp_snippets::ContentSuggestionsService* service) {
+ suggested_articles_observer_ =
+ base::MakeUnique<SuggestedArticlesObserver>(service, this);
+}
+
void PrefetchServiceImpl::Shutdown() {}
} // namespace offline_pages

Powered by Google App Engine
This is Rietveld 408576698