#include "third_party/blink/renderer/modules/file_system_access/file_system_access_regular_file_delegate.h"
#include "base/files/file.h"
#include "base/files/file_error_or.h"
#include "base/memory/scoped_refptr.h"
#include "base/numerics/checked_math.h"
#include "base/task/sequenced_task_runner.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_file_handle.mojom-blink.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_file_modification_host.mojom-blink.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/modules/file_system_access/file_system_access_capacity_tracker.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
namespace blink {
FileSystemAccessFileDelegate* FileSystemAccessFileDelegate::Create(
ExecutionContext* context,
mojom::blink::FileSystemAccessRegularFilePtr regular_file) { … }
FileSystemAccessRegularFileDelegate::FileSystemAccessRegularFileDelegate(
ExecutionContext* context,
base::File backing_file,
int64_t backing_file_size,
mojo::PendingRemote<mojom::blink::FileSystemAccessFileModificationHost>
file_modification_host_remote,
base::PassKey<FileSystemAccessFileDelegate>)
: … { … }
base::FileErrorOr<int> FileSystemAccessRegularFileDelegate::Read(
int64_t offset,
base::span<uint8_t> data) { … }
base::FileErrorOr<int> FileSystemAccessRegularFileDelegate::Write(
int64_t offset,
const base::span<uint8_t> data) { … }
base::FileErrorOr<int64_t> FileSystemAccessRegularFileDelegate::GetLength() { … }
base::FileErrorOr<bool> FileSystemAccessRegularFileDelegate::SetLength(
int64_t new_length) { … }
bool FileSystemAccessRegularFileDelegate::Flush() { … }
void FileSystemAccessRegularFileDelegate::Close() { … }
}