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

Side by Side Diff: components/ntp_snippets/remote/remote_suggestions_provider_impl.cc

Issue 2757643002: components/image_fetcher: Expose RequestMetadata from ImageFetcher (Closed)
Patch Set: logo_bridge Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/ntp_snippets/remote/remote_suggestions_provider_impl.h" 5 #include "components/ntp_snippets/remote/remote_suggestions_provider_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 const std::string& image_data) { 187 const std::string& image_data) {
188 if (image_data.empty()) { 188 if (image_data.empty()) {
189 return; 189 return;
190 } 190 }
191 database_->SaveImage(id_within_category, image_data); 191 database_->SaveImage(id_within_category, image_data);
192 } 192 }
193 193
194 void CachedImageFetcher::OnImageDecodingDone( 194 void CachedImageFetcher::OnImageDecodingDone(
195 const ImageFetchedCallback& callback, 195 const ImageFetchedCallback& callback,
196 const std::string& id_within_category, 196 const std::string& id_within_category,
197 const gfx::Image& image) { 197 const gfx::Image& image,
198 const image_fetcher::RequestMetadata& metadata) {
198 callback.Run(image); 199 callback.Run(image);
199 } 200 }
200 201
201 void CachedImageFetcher::OnImageFetchedFromDatabase( 202 void CachedImageFetcher::OnImageFetchedFromDatabase(
202 const ImageFetchedCallback& callback, 203 const ImageFetchedCallback& callback,
203 const ContentSuggestion::ID& suggestion_id, 204 const ContentSuggestion::ID& suggestion_id,
204 const GURL& url, 205 const GURL& url,
205 std::string data) { // SnippetImageCallback requires by-value. 206 std::string data) { // SnippetImageCallback requires by-value.
206 // The image decoder is null in tests. 207 // The image decoder is null in tests.
207 if (image_fetcher_->GetImageDecoder() && !data.empty()) { 208 if (image_fetcher_->GetImageDecoder() && !data.empty()) {
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 RemoteSuggestionsProviderImpl::CategoryContent::CategoryContent( 1271 RemoteSuggestionsProviderImpl::CategoryContent::CategoryContent(
1271 CategoryContent&&) = default; 1272 CategoryContent&&) = default;
1272 1273
1273 RemoteSuggestionsProviderImpl::CategoryContent::~CategoryContent() = default; 1274 RemoteSuggestionsProviderImpl::CategoryContent::~CategoryContent() = default;
1274 1275
1275 RemoteSuggestionsProviderImpl::CategoryContent& 1276 RemoteSuggestionsProviderImpl::CategoryContent&
1276 RemoteSuggestionsProviderImpl::CategoryContent::operator=(CategoryContent&&) = 1277 RemoteSuggestionsProviderImpl::CategoryContent::operator=(CategoryContent&&) =
1277 default; 1278 default;
1278 1279
1279 } // namespace ntp_snippets 1280 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698