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

Unified Diff: chrome/browser/search/suggestions/image_fetcher_impl.cc

Issue 2047713002: [NTP Snippets] Cache images in a LevelDB (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@protodb_get
Patch Set: add TODOs Created 4 years, 6 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: chrome/browser/search/suggestions/image_fetcher_impl.cc
diff --git a/chrome/browser/search/suggestions/image_fetcher_impl.cc b/chrome/browser/search/suggestions/image_fetcher_impl.cc
index f2173a1f4540fb1eb9a7467177e5db5631ced776..9d046f0a05ba7e381075b2a7b91af406c78d8b55 100644
--- a/chrome/browser/search/suggestions/image_fetcher_impl.cc
+++ b/chrome/browser/search/suggestions/image_fetcher_impl.cc
@@ -63,8 +63,13 @@ void ImageFetcherImpl::StartOrQueueNetworkRequest(
void ImageFetcherImpl::OnImageURLFetched(const GURL& image_url,
const std::string& image_data) {
- // TODO(markusheintz): Add a method OnImageDataFetched on the delegate and
- // call that here.
+ // Inform the ImageFetcherDelegate.
+ if (delegate_) {
+ auto it = pending_net_requests_.find(image_url);
+ DCHECK(it != pending_net_requests_.end());
+ delegate_->OnImageDataFetched(it->second.id, image_data);
+ }
+
image_decoder_->DecodeImage(
image_data,
base::Bind(&ImageFetcherImpl::OnImageDecoded,
« no previous file with comments | « chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc ('k') | components/image_fetcher/image_fetcher_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698