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

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: 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..af5e4f9cb3eb774097632e074e36a6818fce278c 100644
--- a/components/ntp_snippets/content_suggestions_service.h
+++ b/components/ntp_snippets/content_suggestions_service.h
@@ -33,6 +33,9 @@ class ContentSuggestionsService : public KeyedService,
public:
using ImageFetchedCallback =
base::Callback<void(const std::string& suggestion_id, const gfx::Image&)>;
+ using DismissedSuggestionsCallback = base::Callback<void(
+ Category category,
+ std::vector<ContentSuggestion> dismissed_suggestions)>;
class Observer {
public:
@@ -135,9 +138,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

Powered by Google App Engine
This is Rietveld 408576698