#include "third_party/blink/renderer/platform/graphics/canvas_hibernation_handler.h"
#include "base/feature_list.h"
#include "base/memory/post_delayed_memory_reduction_task.h"
#include "base/timer/elapsed_timer.h"
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/memory_dump_request_args.h"
#include "third_party/blink/renderer/platform/bindings/buildflags.h"
#include "third_party/blink/renderer/platform/graphics/memory_managed_paint_recorder.h"
#include "third_party/blink/renderer/platform/instrumentation/histogram.h"
#include "third_party/blink/renderer/platform/scheduler/public/main_thread.h"
#include "third_party/blink/renderer/platform/scheduler/public/worker_pool.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_std.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
#include "third_party/blink/renderer/platform/wtf/hash_set.h"
#include "third_party/skia/include/codec/SkCodec.h"
#include "third_party/skia/include/codec/SkPngDecoder.h"
#include "third_party/skia/include/core/SkAlphaType.h"
#include "third_party/skia/include/core/SkData.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/encode/SkPngEncoder.h"
#if BUILDFLAG(HAS_ZSTD_COMPRESSION)
#include "third_party/zstd/src/lib/zstd.h"
#endif
namespace blink {
BASE_FEATURE(…);
HibernatedCanvasMemoryDumpProvider&
HibernatedCanvasMemoryDumpProvider::GetInstance() { … }
void HibernatedCanvasMemoryDumpProvider::Register(
CanvasHibernationHandler* handler) { … }
void HibernatedCanvasMemoryDumpProvider::Unregister(
CanvasHibernationHandler* handler) { … }
bool HibernatedCanvasMemoryDumpProvider::OnMemoryDump(
const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd) { … }
HibernatedCanvasMemoryDumpProvider::HibernatedCanvasMemoryDumpProvider() { … }
CanvasHibernationHandler::~CanvasHibernationHandler() { … }
void CanvasHibernationHandler::SaveForHibernation(
sk_sp<SkImage>&& image,
std::unique_ptr<MemoryManagedPaintRecorder> recorder) { … }
void CanvasHibernationHandler::OnAfterHibernation(uint64_t epoch) { … }
void CanvasHibernationHandler::OnEncoded(
std::unique_ptr<CanvasHibernationHandler::BackgroundTaskParams> params,
sk_sp<SkData> encoded) { … }
scoped_refptr<base::SingleThreadTaskRunner>
CanvasHibernationHandler::GetMainThreadTaskRunner() const { … }
void CanvasHibernationHandler::Encode(
std::unique_ptr<CanvasHibernationHandler::BackgroundTaskParams> params) { … }
sk_sp<SkImage> CanvasHibernationHandler::GetImage() { … }
void CanvasHibernationHandler::Clear() { … }
size_t CanvasHibernationHandler::memory_size() const { … }
size_t CanvasHibernationHandler::ImageMemorySize(const SkImage& image) { … }
size_t CanvasHibernationHandler::original_memory_size() const { … }
}