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

Unified Diff: components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc

Issue 2212313002: Call FetchImageCallback asynchronously when no thumbnail exists (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmarksprovider
Patch Set: Marc's comments 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
« no previous file with comments | « no previous file | components/ntp_snippets/content_suggestions_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c5a88cec278e582af22d3fe63f8ace50d055221b..85457d2d8d568928e35f897e412e3415de495180 100644
--- a/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc
+++ b/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc
@@ -7,11 +7,15 @@
#include <utility>
#include <vector>
+#include "base/bind.h"
+#include "base/location.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/ntp_snippets/bookmarks/bookmark_last_visit_utils.h"
#include "components/ntp_snippets/category_factory.h"
#include "components/ntp_snippets/content_suggestion.h"
+#include "ui/gfx/image/image.h"
using bookmarks::BookmarkModel;
using bookmarks::BookmarkNode;
@@ -69,7 +73,8 @@ void BookmarkSuggestionsProvider::DismissSuggestion(
void BookmarkSuggestionsProvider::FetchSuggestionImage(
const std::string& suggestion_id,
const ImageFetchedCallback& callback) {
- callback.Run(suggestion_id, gfx::Image());
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, suggestion_id, gfx::Image()));
}
void BookmarkSuggestionsProvider::ClearCachedSuggestionsForDebugging() {
« no previous file with comments | « no previous file | components/ntp_snippets/content_suggestions_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698