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

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

Issue 2864293003: [Offline Pages] Add a GCMAppHandler for offline page prefetch. (Closed)
Patch Set: Move Content Suggestions Observer to //components/offline_pages/core and modify lifetime management 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.h
diff --git a/components/offline_pages/core/prefetch/prefetch_service_impl.h b/components/offline_pages/core/prefetch/prefetch_service_impl.h
index 69346aa356ad721f13d34b818cdb714cced3531d..3845c47ea84cdebdf33a50d67177b98d2eca37c7 100644
--- a/components/offline_pages/core/prefetch/prefetch_service_impl.h
+++ b/components/offline_pages/core/prefetch/prefetch_service_impl.h
@@ -5,19 +5,37 @@
#ifndef COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_IMPL_H_
#define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_IMPL_H_
-#include <vector>
+#include <memory>
#include "components/offline_pages/core/prefetch/prefetch_service.h"
+#include "components/offline_pages/core/prefetch/suggested_articles_observer.h"
#include "url/gurl.h"
+namespace ntp_snippets {
+class ContentSuggestionsService;
+}
+
namespace offline_pages {
class PrefetchServiceImpl : public PrefetchService {
public:
- PrefetchServiceImpl();
+ // An interface allowing the prefetch service to hold a GCM App Handler for
+ // lifetime purposes. TODO(dewittj): Add an interface method for getting an
fgorski 2017/05/17 23:15:02 This comment is duplicated below, please remove on
dewittj 2017/05/22 22:00:08 Done.
+ // InstandID token.
+ class GCMAppHandler {
+ public:
+ virtual ~GCMAppHandler() = default;
+
+ // TODO(dewittj): Add methods for acquiring an Instance ID token to this
+ // interface.
+ };
+
+ explicit PrefetchServiceImpl(std::unique_ptr<GCMAppHandler> gcm_app_handler);
~PrefetchServiceImpl() override;
// PrefetchService implementation:
+ void ObserveContentSuggestionsService(
+ ntp_snippets::ContentSuggestionsService* service) override;
void AddCandidatePrefetchURLs(
const std::vector<PrefetchURL>& suggested_urls) override;
void RemoveAllUnprocessedPrefetchURLs(const std::string& name_space) override;
@@ -29,6 +47,9 @@ class PrefetchServiceImpl : public PrefetchService {
void Shutdown() override;
private:
+ std::unique_ptr<SuggestedArticlesObserver> suggested_articles_observer_;
+ std::unique_ptr<GCMAppHandler> gcm_app_handler_;
+
DISALLOW_COPY_AND_ASSIGN(PrefetchServiceImpl);
};

Powered by Google App Engine
This is Rietveld 408576698