#include "third_party/blink/renderer/modules/file_system_access/file_system_file_handle.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_cloud_identifier.mojom-blink.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_error.mojom-blink.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_file_writer.mojom-blink.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_transfer_token.mojom-blink.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_throw_dom_exception.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_file_system_create_sync_access_handle_options.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_file_system_create_writable_options.h"
#include "third_party/blink/renderer/core/fileapi/file.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/modules/file_system_access/file_system_access_error.h"
#include "third_party/blink/renderer/modules/file_system_access/file_system_access_file_delegate.h"
#include "third_party/blink/renderer/modules/file_system_access/file_system_sync_access_handle.h"
#include "third_party/blink/renderer/modules/file_system_access/file_system_writable_file_stream.h"
#include "third_party/blink/renderer/modules/file_system_access/storage_manager_file_system_access.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/file_metadata.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink {
FileSystemAccessErrorPtr;
FileSystemFileHandle::FileSystemFileHandle(
ExecutionContext* context,
const String& name,
mojo::PendingRemote<mojom::blink::FileSystemAccessFileHandle> mojo_ptr)
: … { … }
ScriptPromise<FileSystemWritableFileStream>
FileSystemFileHandle::createWritable(
ScriptState* script_state,
const FileSystemCreateWritableOptions* options,
ExceptionState& exception_state) { … }
ScriptPromise<File> FileSystemFileHandle::getFile(
ScriptState* script_state,
ExceptionState& exception_state) { … }
ScriptPromise<FileSystemSyncAccessHandle>
FileSystemFileHandle::createSyncAccessHandle(ScriptState* script_state,
ExceptionState& exception_state) { … }
ScriptPromise<FileSystemSyncAccessHandle>
FileSystemFileHandle::createSyncAccessHandle(
ScriptState* script_state,
const FileSystemCreateSyncAccessHandleOptions* options,
ExceptionState& exception_state) { … }
void FileSystemFileHandle::CreateSyncAccessHandleImpl(
const FileSystemCreateSyncAccessHandleOptions* options,
ScriptPromiseResolver<FileSystemSyncAccessHandle>* resolver) { … }
mojo::PendingRemote<mojom::blink::FileSystemAccessTransferToken>
FileSystemFileHandle::Transfer() { … }
void FileSystemFileHandle::Trace(Visitor* visitor) const { … }
void FileSystemFileHandle::QueryPermissionImpl(
bool writable,
base::OnceCallback<void(mojom::blink::PermissionStatus)> callback) { … }
void FileSystemFileHandle::RequestPermissionImpl(
bool writable,
base::OnceCallback<void(mojom::blink::FileSystemAccessErrorPtr,
mojom::blink::PermissionStatus)> callback) { … }
void FileSystemFileHandle::MoveImpl(
mojo::PendingRemote<mojom::blink::FileSystemAccessTransferToken> dest,
const String& new_entry_name,
base::OnceCallback<void(mojom::blink::FileSystemAccessErrorPtr)> callback) { … }
void FileSystemFileHandle::RemoveImpl(
const FileSystemRemoveOptions* options,
base::OnceCallback<void(mojom::blink::FileSystemAccessErrorPtr)> callback) { … }
void FileSystemFileHandle::IsSameEntryImpl(
mojo::PendingRemote<mojom::blink::FileSystemAccessTransferToken> other,
base::OnceCallback<void(mojom::blink::FileSystemAccessErrorPtr, bool)>
callback) { … }
void FileSystemFileHandle::GetUniqueIdImpl(
base::OnceCallback<void(mojom::blink::FileSystemAccessErrorPtr,
const WTF::String&)> callback) { … }
void FileSystemFileHandle::GetCloudIdentifiersImpl(
base::OnceCallback<void(
mojom::blink::FileSystemAccessErrorPtr,
Vector<mojom::blink::FileSystemAccessCloudIdentifierPtr>)> callback) { … }
void FileSystemFileHandle::OnGotFileSystemStorageAccessStatus(
ScriptPromiseResolver<FileSystemSyncAccessHandle>* resolver,
base::OnceClosure on_allowed_callback,
mojom::blink::FileSystemAccessErrorPtr result) { … }
}