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

Unified Diff: components/ntp_snippets/content_suggestions_provider.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_provider.h
diff --git a/components/ntp_snippets/content_suggestions_provider.h b/components/ntp_snippets/content_suggestions_provider.h
index 836fd41996ddd1d2589959e73426e70f72194709..57ebcd0b9bfc16912da63676b15e2e7d07d539f6 100644
--- a/components/ntp_snippets/content_suggestions_provider.h
+++ b/components/ntp_snippets/content_suggestions_provider.h
@@ -30,6 +30,8 @@ class ContentSuggestionsProvider {
public:
using ImageFetchedCallback =
base::Callback<void(const std::string& suggestion_id, const gfx::Image&)>;
+ using DismissedSuggestionsCallback = base::Callback<void(
+ std::vector<ContentSuggestion> dismissed_suggestions)>;
// The observer of a provider is notified when new data is available.
class Observer {
@@ -115,9 +117,11 @@ class ContentSuggestionsProvider {
// Used only for debugging purposes. Retrieves suggestions for the given
// |category| that have previously been dismissed and are still stored in the
// provider. If the provider doesn't store dismissed suggestions for the given
- // |category|, it always returns an empty vector.
- virtual std::vector<ContentSuggestion> GetDismissedSuggestionsForDebugging(
- Category category) = 0;
+ // |category|, it always calls the callback with an empty vector. The callback
+ // may be called synchronously.
+ virtual void GetDismissedSuggestionsForDebugging(
+ Category category,
+ const DismissedSuggestionsCallback& callback) = 0;
// Used only for debugging purposes. Clears the cache of dismissed
// suggestions for the given |category|, if present, so that no suggestions

Powered by Google App Engine
This is Rietveld 408576698