#include "components/paint_preview/browser/paint_preview_file_mixin.h"
#include <string_view>
#include <utility>
#include "base/files/file_util.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/trace_event/common/trace_event_common.h"
#include "base/trace_event/trace_event.h"
#include "ui/accessibility/mojom/ax_tree_update.mojom.h"
namespace paint_preview {
namespace {
const char kPaintPreviewDir[] = …;
const char kAxTreeFilename[] = …;
std::pair<PaintPreviewFileMixin::ProtoReadStatus,
std::unique_ptr<PaintPreviewProto>>
GetProto(scoped_refptr<FileManager> file_manager,
const DirectoryKey& key,
std::optional<base::TimeDelta> expiry_horizon) { … }
void OnReadProto(PaintPreviewFileMixin::OnReadProtoCallback callback,
std::pair<PaintPreviewFileMixin::ProtoReadStatus,
std::unique_ptr<PaintPreviewProto>> result) { … }
}
PaintPreviewFileMixin::PaintPreviewFileMixin(
const base::FilePath& path,
std::string_view ascii_feature_name)
: … { … }
PaintPreviewFileMixin::~PaintPreviewFileMixin() = default;
void PaintPreviewFileMixin::GetCapturedPaintPreviewProto(
const DirectoryKey& key,
std::optional<base::TimeDelta> expiry_horizon,
OnReadProtoCallback on_read_proto_callback) { … }
void PaintPreviewFileMixin::WriteAXTreeUpdate(
const DirectoryKey& key,
base::OnceCallback<void(bool)> finished_callback,
ui::AXTreeUpdate& ax_tree_update) { … }
void PaintPreviewFileMixin::GetAXTreeUpdate(const DirectoryKey& key,
OnReadAXTree callback) { … }
}