#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "third_party/blink/public/mojom/file_system_access/file_system_access_directory_handle.mojom-blink.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/features.h"
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "mojo/public/cpp/bindings/urgent_message_scope.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_directory_handle.mojom-params-data.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_directory_handle.mojom-shared-message-ids.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_directory_handle.mojom-blink-import-headers.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_directory_handle.mojom-blink-test-utils.h"
#include "mojo/public/cpp/bindings/lib/wtf_serialization.h"
namespace blink::mojom::blink {
FileSystemAccessEntry::FileSystemAccessEntry()
: … { … }
FileSystemAccessEntry::FileSystemAccessEntry(
FileSystemAccessHandlePtr entry_handle_in,
const WTF::String& name_in)
: … { … }
FileSystemAccessEntry::~FileSystemAccessEntry() = default;
void FileSystemAccessEntry::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool FileSystemAccessEntry::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
FileSystemAccessHandle::FileSystemAccessHandle() : … { … }
FileSystemAccessHandle::~FileSystemAccessHandle() { … }
void FileSystemAccessHandle::set_file(
::mojo::PendingRemote<::blink::mojom::blink::FileSystemAccessFileHandle> file) { … }
void FileSystemAccessHandle::set_directory(
::mojo::PendingRemote<FileSystemAccessDirectoryHandle> directory) { … }
void FileSystemAccessHandle::DestroyActive() { … }
bool FileSystemAccessHandle::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char FileSystemAccessDirectoryEntriesListener::Name_[] = …;
FileSystemAccessDirectoryEntriesListener::IPCStableHashFunction FileSystemAccessDirectoryEntriesListener::MessageToMethodInfo_(mojo::Message& message) { … }
const char* FileSystemAccessDirectoryEntriesListener::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t FileSystemAccessDirectoryEntriesListener::DidReadDirectory_Sym::IPCStableHash() { … }
# endif
FileSystemAccessDirectoryEntriesListenerProxy::FileSystemAccessDirectoryEntriesListenerProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void FileSystemAccessDirectoryEntriesListenerProxy::DidReadDirectory(
::blink::mojom::blink::FileSystemAccessErrorPtr in_result, WTF::Vector<FileSystemAccessEntryPtr> in_entries, bool in_has_more_entries) { … }
bool FileSystemAccessDirectoryEntriesListenerStubDispatch::Accept(
FileSystemAccessDirectoryEntriesListener* impl,
mojo::Message* message) { … }
bool FileSystemAccessDirectoryEntriesListenerStubDispatch::AcceptWithResponder(
FileSystemAccessDirectoryEntriesListener* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kFileSystemAccessDirectoryEntriesListenerValidationInfo[] = …;
bool FileSystemAccessDirectoryEntriesListenerRequestValidator::Accept(mojo::Message* message) { … }
const char FileSystemAccessDirectoryHandle::Name_[] = …;
FileSystemAccessDirectoryHandle::IPCStableHashFunction FileSystemAccessDirectoryHandle::MessageToMethodInfo_(mojo::Message& message) { … }
const char* FileSystemAccessDirectoryHandle::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t FileSystemAccessDirectoryHandle::GetPermissionStatus_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessDirectoryHandle::RequestPermission_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessDirectoryHandle::GetFile_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessDirectoryHandle::GetDirectory_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessDirectoryHandle::GetEntries_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessDirectoryHandle::Rename_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessDirectoryHandle::Move_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessDirectoryHandle::Remove_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessDirectoryHandle::RemoveEntry_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessDirectoryHandle::Resolve_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessDirectoryHandle::Transfer_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessDirectoryHandle::GetUniqueId_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessDirectoryHandle::GetCloudIdentifiers_Sym::IPCStableHash() { … }
# endif
class FileSystemAccessDirectoryHandle_GetPermissionStatus_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessDirectoryHandle_RequestPermission_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessDirectoryHandle_GetFile_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessDirectoryHandle_GetDirectory_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessDirectoryHandle_Rename_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessDirectoryHandle_Move_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessDirectoryHandle_Remove_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessDirectoryHandle_RemoveEntry_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessDirectoryHandle_Resolve_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessDirectoryHandle_GetUniqueId_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessDirectoryHandle_GetCloudIdentifiers_ForwardToCallback
: public mojo::MessageReceiver { … };
FileSystemAccessDirectoryHandleProxy::FileSystemAccessDirectoryHandleProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void FileSystemAccessDirectoryHandleProxy::GetPermissionStatus(
bool in_writable, GetPermissionStatusCallback callback) { … }
void FileSystemAccessDirectoryHandleProxy::RequestPermission(
bool in_writable, RequestPermissionCallback callback) { … }
void FileSystemAccessDirectoryHandleProxy::GetFile(
const WTF::String& in_basename, bool in_create, GetFileCallback callback) { … }
void FileSystemAccessDirectoryHandleProxy::GetDirectory(
const WTF::String& in_basename, bool in_create, GetDirectoryCallback callback) { … }
void FileSystemAccessDirectoryHandleProxy::GetEntries(
::mojo::PendingRemote<FileSystemAccessDirectoryEntriesListener> in_listener) { … }
void FileSystemAccessDirectoryHandleProxy::Rename(
const WTF::String& in_new_entry_name, RenameCallback callback) { … }
void FileSystemAccessDirectoryHandleProxy::Move(
::mojo::PendingRemote<::blink::mojom::blink::FileSystemAccessTransferToken> in_destination_directory, const WTF::String& in_new_entry_name, MoveCallback callback) { … }
void FileSystemAccessDirectoryHandleProxy::Remove(
bool in_recurse, RemoveCallback callback) { … }
void FileSystemAccessDirectoryHandleProxy::RemoveEntry(
const WTF::String& in_basename, bool in_recurse, RemoveEntryCallback callback) { … }
void FileSystemAccessDirectoryHandleProxy::Resolve(
::mojo::PendingRemote<::blink::mojom::blink::FileSystemAccessTransferToken> in_possible_child, ResolveCallback callback) { … }
void FileSystemAccessDirectoryHandleProxy::Transfer(
::mojo::PendingReceiver<::blink::mojom::blink::FileSystemAccessTransferToken> in_token) { … }
void FileSystemAccessDirectoryHandleProxy::GetUniqueId(
GetUniqueIdCallback callback) { … }
void FileSystemAccessDirectoryHandleProxy::GetCloudIdentifiers(
GetCloudIdentifiersCallback callback) { … }
class FileSystemAccessDirectoryHandle_GetPermissionStatus_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessDirectoryHandle_GetPermissionStatus_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessDirectoryHandle_GetPermissionStatus_ProxyToResponder::Run(
::blink::mojom::blink::PermissionStatus in_status) { … }
class FileSystemAccessDirectoryHandle_RequestPermission_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessDirectoryHandle_RequestPermission_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessDirectoryHandle_RequestPermission_ProxyToResponder::Run(
::blink::mojom::blink::FileSystemAccessErrorPtr in_result, ::blink::mojom::blink::PermissionStatus in_status) { … }
class FileSystemAccessDirectoryHandle_GetFile_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessDirectoryHandle_GetFile_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessDirectoryHandle_GetFile_ProxyToResponder::Run(
::blink::mojom::blink::FileSystemAccessErrorPtr in_result, ::mojo::PendingRemote<::blink::mojom::blink::FileSystemAccessFileHandle> in_file) { … }
class FileSystemAccessDirectoryHandle_GetDirectory_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessDirectoryHandle_GetDirectory_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessDirectoryHandle_GetDirectory_ProxyToResponder::Run(
::blink::mojom::blink::FileSystemAccessErrorPtr in_result, ::mojo::PendingRemote<FileSystemAccessDirectoryHandle> in_directory) { … }
class FileSystemAccessDirectoryHandle_Rename_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessDirectoryHandle_Rename_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessDirectoryHandle_Rename_ProxyToResponder::Run(
::blink::mojom::blink::FileSystemAccessErrorPtr in_result) { … }
class FileSystemAccessDirectoryHandle_Move_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessDirectoryHandle_Move_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessDirectoryHandle_Move_ProxyToResponder::Run(
::blink::mojom::blink::FileSystemAccessErrorPtr in_result) { … }
class FileSystemAccessDirectoryHandle_Remove_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessDirectoryHandle_Remove_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessDirectoryHandle_Remove_ProxyToResponder::Run(
::blink::mojom::blink::FileSystemAccessErrorPtr in_result) { … }
class FileSystemAccessDirectoryHandle_RemoveEntry_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessDirectoryHandle_RemoveEntry_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessDirectoryHandle_RemoveEntry_ProxyToResponder::Run(
::blink::mojom::blink::FileSystemAccessErrorPtr in_result) { … }
class FileSystemAccessDirectoryHandle_Resolve_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessDirectoryHandle_Resolve_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessDirectoryHandle_Resolve_ProxyToResponder::Run(
::blink::mojom::blink::FileSystemAccessErrorPtr in_result, const std::optional<WTF::Vector<WTF::String>>& in_path) { … }
class FileSystemAccessDirectoryHandle_GetUniqueId_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessDirectoryHandle_GetUniqueId_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessDirectoryHandle_GetUniqueId_ProxyToResponder::Run(
::blink::mojom::blink::FileSystemAccessErrorPtr in_result, const WTF::String& in_id) { … }
class FileSystemAccessDirectoryHandle_GetCloudIdentifiers_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessDirectoryHandle_GetCloudIdentifiers_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessDirectoryHandle_GetCloudIdentifiers_ProxyToResponder::Run(
::blink::mojom::blink::FileSystemAccessErrorPtr in_result, WTF::Vector<::blink::mojom::blink::FileSystemAccessCloudIdentifierPtr> in_cloud_identifiers) { … }
bool FileSystemAccessDirectoryHandleStubDispatch::Accept(
FileSystemAccessDirectoryHandle* impl,
mojo::Message* message) { … }
bool FileSystemAccessDirectoryHandleStubDispatch::AcceptWithResponder(
FileSystemAccessDirectoryHandle* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kFileSystemAccessDirectoryHandleValidationInfo[] = …;
bool FileSystemAccessDirectoryHandleRequestValidator::Accept(mojo::Message* message) { … }
bool FileSystemAccessDirectoryHandleResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::blink::mojom::blink::FileSystemAccessEntry::DataView, ::blink::mojom::blink::FileSystemAccessEntryPtr>::Read(
::blink::mojom::blink::FileSystemAccessEntry::DataView input,
::blink::mojom::blink::FileSystemAccessEntryPtr* output) { … }
bool UnionTraits<::blink::mojom::blink::FileSystemAccessHandle::DataView, ::blink::mojom::blink::FileSystemAccessHandlePtr>::Read(
::blink::mojom::blink::FileSystemAccessHandle::DataView input,
::blink::mojom::blink::FileSystemAccessHandlePtr* output) { … }
}
namespace blink::mojom::blink {
void FileSystemAccessDirectoryEntriesListenerInterceptorForTesting::DidReadDirectory(::blink::mojom::blink::FileSystemAccessErrorPtr result, WTF::Vector<FileSystemAccessEntryPtr> entries, bool has_more_entries) { … }
FileSystemAccessDirectoryEntriesListenerAsyncWaiter::FileSystemAccessDirectoryEntriesListenerAsyncWaiter(
FileSystemAccessDirectoryEntriesListener* proxy) : … { … }
FileSystemAccessDirectoryEntriesListenerAsyncWaiter::~FileSystemAccessDirectoryEntriesListenerAsyncWaiter() = default;
void FileSystemAccessDirectoryHandleInterceptorForTesting::GetPermissionStatus(bool writable, GetPermissionStatusCallback callback) { … }
void FileSystemAccessDirectoryHandleInterceptorForTesting::RequestPermission(bool writable, RequestPermissionCallback callback) { … }
void FileSystemAccessDirectoryHandleInterceptorForTesting::GetFile(const WTF::String& basename, bool create, GetFileCallback callback) { … }
void FileSystemAccessDirectoryHandleInterceptorForTesting::GetDirectory(const WTF::String& basename, bool create, GetDirectoryCallback callback) { … }
void FileSystemAccessDirectoryHandleInterceptorForTesting::GetEntries(::mojo::PendingRemote<FileSystemAccessDirectoryEntriesListener> listener) { … }
void FileSystemAccessDirectoryHandleInterceptorForTesting::Rename(const WTF::String& new_entry_name, RenameCallback callback) { … }
void FileSystemAccessDirectoryHandleInterceptorForTesting::Move(::mojo::PendingRemote<::blink::mojom::blink::FileSystemAccessTransferToken> destination_directory, const WTF::String& new_entry_name, MoveCallback callback) { … }
void FileSystemAccessDirectoryHandleInterceptorForTesting::Remove(bool recurse, RemoveCallback callback) { … }
void FileSystemAccessDirectoryHandleInterceptorForTesting::RemoveEntry(const WTF::String& basename, bool recurse, RemoveEntryCallback callback) { … }
void FileSystemAccessDirectoryHandleInterceptorForTesting::Resolve(::mojo::PendingRemote<::blink::mojom::blink::FileSystemAccessTransferToken> possible_child, ResolveCallback callback) { … }
void FileSystemAccessDirectoryHandleInterceptorForTesting::Transfer(::mojo::PendingReceiver<::blink::mojom::blink::FileSystemAccessTransferToken> token) { … }
void FileSystemAccessDirectoryHandleInterceptorForTesting::GetUniqueId(GetUniqueIdCallback callback) { … }
void FileSystemAccessDirectoryHandleInterceptorForTesting::GetCloudIdentifiers(GetCloudIdentifiersCallback callback) { … }
FileSystemAccessDirectoryHandleAsyncWaiter::FileSystemAccessDirectoryHandleAsyncWaiter(
FileSystemAccessDirectoryHandle* proxy) : … { … }
FileSystemAccessDirectoryHandleAsyncWaiter::~FileSystemAccessDirectoryHandleAsyncWaiter() = default;
void FileSystemAccessDirectoryHandleAsyncWaiter::GetPermissionStatus(
bool writable, ::blink::mojom::blink::PermissionStatus* out_status) { … }
::blink::mojom::blink::PermissionStatus FileSystemAccessDirectoryHandleAsyncWaiter::GetPermissionStatus(
bool writable) { … }
void FileSystemAccessDirectoryHandleAsyncWaiter::RequestPermission(
bool writable, ::blink::mojom::blink::FileSystemAccessErrorPtr* out_result, ::blink::mojom::blink::PermissionStatus* out_status) { … }
void FileSystemAccessDirectoryHandleAsyncWaiter::GetFile(
const WTF::String& basename, bool create, ::blink::mojom::blink::FileSystemAccessErrorPtr* out_result, ::mojo::PendingRemote<::blink::mojom::blink::FileSystemAccessFileHandle>* out_file) { … }
void FileSystemAccessDirectoryHandleAsyncWaiter::GetDirectory(
const WTF::String& basename, bool create, ::blink::mojom::blink::FileSystemAccessErrorPtr* out_result, ::mojo::PendingRemote<FileSystemAccessDirectoryHandle>* out_directory) { … }
void FileSystemAccessDirectoryHandleAsyncWaiter::Rename(
const WTF::String& new_entry_name, ::blink::mojom::blink::FileSystemAccessErrorPtr* out_result) { … }
::blink::mojom::blink::FileSystemAccessErrorPtr FileSystemAccessDirectoryHandleAsyncWaiter::Rename(
const WTF::String& new_entry_name) { … }
void FileSystemAccessDirectoryHandleAsyncWaiter::Move(
::mojo::PendingRemote<::blink::mojom::blink::FileSystemAccessTransferToken> destination_directory, const WTF::String& new_entry_name, ::blink::mojom::blink::FileSystemAccessErrorPtr* out_result) { … }
::blink::mojom::blink::FileSystemAccessErrorPtr FileSystemAccessDirectoryHandleAsyncWaiter::Move(
::mojo::PendingRemote<::blink::mojom::blink::FileSystemAccessTransferToken> destination_directory, const WTF::String& new_entry_name) { … }
void FileSystemAccessDirectoryHandleAsyncWaiter::Remove(
bool recurse, ::blink::mojom::blink::FileSystemAccessErrorPtr* out_result) { … }
::blink::mojom::blink::FileSystemAccessErrorPtr FileSystemAccessDirectoryHandleAsyncWaiter::Remove(
bool recurse) { … }
void FileSystemAccessDirectoryHandleAsyncWaiter::RemoveEntry(
const WTF::String& basename, bool recurse, ::blink::mojom::blink::FileSystemAccessErrorPtr* out_result) { … }
::blink::mojom::blink::FileSystemAccessErrorPtr FileSystemAccessDirectoryHandleAsyncWaiter::RemoveEntry(
const WTF::String& basename, bool recurse) { … }
void FileSystemAccessDirectoryHandleAsyncWaiter::Resolve(
::mojo::PendingRemote<::blink::mojom::blink::FileSystemAccessTransferToken> possible_child, ::blink::mojom::blink::FileSystemAccessErrorPtr* out_result, std::optional<WTF::Vector<WTF::String>>* out_path) { … }
void FileSystemAccessDirectoryHandleAsyncWaiter::GetUniqueId(
::blink::mojom::blink::FileSystemAccessErrorPtr* out_result, WTF::String* out_id) { … }
void FileSystemAccessDirectoryHandleAsyncWaiter::GetCloudIdentifiers(
::blink::mojom::blink::FileSystemAccessErrorPtr* out_result, WTF::Vector<::blink::mojom::blink::FileSystemAccessCloudIdentifierPtr>* out_cloud_identifiers) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif