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

Unified Diff: components/ntp_snippets/content_suggestions_service.h

Issue 2774663002: [Remote suggestions] Refactor the scheduler (Closed)
Patch Set: Add missing files & make it compile Created 3 years, 9 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/ntp_snippets/content_suggestions_service.h
diff --git a/components/ntp_snippets/content_suggestions_service.h b/components/ntp_snippets/content_suggestions_service.h
index b207e065b472820fe6117cb086385d66c4ad46d2..d248009265a7936027d27a820bfff37443298cb4 100644
--- a/components/ntp_snippets/content_suggestions_service.h
+++ b/components/ntp_snippets/content_suggestions_service.h
@@ -24,6 +24,7 @@
#include "components/ntp_snippets/category_rankers/category_ranker.h"
#include "components/ntp_snippets/category_status.h"
#include "components/ntp_snippets/content_suggestions_provider.h"
+#include "components/ntp_snippets/remote/remote_suggestions_scheduler.h"
#include "components/ntp_snippets/user_classifier.h"
#include "components/signin/core/browser/signin_manager.h"
@@ -33,7 +34,6 @@ class PrefRegistrySimple;
namespace ntp_snippets {
class RemoteSuggestionsProvider;
-class RemoteSuggestionsScheduler;
// Retrieves suggestions from a number of ContentSuggestionsProviders and serves
// them grouped into categories. There can be at most one provider per category.
@@ -225,11 +225,12 @@ class ContentSuggestionsService : public KeyedService,
// factory. The interface is suited for informing about external events that
// have influence on scheduling remote fetches.
void set_remote_suggestions_scheduler(
- ntp_snippets::RemoteSuggestionsScheduler* remote_suggestions_scheduler) {
- remote_suggestions_scheduler_ = remote_suggestions_scheduler;
+ std::unique_ptr<ntp_snippets::RemoteSuggestionsScheduler>
+ remote_suggestions_scheduler) {
+ remote_suggestions_scheduler_ = std::move(remote_suggestions_scheduler);
}
RemoteSuggestionsScheduler* remote_suggestions_scheduler() {
- return remote_suggestions_scheduler_;
+ return remote_suggestions_scheduler_.get();
}
UserClassifier* user_classifier() { return &user_classifier_; }
@@ -341,8 +342,9 @@ class ContentSuggestionsService : public KeyedService,
RemoteSuggestionsProvider* remote_suggestions_provider_;
// Interface for informing about external events that have influence on
- // scheduling remote fetches. Not owned.
- RemoteSuggestionsScheduler* remote_suggestions_scheduler_;
+ // scheduling remote fetches.
+ std::unique_ptr<ntp_snippets::RemoteSuggestionsScheduler>
+ remote_suggestions_scheduler_;
PrefService* pref_service_;

Powered by Google App Engine
This is Rietveld 408576698