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

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: 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..4574f8199d9663756ae8c7c67a212051995b2a50 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;
+ return callback.Run(category, std::move(suggestions));
Marc Treib 2016/08/19 10:07:51 No "return"
Philipp Keck 2016/08/19 12:11:53 Done. Why does that even compile ...
}
void BookmarkSuggestionsProvider::ClearDismissedSuggestionsForDebugging(

Powered by Google App Engine
This is Rietveld 408576698