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

Unified Diff: ios/web/web_state/web_state_impl.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: ios/web/web_state/web_state_impl.mm
diff --git a/ios/web/web_state/web_state_impl.mm b/ios/web/web_state/web_state_impl.mm
index 864fee37ca2eef90ab3681eb6bae139bd29132b4..01bc800b0b1ff302d751ad997e5e1e6f8b9686df 100644
--- a/ios/web/web_state/web_state_impl.mm
+++ b/ios/web/web_state/web_state_impl.mm
@@ -565,40 +565,6 @@ bool WebStateImpl::ShouldAllowResponse(NSURLResponse* response) {
#pragma mark - RequestTracker management
-int WebStateImpl::DownloadImage(
- const GURL& url,
- bool is_favicon,
- uint32_t max_bitmap_size,
- bool bypass_cache,
- const ImageDownloadCallback& callback) {
- // |is_favicon| specifies whether the download of the image occurs with
- // cookies or not. Currently, only downloads without cookies are supported.
- // |bypass_cache| is ignored since the downloads never go through a cache.
- DCHECK(is_favicon);
-
- static int downloaded_image_count = 0;
- int local_download_id = ++downloaded_image_count;
- __block web::WebState::ImageDownloadCallback local_image_callback = callback;
- __block GURL local_url(url);
- ImageFetchedCallback local_callback =
- ^(const GURL&, const int response_code, NSData* data) {
- std::vector<SkBitmap> frames;
- std::vector<gfx::Size> sizes;
- if (data) {
- frames = skia::ImageDataToSkBitmaps(data);
- for (auto& frame : frames) {
- sizes.push_back(gfx::Size(frame.width(), frame.height()));
- }
- }
- if (response_code != net::URLFetcher::RESPONSE_CODE_INVALID) {
- local_image_callback.Run(local_download_id, response_code, local_url,
- frames, sizes);
- }
- };
- image_fetcher_->StartDownload(url, local_callback);
- return downloaded_image_count;
-}
-
service_manager::InterfaceRegistry* WebStateImpl::GetMojoInterfaceRegistry() {
if (!mojo_interface_registry_) {
mojo_interface_registry_ =

Powered by Google App Engine
This is Rietveld 408576698