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

Unified Diff: components/image_fetcher/ios/ios_image_data_fetcher_wrapper.mm

Issue 2677993002: Use IOSImageDataFetcherWrapper for favicon (Closed)
Patch Set: Created 3 years, 10 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/image_fetcher/ios/ios_image_data_fetcher_wrapper.mm
diff --git a/components/image_fetcher/ios/ios_image_data_fetcher_wrapper.mm b/components/image_fetcher/ios/ios_image_data_fetcher_wrapper.mm
index 30eeb6b16a5020ede34d0863c39e73aa82c0de32..076a45ff8200dc338afad9d7b9ec08ed4540d31d 100644
--- a/components/image_fetcher/ios/ios_image_data_fetcher_wrapper.mm
+++ b/components/image_fetcher/ios/ios_image_data_fetcher_wrapper.mm
@@ -112,7 +112,8 @@ IOSImageDataFetcherWrapper::CallbackForImageDataFetcher(
IOSImageDataFetcherCallback callback) {
scoped_refptr<base::TaskRunner> task_runner = task_runner_;
- return base::BindBlockArc(^(const std::string& image_data) {
+ return base::BindBlockArc(^(const std::string& image_data,
+ int http_response_code) {
// Create a NSData from the returned data and notify the callback.
NSData* data =
[NSData dataWithBytes:image_data.data() length:image_data.size()];
@@ -120,14 +121,16 @@ IOSImageDataFetcherWrapper::CallbackForImageDataFetcher(
if (data.length < 12 ||
image_data.compare(0, 4, kWEBPFirstMagicPattern) != 0 ||
image_data.compare(8, 4, kWEBPSecondMagicPattern) != 0) {
- callback(data);
+ callback(http_response_code, data);
return;
}
// The image is a webp image.
base::PostTaskAndReplyWithResult(task_runner.get(), FROM_HERE,
base::Bind(&DecodeWebpImage, data),
- base::BindBlockArc(callback));
+ base::BindBlockArc(^(NSData* data) {
+ callback(http_response_code, data);
+ }));
});
}

Powered by Google App Engine
This is Rietveld 408576698