#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/services/filesystem/directory_impl.h"
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/containers/heap_array.h"
#include "base/files/file.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "build/build_config.h"
#include "components/services/filesystem/util.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
namespace filesystem {
DirectoryImpl::DirectoryImpl(base::FilePath directory_path,
scoped_refptr<SharedTempDir> temp_dir)
: … { … }
DirectoryImpl::~DirectoryImpl() { … }
void DirectoryImpl::Read(ReadCallback callback) { … }
void DirectoryImpl::OpenFileHandle(const std::string& raw_path,
uint32_t open_flags,
OpenFileHandleCallback callback) { … }
void DirectoryImpl::OpenFileHandles(
std::vector<mojom::FileOpenDetailsPtr> details,
OpenFileHandlesCallback callback) { … }
void DirectoryImpl::OpenDirectory(
const std::string& raw_path,
mojo::PendingReceiver<mojom::Directory> receiver,
uint32_t open_flags,
OpenDirectoryCallback callback) { … }
void DirectoryImpl::Rename(const std::string& raw_old_path,
const std::string& raw_new_path,
RenameCallback callback) { … }
void DirectoryImpl::Replace(const std::string& raw_old_path,
const std::string& raw_new_path,
ReplaceCallback callback) { … }
void DirectoryImpl::Delete(const std::string& raw_path,
uint32_t delete_flags,
DeleteCallback callback) { … }
void DirectoryImpl::Exists(const std::string& raw_path,
ExistsCallback callback) { … }
void DirectoryImpl::IsWritable(const std::string& raw_path,
IsWritableCallback callback) { … }
void DirectoryImpl::Flush(FlushCallback callback) { … }
void DirectoryImpl::StatFile(const std::string& raw_path,
StatFileCallback callback) { … }
void DirectoryImpl::Clone(mojo::PendingReceiver<mojom::Directory> receiver) { … }
void DirectoryImpl::ReadEntireFile(const std::string& raw_path,
ReadEntireFileCallback callback) { … }
void DirectoryImpl::WriteFile(const std::string& raw_path,
const std::vector<uint8_t>& data,
WriteFileCallback callback) { … }
base::File DirectoryImpl::OpenFileHandleImpl(const std::string& raw_path,
uint32_t open_flags) { … }
}