#include "third_party/blink/renderer/core/loader/threaded_icon_loader.h"
#include <algorithm>
#include "base/metrics/histogram_macros.h"
#include "base/numerics/safe_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "skia/ext/image_operations.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_data.h"
#include "third_party/blink/public/web/web_image.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/platform/graphics/skia/skia_utils.h"
#include "third_party/blink/renderer/platform/heap/cross_thread_handle.h"
#include "third_party/blink/renderer/platform/image-decoders/image_decoder.h"
#include "third_party/blink/renderer/platform/image-decoders/image_frame.h"
#include "third_party/blink/renderer/platform/image-decoders/segment_reader.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_loader_options.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_request.h"
#include "third_party/blink/renderer/platform/scheduler/public/main_thread.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/scheduler/public/worker_pool.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_base.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_gfx.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
namespace blink {
namespace {
void DecodeSVGOnMainThread(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
scoped_refptr<SegmentReader> data,
gfx::Size resize_dimensions,
CrossThreadOnceFunction<void(SkBitmap, double)> done_callback) { … }
void DecodeAndResizeImage(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
scoped_refptr<SegmentReader> data,
gfx::Size resize_dimensions,
CrossThreadOnceFunction<void(SkBitmap, double)> done_callback) { … }
}
void ThreadedIconLoader::Start(
ExecutionContext* execution_context,
const ResourceRequestHead& resource_request,
const std::optional<gfx::Size>& resize_dimensions,
IconCallback callback) { … }
void ThreadedIconLoader::Stop() { … }
void ThreadedIconLoader::DidReceiveResponse(uint64_t,
const ResourceResponse& response) { … }
void ThreadedIconLoader::DidReceiveData(base::span<const char> data) { … }
void ThreadedIconLoader::DidFinishLoading(uint64_t resource_identifier) { … }
void ThreadedIconLoader::OnBackgroundTaskComplete(SkBitmap icon,
double resize_scale) { … }
void ThreadedIconLoader::DidFail(uint64_t, const ResourceError& error) { … }
void ThreadedIconLoader::DidFailRedirectCheck(uint64_t) { … }
void ThreadedIconLoader::Trace(Visitor* visitor) const { … }
}