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

Unified Diff: components/ntp_snippets/ntp_snippets_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/ntp_snippets_service.cc
diff --git a/components/ntp_snippets/ntp_snippets_service.cc b/components/ntp_snippets/ntp_snippets_service.cc
index af70250a0c84904732e9ed7e23ba02f38c20bb37..c342766044520d0f4e01c4b864519dd7c38278a9 100644
--- a/components/ntp_snippets/ntp_snippets_service.cc
+++ b/components/ntp_snippets/ntp_snippets_service.cc
@@ -337,8 +337,9 @@ void NTPSnippetsService::ClearCachedSuggestionsForDebugging(Category category) {
NotifyNewSuggestions();
}
-std::vector<ContentSuggestion>
-NTPSnippetsService::GetDismissedSuggestionsForDebugging(Category category) {
+void NTPSnippetsService::GetDismissedSuggestionsForDebugging(
+ Category category,
+ const DismissedSuggestionsCallback& callback) {
DCHECK_EQ(category, provided_category_);
std::vector<ContentSuggestion> result;
for (const std::unique_ptr<NTPSnippet>& snippet : dismissed_snippets_) {
@@ -356,7 +357,7 @@ NTPSnippetsService::GetDismissedSuggestionsForDebugging(Category category) {
suggestion.set_score(snippet->score());
result.emplace_back(std::move(suggestion));
}
- return result;
+ callback.Run(std::move(result));
}
void NTPSnippetsService::ClearDismissedSuggestionsForDebugging(
« no previous file with comments | « components/ntp_snippets/ntp_snippets_service.h ('k') | components/ntp_snippets/ntp_snippets_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698