#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_file_handle.mojom.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_file_handle.mojom-params-data.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_file_handle.mojom-shared-message-ids.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_file_handle.mojom-import-headers.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_file_handle.mojom-test-utils.h"
namespace blink::mojom {
FileSystemAccessRegularFile::FileSystemAccessRegularFile()
: … { … }
FileSystemAccessRegularFile::FileSystemAccessRegularFile(
::base::File os_file_in,
int64_t file_size_in,
::mojo::PendingRemote<::blink::mojom::FileSystemAccessFileModificationHost> file_modification_host_in)
: … { … }
FileSystemAccessRegularFile::~FileSystemAccessRegularFile() = default;
void FileSystemAccessRegularFile::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool FileSystemAccessRegularFile::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
FileSystemAccessAccessHandleFile::FileSystemAccessAccessHandleFile() : … { … }
FileSystemAccessAccessHandleFile::~FileSystemAccessAccessHandleFile() { … }
void FileSystemAccessAccessHandleFile::set_regular_file(
FileSystemAccessRegularFilePtr regular_file) { … }
void FileSystemAccessAccessHandleFile::set_incognito_file_delegate(
::mojo::PendingRemote<::blink::mojom::FileSystemAccessFileDelegateHost> incognito_file_delegate) { … }
void FileSystemAccessAccessHandleFile::DestroyActive() { … }
bool FileSystemAccessAccessHandleFile::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char FileSystemAccessFileHandle::Name_[] = …;
FileSystemAccessFileHandle::IPCStableHashFunction FileSystemAccessFileHandle::MessageToMethodInfo_(mojo::Message& message) { … }
const char* FileSystemAccessFileHandle::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t FileSystemAccessFileHandle::GetPermissionStatus_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessFileHandle::RequestPermission_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessFileHandle::AsBlob_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessFileHandle::CreateFileWriter_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessFileHandle::Rename_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessFileHandle::Move_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessFileHandle::Remove_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessFileHandle::OpenAccessHandle_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessFileHandle::IsSameEntry_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessFileHandle::Transfer_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessFileHandle::GetUniqueId_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessFileHandle::GetCloudIdentifiers_Sym::IPCStableHash() { … }
# endif
class FileSystemAccessFileHandle_GetPermissionStatus_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessFileHandle_RequestPermission_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessFileHandle_AsBlob_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessFileHandle_CreateFileWriter_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessFileHandle_Rename_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessFileHandle_Move_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessFileHandle_Remove_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessFileHandle_OpenAccessHandle_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessFileHandle_IsSameEntry_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessFileHandle_GetUniqueId_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessFileHandle_GetCloudIdentifiers_ForwardToCallback
: public mojo::MessageReceiver { … };
FileSystemAccessFileHandleProxy::FileSystemAccessFileHandleProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void FileSystemAccessFileHandleProxy::GetPermissionStatus(
bool in_writable, GetPermissionStatusCallback callback) { … }
void FileSystemAccessFileHandleProxy::RequestPermission(
bool in_writable, RequestPermissionCallback callback) { … }
void FileSystemAccessFileHandleProxy::AsBlob(
AsBlobCallback callback) { … }
void FileSystemAccessFileHandleProxy::CreateFileWriter(
bool in_keep_existing_data, bool in_auto_close, FileSystemAccessWritableFileStreamLockMode in_mode, CreateFileWriterCallback callback) { … }
void FileSystemAccessFileHandleProxy::Rename(
const std::string& in_new_entry_name, RenameCallback callback) { … }
void FileSystemAccessFileHandleProxy::Move(
::mojo::PendingRemote<::blink::mojom::FileSystemAccessTransferToken> in_destination_directory, const std::string& in_new_entry_name, MoveCallback callback) { … }
void FileSystemAccessFileHandleProxy::Remove(
RemoveCallback callback) { … }
void FileSystemAccessFileHandleProxy::OpenAccessHandle(
FileSystemAccessAccessHandleLockMode in_mode, OpenAccessHandleCallback callback) { … }
void FileSystemAccessFileHandleProxy::IsSameEntry(
::mojo::PendingRemote<::blink::mojom::FileSystemAccessTransferToken> in_other, IsSameEntryCallback callback) { … }
void FileSystemAccessFileHandleProxy::Transfer(
::mojo::PendingReceiver<::blink::mojom::FileSystemAccessTransferToken> in_token) { … }
void FileSystemAccessFileHandleProxy::GetUniqueId(
GetUniqueIdCallback callback) { … }
void FileSystemAccessFileHandleProxy::GetCloudIdentifiers(
GetCloudIdentifiersCallback callback) { … }
class FileSystemAccessFileHandle_GetPermissionStatus_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessFileHandle_GetPermissionStatus_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessFileHandle_GetPermissionStatus_ProxyToResponder::Run(
::blink::mojom::PermissionStatus in_status) { … }
class FileSystemAccessFileHandle_RequestPermission_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessFileHandle_RequestPermission_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessFileHandle_RequestPermission_ProxyToResponder::Run(
::blink::mojom::FileSystemAccessErrorPtr in_result, ::blink::mojom::PermissionStatus in_status) { … }
class FileSystemAccessFileHandle_AsBlob_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessFileHandle_AsBlob_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessFileHandle_AsBlob_ProxyToResponder::Run(
::blink::mojom::FileSystemAccessErrorPtr in_result, const ::base::File::Info& in_info, ::blink::mojom::SerializedBlobPtr in_blob) { … }
class FileSystemAccessFileHandle_CreateFileWriter_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessFileHandle_CreateFileWriter_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessFileHandle_CreateFileWriter_ProxyToResponder::Run(
::blink::mojom::FileSystemAccessErrorPtr in_result, ::mojo::PendingRemote<::blink::mojom::FileSystemAccessFileWriter> in_writer) { … }
class FileSystemAccessFileHandle_Rename_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessFileHandle_Rename_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessFileHandle_Rename_ProxyToResponder::Run(
::blink::mojom::FileSystemAccessErrorPtr in_result) { … }
class FileSystemAccessFileHandle_Move_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessFileHandle_Move_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessFileHandle_Move_ProxyToResponder::Run(
::blink::mojom::FileSystemAccessErrorPtr in_result) { … }
class FileSystemAccessFileHandle_Remove_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessFileHandle_Remove_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessFileHandle_Remove_ProxyToResponder::Run(
::blink::mojom::FileSystemAccessErrorPtr in_result) { … }
class FileSystemAccessFileHandle_OpenAccessHandle_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessFileHandle_OpenAccessHandle_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessFileHandle_OpenAccessHandle_ProxyToResponder::Run(
::blink::mojom::FileSystemAccessErrorPtr in_result, FileSystemAccessAccessHandleFilePtr in_file, ::mojo::PendingRemote<::blink::mojom::FileSystemAccessAccessHandleHost> in_access_handle_host) { … }
class FileSystemAccessFileHandle_IsSameEntry_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessFileHandle_IsSameEntry_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessFileHandle_IsSameEntry_ProxyToResponder::Run(
::blink::mojom::FileSystemAccessErrorPtr in_result, bool in_is_same) { … }
class FileSystemAccessFileHandle_GetUniqueId_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessFileHandle_GetUniqueId_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessFileHandle_GetUniqueId_ProxyToResponder::Run(
::blink::mojom::FileSystemAccessErrorPtr in_result, const std::string& in_id) { … }
class FileSystemAccessFileHandle_GetCloudIdentifiers_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessFileHandle_GetCloudIdentifiers_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessFileHandle_GetCloudIdentifiers_ProxyToResponder::Run(
::blink::mojom::FileSystemAccessErrorPtr in_result, std::vector<::blink::mojom::FileSystemAccessCloudIdentifierPtr> in_cloud_identifiers) { … }
bool FileSystemAccessFileHandleStubDispatch::Accept(
FileSystemAccessFileHandle* impl,
mojo::Message* message) { … }
bool FileSystemAccessFileHandleStubDispatch::AcceptWithResponder(
FileSystemAccessFileHandle* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kFileSystemAccessFileHandleValidationInfo[] = …;
bool FileSystemAccessFileHandleRequestValidator::Accept(mojo::Message* message) { … }
bool FileSystemAccessFileHandleResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::blink::mojom::FileSystemAccessRegularFile::DataView, ::blink::mojom::FileSystemAccessRegularFilePtr>::Read(
::blink::mojom::FileSystemAccessRegularFile::DataView input,
::blink::mojom::FileSystemAccessRegularFilePtr* output) { … }
bool UnionTraits<::blink::mojom::FileSystemAccessAccessHandleFile::DataView, ::blink::mojom::FileSystemAccessAccessHandleFilePtr>::Read(
::blink::mojom::FileSystemAccessAccessHandleFile::DataView input,
::blink::mojom::FileSystemAccessAccessHandleFilePtr* output) { … }
}
namespace blink::mojom {
void FileSystemAccessFileHandleInterceptorForTesting::GetPermissionStatus(bool writable, GetPermissionStatusCallback callback) { … }
void FileSystemAccessFileHandleInterceptorForTesting::RequestPermission(bool writable, RequestPermissionCallback callback) { … }
void FileSystemAccessFileHandleInterceptorForTesting::AsBlob(AsBlobCallback callback) { … }
void FileSystemAccessFileHandleInterceptorForTesting::CreateFileWriter(bool keep_existing_data, bool auto_close, FileSystemAccessWritableFileStreamLockMode mode, CreateFileWriterCallback callback) { … }
void FileSystemAccessFileHandleInterceptorForTesting::Rename(const std::string& new_entry_name, RenameCallback callback) { … }
void FileSystemAccessFileHandleInterceptorForTesting::Move(::mojo::PendingRemote<::blink::mojom::FileSystemAccessTransferToken> destination_directory, const std::string& new_entry_name, MoveCallback callback) { … }
void FileSystemAccessFileHandleInterceptorForTesting::Remove(RemoveCallback callback) { … }
void FileSystemAccessFileHandleInterceptorForTesting::OpenAccessHandle(FileSystemAccessAccessHandleLockMode mode, OpenAccessHandleCallback callback) { … }
void FileSystemAccessFileHandleInterceptorForTesting::IsSameEntry(::mojo::PendingRemote<::blink::mojom::FileSystemAccessTransferToken> other, IsSameEntryCallback callback) { … }
void FileSystemAccessFileHandleInterceptorForTesting::Transfer(::mojo::PendingReceiver<::blink::mojom::FileSystemAccessTransferToken> token) { … }
void FileSystemAccessFileHandleInterceptorForTesting::GetUniqueId(GetUniqueIdCallback callback) { … }
void FileSystemAccessFileHandleInterceptorForTesting::GetCloudIdentifiers(GetCloudIdentifiersCallback callback) { … }
FileSystemAccessFileHandleAsyncWaiter::FileSystemAccessFileHandleAsyncWaiter(
FileSystemAccessFileHandle* proxy) : … { … }
FileSystemAccessFileHandleAsyncWaiter::~FileSystemAccessFileHandleAsyncWaiter() = default;
void FileSystemAccessFileHandleAsyncWaiter::GetPermissionStatus(
bool writable, ::blink::mojom::PermissionStatus* out_status) { … }
::blink::mojom::PermissionStatus FileSystemAccessFileHandleAsyncWaiter::GetPermissionStatus(
bool writable) { … }
void FileSystemAccessFileHandleAsyncWaiter::RequestPermission(
bool writable, ::blink::mojom::FileSystemAccessErrorPtr* out_result, ::blink::mojom::PermissionStatus* out_status) { … }
void FileSystemAccessFileHandleAsyncWaiter::AsBlob(
::blink::mojom::FileSystemAccessErrorPtr* out_result, ::base::File::Info* out_info, ::blink::mojom::SerializedBlobPtr* out_blob) { … }
void FileSystemAccessFileHandleAsyncWaiter::CreateFileWriter(
bool keep_existing_data, bool auto_close, FileSystemAccessWritableFileStreamLockMode mode, ::blink::mojom::FileSystemAccessErrorPtr* out_result, ::mojo::PendingRemote<::blink::mojom::FileSystemAccessFileWriter>* out_writer) { … }
void FileSystemAccessFileHandleAsyncWaiter::Rename(
const std::string& new_entry_name, ::blink::mojom::FileSystemAccessErrorPtr* out_result) { … }
::blink::mojom::FileSystemAccessErrorPtr FileSystemAccessFileHandleAsyncWaiter::Rename(
const std::string& new_entry_name) { … }
void FileSystemAccessFileHandleAsyncWaiter::Move(
::mojo::PendingRemote<::blink::mojom::FileSystemAccessTransferToken> destination_directory, const std::string& new_entry_name, ::blink::mojom::FileSystemAccessErrorPtr* out_result) { … }
::blink::mojom::FileSystemAccessErrorPtr FileSystemAccessFileHandleAsyncWaiter::Move(
::mojo::PendingRemote<::blink::mojom::FileSystemAccessTransferToken> destination_directory, const std::string& new_entry_name) { … }
void FileSystemAccessFileHandleAsyncWaiter::Remove(
::blink::mojom::FileSystemAccessErrorPtr* out_result) { … }
::blink::mojom::FileSystemAccessErrorPtr FileSystemAccessFileHandleAsyncWaiter::Remove(
) { … }
void FileSystemAccessFileHandleAsyncWaiter::OpenAccessHandle(
FileSystemAccessAccessHandleLockMode mode, ::blink::mojom::FileSystemAccessErrorPtr* out_result, FileSystemAccessAccessHandleFilePtr* out_file, ::mojo::PendingRemote<::blink::mojom::FileSystemAccessAccessHandleHost>* out_access_handle_host) { … }
void FileSystemAccessFileHandleAsyncWaiter::IsSameEntry(
::mojo::PendingRemote<::blink::mojom::FileSystemAccessTransferToken> other, ::blink::mojom::FileSystemAccessErrorPtr* out_result, bool* out_is_same) { … }
void FileSystemAccessFileHandleAsyncWaiter::GetUniqueId(
::blink::mojom::FileSystemAccessErrorPtr* out_result, std::string* out_id) { … }
void FileSystemAccessFileHandleAsyncWaiter::GetCloudIdentifiers(
::blink::mojom::FileSystemAccessErrorPtr* out_result, std::vector<::blink::mojom::FileSystemAccessCloudIdentifierPtr>* out_cloud_identifiers) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif