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

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: . 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 41ea6740c324917e33325ce2789597a896ea7d78..17b16db9605be1817d8b33b310cfa8ea205d13a4 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,

Powered by Google App Engine
This is Rietveld 408576698