#include "components/services/paint_preview_compositor/paint_preview_compositor_collection_impl.h"
#include <utility>
#include "base/features.h"
#include "base/memory/discardable_memory.h"
#include "base/memory/discardable_memory_allocator.h"
#include "base/system/sys_info.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/thread_pool.h"
#include "build/build_config.h"
#include "components/crash/core/common/crash_key.h"
#include "content/public/utility/utility_thread.h"
#include "skia/ext/font_utils.h"
#include "third_party/skia/include/core/SkFontMgr.h"
#include "third_party/skia/include/core/SkGraphics.h"
#include "third_party/skia/include/ports/SkFontConfigInterface.h"
#if BUILDFLAG(IS_WIN)
#include "content/public/child/dwrite_font_proxy_init_win.h"
#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#include "components/services/font/public/cpp/font_loader.h"
#endif
namespace paint_preview {
namespace {
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS)
const base::FeatureParam<bool> kPartialLowEndModeExcludePaintPreviewCompositor{
&base::features::kPartialLowEndModeOnMidRangeDevices,
"exclude-paint-preview-compositor", false};
#endif
crash_reporter::CrashKeyString<32> g_in_shutdown_key(
"paint-preview-compositor-in-shutdown");
}
PaintPreviewCompositorCollectionImpl::PaintPreviewCompositorCollectionImpl(
mojo::PendingReceiver<mojom::PaintPreviewCompositorCollection> receiver,
bool initialize_environment,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner)
: … { … }
PaintPreviewCompositorCollectionImpl::~PaintPreviewCompositorCollectionImpl() { … }
void PaintPreviewCompositorCollectionImpl::SetDiscardableSharedMemoryManager(
mojo::PendingRemote<
discardable_memory::mojom::DiscardableSharedMemoryManager> manager) { … }
void PaintPreviewCompositorCollectionImpl::CreateCompositor(
mojo::PendingReceiver<mojom::PaintPreviewCompositor> receiver,
PaintPreviewCompositorCollectionImpl::CreateCompositorCallback callback) { … }
void PaintPreviewCompositorCollectionImpl::OnMemoryPressure(
base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) { … }
void PaintPreviewCompositorCollectionImpl::ListCompositors(
ListCompositorsCallback callback) { … }
void PaintPreviewCompositorCollectionImpl::OnDisconnect(
const base::UnguessableToken& id) { … }
}