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/bookmarks/bookmark_suggestions_provider.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/bookmarks/bookmark_suggestions_provider.cc
diff --git a/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc b/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc
index 04395e5c570d511e5f7abd467f852a0437dedffc..00a08d19764872d97ec94186e39110139e2b632e 100644
--- a/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc
+++ b/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc
@@ -127,9 +127,9 @@ void BookmarkSuggestionsProvider::ClearCachedSuggestionsForDebugging(
// Ignored.
}
-std::vector<ContentSuggestion>
-BookmarkSuggestionsProvider::GetDismissedSuggestionsForDebugging(
- Category category) {
+void BookmarkSuggestionsProvider::GetDismissedSuggestionsForDebugging(
+ Category category,
+ const DismissedSuggestionsCallback& callback) {
DCHECK_EQ(category, provided_category_);
std::vector<const BookmarkNode*> bookmarks =
GetDismissedBookmarksForDebugging(bookmark_model_);
@@ -137,7 +137,7 @@ BookmarkSuggestionsProvider::GetDismissedSuggestionsForDebugging(
std::vector<ContentSuggestion> suggestions;
for (const BookmarkNode* bookmark : bookmarks)
suggestions.emplace_back(ConvertBookmark(bookmark));
- return suggestions;
+ callback.Run(std::move(suggestions));
}
void BookmarkSuggestionsProvider::ClearDismissedSuggestionsForDebugging(

Powered by Google App Engine
This is Rietveld 408576698