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

Unified Diff: components/ntp_snippets/content_suggestions_service.h

Issue 2260783002: Make GetDismissedSuggestionsForDebugging asynchronous (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace function pointer, use multiple if-continue Created 4 years, 4 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 ee74d49355da6dfa3578f10b5fbc01d3f002cef7..cc53c13195e037d06371d798b51b960efc9f7427 100644
--- a/components/ntp_snippets/content_suggestions_service.h
+++ b/components/ntp_snippets/content_suggestions_service.h
@@ -33,6 +33,8 @@ class ContentSuggestionsService : public KeyedService,
public:
using ImageFetchedCallback =
base::Callback<void(const std::string& suggestion_id, const gfx::Image&)>;
+ using DismissedSuggestionsCallback = base::Callback<void(
+ std::vector<ContentSuggestion> dismissed_suggestions)>;
class Observer {
public:
@@ -135,9 +137,11 @@ class ContentSuggestionsService : public KeyedService,
// Only for debugging use through the internals page.
// Retrieves suggestions of the given |category| that have previously been
// dismissed and are still stored in the respective provider. If the
- // provider doesn't store dismissed suggestions, this returns an empty vector.
- std::vector<ContentSuggestion> GetDismissedSuggestionsForDebugging(
- Category category);
+ // provider doesn't store dismissed suggestions, the callback receives an
+ // empty vector. The callback may be called synchronously.
+ void GetDismissedSuggestionsForDebugging(
+ Category category,
+ const DismissedSuggestionsCallback& callback);
// Only for debugging use through the internals page. Some providers
// internally store a list of dismissed suggestions to prevent them from
« no previous file with comments | « components/ntp_snippets/content_suggestions_provider.h ('k') | components/ntp_snippets/content_suggestions_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698