#include "components/favicon/core/favicon_service_impl.h"
#include <stddef.h>
#include <cmath>
#include <utility>
#include "base/functional/bind.h"
#include "base/hash/hash.h"
#include "base/task/single_thread_task_runner.h"
#include "base/trace_event/trace_event.h"
#include "components/favicon/core/favicon_client.h"
#include "components/favicon_base/favicon_util.h"
#include "components/favicon_base/select_favicon_frames.h"
#include "components/history/core/browser/history_service.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/favicon_size.h"
#include "url/gurl.h"
namespace favicon {
void FaviconServiceImpl::RunFaviconImageCallbackWithBitmapResults(
favicon_base::FaviconImageCallback callback,
int desired_size_in_dip,
const std::vector<favicon_base::FaviconRawBitmapResult>&
favicon_bitmap_results) { … }
FaviconServiceImpl::FaviconServiceImpl(
std::unique_ptr<FaviconClient> favicon_client,
history::HistoryService* history_service)
: … { … }
FaviconServiceImpl::~FaviconServiceImpl() { … }
base::CancelableTaskTracker::TaskId FaviconServiceImpl::GetFaviconImage(
const GURL& icon_url,
favicon_base::FaviconImageCallback callback,
base::CancelableTaskTracker* tracker) { … }
base::CancelableTaskTracker::TaskId FaviconServiceImpl::GetRawFavicon(
const GURL& icon_url,
favicon_base::IconType icon_type,
int desired_size_in_pixel,
favicon_base::FaviconRawBitmapCallback callback,
base::CancelableTaskTracker* tracker) { … }
base::CancelableTaskTracker::TaskId FaviconServiceImpl::GetFavicon(
const GURL& icon_url,
favicon_base::IconType icon_type,
int desired_size_in_dip,
favicon_base::FaviconResultsCallback callback,
base::CancelableTaskTracker* tracker) { … }
base::CancelableTaskTracker::TaskId
FaviconServiceImpl::GetFaviconImageForPageURL(
const GURL& page_url,
favicon_base::FaviconImageCallback callback,
base::CancelableTaskTracker* tracker) { … }
base::CancelableTaskTracker::TaskId FaviconServiceImpl::GetRawFaviconForPageURL(
const GURL& page_url,
const favicon_base::IconTypeSet& icon_types,
int desired_size_in_pixel,
bool fallback_to_host,
favicon_base::FaviconRawBitmapCallback callback,
base::CancelableTaskTracker* tracker) { … }
base::CancelableTaskTracker::TaskId
FaviconServiceImpl::GetLargestRawFaviconForPageURL(
const GURL& page_url,
const std::vector<favicon_base::IconTypeSet>& icon_types,
int minimum_size_in_pixels,
favicon_base::FaviconRawBitmapCallback callback,
base::CancelableTaskTracker* tracker) { … }
base::CancelableTaskTracker::TaskId FaviconServiceImpl::GetFaviconForPageURL(
const GURL& page_url,
const favicon_base::IconTypeSet& icon_types,
int desired_size_in_dip,
favicon_base::FaviconResultsCallback callback,
base::CancelableTaskTracker* tracker) { … }
base::CancelableTaskTracker::TaskId
FaviconServiceImpl::UpdateFaviconMappingsAndFetch(
const base::flat_set<GURL>& page_urls,
const GURL& icon_url,
favicon_base::IconType icon_type,
int desired_size_in_dip,
favicon_base::FaviconResultsCallback callback,
base::CancelableTaskTracker* tracker) { … }
void FaviconServiceImpl::DeleteFaviconMappings(
const base::flat_set<GURL>& page_urls,
favicon_base::IconType icon_type) { … }
base::CancelableTaskTracker::TaskId
FaviconServiceImpl::GetLargestRawFaviconForID(
favicon_base::FaviconID favicon_id,
favicon_base::FaviconRawBitmapCallback callback,
base::CancelableTaskTracker* tracker) { … }
void FaviconServiceImpl::SetFaviconOutOfDateForPage(const GURL& page_url) { … }
void FaviconServiceImpl::TouchOnDemandFavicon(const GURL& icon_url) { … }
void FaviconServiceImpl::SetImportedFavicons(
const favicon_base::FaviconUsageDataList& favicon_usage) { … }
void FaviconServiceImpl::AddPageNoVisitForBookmark(
const GURL& url,
const std::u16string& title) { … }
void FaviconServiceImpl::MergeFavicon(
const GURL& page_url,
const GURL& icon_url,
favicon_base::IconType icon_type,
scoped_refptr<base::RefCountedMemory> bitmap_data,
const gfx::Size& pixel_size) { … }
void FaviconServiceImpl::SetFavicons(const base::flat_set<GURL>& page_urls,
const GURL& icon_url,
favicon_base::IconType icon_type,
const gfx::Image& image) { … }
void FaviconServiceImpl::CloneFaviconMappingsForPages(
const GURL& page_url_to_read,
const favicon_base::IconTypeSet& icon_types,
const base::flat_set<GURL>& page_urls_to_write) { … }
void FaviconServiceImpl::CanSetOnDemandFavicons(
const GURL& page_url,
favicon_base::IconType icon_type,
base::OnceCallback<void(bool)> callback) const { … }
void FaviconServiceImpl::SetOnDemandFavicons(
const GURL& page_url,
const GURL& icon_url,
favicon_base::IconType icon_type,
const gfx::Image& image,
base::OnceCallback<void(bool)> callback) { … }
void FaviconServiceImpl::UnableToDownloadFavicon(const GURL& icon_url) { … }
bool FaviconServiceImpl::WasUnableToDownloadFavicon(
const GURL& icon_url) const { … }
void FaviconServiceImpl::ClearUnableToDownloadFavicons() { … }
base::CancelableTaskTracker::TaskId
FaviconServiceImpl::GetFaviconForPageURLImpl(
const GURL& page_url,
const favicon_base::IconTypeSet& icon_types,
const std::vector<int>& desired_sizes_in_pixel,
bool fallback_to_host,
favicon_base::FaviconResultsCallback callback,
base::CancelableTaskTracker* tracker) { … }
}