Commit 02631754 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Convert components/favicon away from base::Bind/base::Callback

base::Bind/base::Callback are deprecated in favor of either
base::BindOnce/base::OnceCallback or base::BindRepeating/
base::RepeatingCallback (depending on whether the callback
is invoked once or multiple time).

Convert all uses of base::Bind/base::Callback in components/favicon
to the recommended methods/types.

Bug: 1007688
Change-Id: I2554067448ac8ac8d27776a7c0e9d1977568cd57
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1832809
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701950}
parent e39fa0bb
...@@ -226,8 +226,9 @@ void FaviconHandler::FetchFavicon(const GURL& page_url, bool is_same_document) { ...@@ -226,8 +226,9 @@ void FaviconHandler::FetchFavicon(const GURL& page_url, bool is_same_document) {
// we get <link rel="icon"> candidates (FaviconHandler::OnUpdateCandidates()). // we get <link rel="icon"> candidates (FaviconHandler::OnUpdateCandidates()).
service_->GetFaviconForPageURL( service_->GetFaviconForPageURL(
last_page_url_, icon_types_, preferred_icon_size(), last_page_url_, icon_types_, preferred_icon_size(),
base::Bind(&FaviconHandler::OnFaviconDataForInitialURLFromFaviconService, base::BindOnce(
base::Unretained(this)), &FaviconHandler::OnFaviconDataForInitialURLFromFaviconService,
base::Unretained(this)),
&cancelable_task_tracker_for_page_url_); &cancelable_task_tracker_for_page_url_);
} }
...@@ -360,8 +361,9 @@ void FaviconHandler::OnUpdateCandidates( ...@@ -360,8 +361,9 @@ void FaviconHandler::OnUpdateCandidates(
// mappings only if the manifest URL is cached. // mappings only if the manifest URL is cached.
GetFaviconAndUpdateMappingsUnlessIncognito( GetFaviconAndUpdateMappingsUnlessIncognito(
/*icon_url=*/manifest_url_, favicon_base::IconType::kWebManifestIcon, /*icon_url=*/manifest_url_, favicon_base::IconType::kWebManifestIcon,
base::Bind(&FaviconHandler::OnFaviconDataForManifestFromFaviconService, base::BindOnce(
base::Unretained(this))); &FaviconHandler::OnFaviconDataForManifestFromFaviconService,
base::Unretained(this)));
} }
void FaviconHandler::OnFaviconDataForManifestFromFaviconService( void FaviconHandler::OnFaviconDataForManifestFromFaviconService(
...@@ -621,7 +623,7 @@ void FaviconHandler::DownloadCurrentCandidateOrAskFaviconService() { ...@@ -621,7 +623,7 @@ void FaviconHandler::DownloadCurrentCandidateOrAskFaviconService() {
} else { } else {
GetFaviconAndUpdateMappingsUnlessIncognito( GetFaviconAndUpdateMappingsUnlessIncognito(
icon_url, icon_type, icon_url, icon_type,
base::Bind(&FaviconHandler::OnFaviconData, base::Unretained(this))); base::BindOnce(&FaviconHandler::OnFaviconData, base::Unretained(this)));
} }
} }
......
...@@ -23,14 +23,6 @@ ...@@ -23,14 +23,6 @@
#error "This file requires ARC support." #error "This file requires ARC support."
#endif #endif
// Callback for the download of favicon.
using ImageDownloadCallback =
base::Callback<void(int image_id,
int http_status_code,
const GURL& image_url,
const std::vector<SkBitmap>& bitmaps,
const std::vector<gfx::Size>& sizes)>;
namespace favicon { namespace favicon {
// static // static
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment