Index: components/favicon/ios/web_favicon_driver.mm |
diff --git a/components/favicon/ios/web_favicon_driver.mm b/components/favicon/ios/web_favicon_driver.mm |
index cf5185f2f817f1ab7ef0cdbffceccb3c7255825a..b647dc90c3925f0f50f6daf07d7197e529ee5d28 100644 |
--- a/components/favicon/ios/web_favicon_driver.mm |
+++ b/components/favicon/ios/web_favicon_driver.mm |
@@ -61,7 +61,9 @@ bool WebFaviconDriver::FaviconIsValid() const { |
return item ? item->GetFavicon().valid : false; |
} |
-int WebFaviconDriver::StartDownload(const GURL& url, int max_image_size) { |
+int WebFaviconDriver::DownloadImage(const GURL& url, |
+ int max_image_size, |
+ ImageDownloadCallback callback) { |
if (WasUnableToDownloadFavicon(url)) { |
DVLOG(1) << "Skip Failed FavIcon: " << url; |
return 0; |
@@ -70,8 +72,6 @@ int WebFaviconDriver::StartDownload(const GURL& url, int max_image_size) { |
static int downloaded_image_count = 0; |
int local_download_id = ++downloaded_image_count; |
- ImageDownloadCallback local_image_callback = base::Bind( |
- &FaviconDriverImpl::DidDownloadFavicon, base::Unretained(this)); |
GURL local_url(url); |
image_fetcher::IOSImageDataFetcherCallback local_callback = |
@@ -88,8 +88,8 @@ int WebFaviconDriver::StartDownload(const GURL& url, int max_image_size) { |
sizes.push_back(gfx::Size(frame.width(), frame.height())); |
} |
} |
- local_image_callback.Run(local_download_id, metadata.response_code, |
- local_url, frames, sizes); |
+ callback.Run(local_download_id, metadata.response_code, local_url, |
+ frames, sizes); |
}; |
image_fetcher_.FetchImageDataWebpDecoded(url, local_callback); |