#include "components/favicon/core/large_icon_worker.h"
#include <vector>
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/no_destructor.h"
#include "base/task/task_runner.h"
#include "base/task/thread_pool.h"
#include "components/favicon/core/favicon_service.h"
#include "components/favicon_base/fallback_icon_style.h"
#include "skia/ext/image_operations.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/geometry/size.h"
namespace favicon {
BASE_FEATURE(…);
NoBigEnoughIconBehavior;
namespace {
bool ShouldReturnBitmap(const favicon_base::FaviconRawBitmapResult& db_result,
int min_source_size,
NoBigEnoughIconBehavior no_big_enough_icon_behavior) { … }
gfx::Image ResizeLargeIconOnBackgroundThread(
const favicon_base::FaviconRawBitmapResult& db_result,
int desired_size) { … }
void ProcessIconOnBackgroundThread(
const favicon_base::FaviconRawBitmapResult& db_result,
int min_source_size,
int size_to_resize_to,
LargeIconService::NoBigEnoughIconBehavior no_big_enough_icon_behavior,
favicon_base::FaviconRawBitmapResult* raw_result,
SkBitmap* bitmap,
GURL* icon_url,
std::unique_ptr<favicon_base::FallbackIconStyle>* fallback_icon_style) { … }
}
LargeIconWorker::LargeIconWorker(
int min_source_size_in_pixel,
int size_in_pixel_to_resize_to,
NoBigEnoughIconBehavior no_big_enough_icon_behavior,
favicon_base::LargeIconCallback raw_bitmap_callback,
favicon_base::LargeIconImageCallback image_callback,
base::CancelableTaskTracker* tracker)
: … { … }
LargeIconWorker::~LargeIconWorker() = default;
void LargeIconWorker::OnIconLookupComplete(
const favicon_base::FaviconRawBitmapResult& db_result) { … }
base::CancelableTaskTracker::TaskId LargeIconWorker::GetLargeIconRawBitmap(
FaviconService* favicon_service,
const GURL& page_url,
int min_source_size_in_pixel,
int size_in_pixel_to_resize_to,
NoBigEnoughIconBehavior no_big_enough_icon_behavior,
favicon_base::LargeIconCallback raw_bitmap_callback,
favicon_base::LargeIconImageCallback image_callback,
base::CancelableTaskTracker* tracker) { … }
void LargeIconWorker::OnIconProcessingComplete() { … }
}