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

Unified Diff: components/ntp_snippets/ntp_snippets_service.h

Issue 1863133003: [NTP Snippets] Re-fetch snippets on ML changes only when the hosts actually change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snippets_thumbnails
Patch Set: s/vector/set/ Created 4 years, 8 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 | « components/ntp_snippets/ntp_snippets_fetcher.cc ('k') | components/ntp_snippets/ntp_snippets_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/ntp_snippets_service.h
diff --git a/components/ntp_snippets/ntp_snippets_service.h b/components/ntp_snippets/ntp_snippets_service.h
index ff2b039c00bb6771a4bb3bfab7e67d953349d1ba..4b2f20aa7e4ca2fe220e61fe4ed623ddddfc549b 100644
--- a/components/ntp_snippets/ntp_snippets_service.h
+++ b/components/ntp_snippets/ntp_snippets_service.h
@@ -7,6 +7,7 @@
#include <stddef.h>
+#include <set>
#include <string>
#include <vector>
@@ -118,7 +119,7 @@ class NTPSnippetsService : public KeyedService {
scoped_ptr<base::Value> parsed);
void OnJsonError(const std::string& snippets_json, const std::string& error);
- void FetchSnippetsImpl(const std::vector<std::string>& hosts);
+ void FetchSnippetsImpl(const std::set<std::string>& hosts);
// Expects a top-level dictionary containing a "recos" list, which will be
// passed to LoadFromListValue().
@@ -136,6 +137,9 @@ class NTPSnippetsService : public KeyedService {
void LoadDiscardedSnippetsFromPrefs();
void StoreDiscardedSnippetsToPrefs();
+ std::set<std::string> GetSnippetHostsFromPrefs() const;
+ void StoreSnippetHostsToPrefs(const std::set<std::string>& hosts);
+
bool HasDiscardedSnippet(const GURL& url) const;
void RemoveExpiredSnippets();
« no previous file with comments | « components/ntp_snippets/ntp_snippets_fetcher.cc ('k') | components/ntp_snippets/ntp_snippets_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698