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

Unified Diff: components/ntp_snippets/content_suggestions_service.cc

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.cc
diff --git a/components/ntp_snippets/content_suggestions_service.cc b/components/ntp_snippets/content_suggestions_service.cc
index f9631e3115176f6361e628bb40c364a1c6d28394..6cabf8b12ebaeca6fea5cd37c4a5fc98598f0a84 100644
--- a/components/ntp_snippets/content_suggestions_service.cc
+++ b/components/ntp_snippets/content_suggestions_service.cc
@@ -104,13 +104,14 @@ void ContentSuggestionsService::ClearCachedSuggestionsForDebugging(
iterator->second->ClearCachedSuggestionsForDebugging(category);
}
-std::vector<ContentSuggestion>
-ContentSuggestionsService::GetDismissedSuggestionsForDebugging(
- Category category) {
+void ContentSuggestionsService::GetDismissedSuggestionsForDebugging(
+ Category category,
+ const DismissedSuggestionsCallback& callback) {
auto iterator = providers_by_category_.find(category);
- if (iterator == providers_by_category_.end())
- return std::vector<ContentSuggestion>();
- return iterator->second->GetDismissedSuggestionsForDebugging(category);
+ if (iterator != providers_by_category_.end())
+ iterator->second->GetDismissedSuggestionsForDebugging(category, callback);
+ else
+ callback.Run(std::vector<ContentSuggestion>());
}
void ContentSuggestionsService::ClearDismissedSuggestionsForDebugging(
« no previous file with comments | « components/ntp_snippets/content_suggestions_service.h ('k') | components/ntp_snippets/content_suggestions_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698