#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_manager.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_manager.mojom-params-data.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_manager.mojom-shared-message-ids.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_manager.mojom-import-headers.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_manager.mojom-test-utils.h"
namespace blink::mojom {
ChooseFileSystemEntryAcceptsOption::ChooseFileSystemEntryAcceptsOption()
: … { … }
ChooseFileSystemEntryAcceptsOption::ChooseFileSystemEntryAcceptsOption(
const ::std::u16string& description_in,
std::vector<std::string> mime_types_in,
std::vector<std::string> extensions_in)
: … { … }
ChooseFileSystemEntryAcceptsOption::~ChooseFileSystemEntryAcceptsOption() = default;
void ChooseFileSystemEntryAcceptsOption::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool ChooseFileSystemEntryAcceptsOption::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
AcceptsTypesInfo::AcceptsTypesInfo()
: … { … }
AcceptsTypesInfo::AcceptsTypesInfo(
std::vector<ChooseFileSystemEntryAcceptsOptionPtr> accepts_in,
bool include_accepts_all_in)
: … { … }
AcceptsTypesInfo::~AcceptsTypesInfo() = default;
void AcceptsTypesInfo::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool AcceptsTypesInfo::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
OpenFilePickerOptions::OpenFilePickerOptions()
: … { … }
OpenFilePickerOptions::OpenFilePickerOptions(
AcceptsTypesInfoPtr accepts_types_info_in,
bool can_select_multiple_files_in)
: … { … }
OpenFilePickerOptions::~OpenFilePickerOptions() = default;
void OpenFilePickerOptions::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool OpenFilePickerOptions::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
SaveFilePickerOptions::SaveFilePickerOptions()
: … { … }
SaveFilePickerOptions::SaveFilePickerOptions(
AcceptsTypesInfoPtr accepts_types_info_in,
const std::string& suggested_name_in)
: … { … }
SaveFilePickerOptions::~SaveFilePickerOptions() = default;
void SaveFilePickerOptions::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool SaveFilePickerOptions::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
DirectoryPickerOptions::DirectoryPickerOptions()
: … { … }
DirectoryPickerOptions::DirectoryPickerOptions(
bool request_writable_in)
: … { … }
DirectoryPickerOptions::~DirectoryPickerOptions() = default;
size_t DirectoryPickerOptions::Hash(size_t seed) const { … }
void DirectoryPickerOptions::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool DirectoryPickerOptions::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
FilePickerOptions::FilePickerOptions()
: … { … }
FilePickerOptions::FilePickerOptions(
TypeSpecificFilePickerOptionsUnionPtr type_specific_options_in,
const std::string& starting_directory_id_in,
FilePickerStartInOptionsUnionPtr start_in_options_in)
: … { … }
FilePickerOptions::~FilePickerOptions() = default;
void FilePickerOptions::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool FilePickerOptions::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
TypeSpecificFilePickerOptionsUnion::TypeSpecificFilePickerOptionsUnion() : … { … }
TypeSpecificFilePickerOptionsUnion::~TypeSpecificFilePickerOptionsUnion() { … }
void TypeSpecificFilePickerOptionsUnion::set_open_file_picker_options(
OpenFilePickerOptionsPtr open_file_picker_options) { … }
void TypeSpecificFilePickerOptionsUnion::set_save_file_picker_options(
SaveFilePickerOptionsPtr save_file_picker_options) { … }
void TypeSpecificFilePickerOptionsUnion::set_directory_picker_options(
DirectoryPickerOptionsPtr directory_picker_options) { … }
void TypeSpecificFilePickerOptionsUnion::DestroyActive() { … }
bool TypeSpecificFilePickerOptionsUnion::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
FilePickerStartInOptionsUnion::FilePickerStartInOptionsUnion() : … { … }
FilePickerStartInOptionsUnion::~FilePickerStartInOptionsUnion() { … }
void FilePickerStartInOptionsUnion::set_well_known_directory(
WellKnownDirectory well_known_directory) { … }
void FilePickerStartInOptionsUnion::set_directory_token(
::mojo::PendingRemote<::blink::mojom::FileSystemAccessTransferToken> directory_token) { … }
void FilePickerStartInOptionsUnion::DestroyActive() { … }
bool FilePickerStartInOptionsUnion::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char FileSystemAccessManager::Name_[] = …;
FileSystemAccessManager::IPCStableHashFunction FileSystemAccessManager::MessageToMethodInfo_(mojo::Message& message) { … }
const char* FileSystemAccessManager::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t FileSystemAccessManager::GetSandboxedFileSystem_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessManager::GetSandboxedFileSystemForDevtools_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessManager::ChooseEntries_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessManager::GetFileHandleFromToken_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessManager::GetDirectoryHandleFromToken_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessManager::GetEntryFromDataTransferToken_Sym::IPCStableHash() { … }
uint32_t FileSystemAccessManager::BindObserverHost_Sym::IPCStableHash() { … }
# endif
class FileSystemAccessManager_GetSandboxedFileSystem_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessManager_GetSandboxedFileSystemForDevtools_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessManager_ChooseEntries_ForwardToCallback
: public mojo::MessageReceiver { … };
class FileSystemAccessManager_GetEntryFromDataTransferToken_ForwardToCallback
: public mojo::MessageReceiver { … };
FileSystemAccessManagerProxy::FileSystemAccessManagerProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void FileSystemAccessManagerProxy::GetSandboxedFileSystem(
GetSandboxedFileSystemCallback callback) { … }
void FileSystemAccessManagerProxy::GetSandboxedFileSystemForDevtools(
const std::vector<std::string>& in_directory_path_components, GetSandboxedFileSystemForDevtoolsCallback callback) { … }
void FileSystemAccessManagerProxy::ChooseEntries(
FilePickerOptionsPtr in_options, ChooseEntriesCallback callback) { … }
void FileSystemAccessManagerProxy::GetFileHandleFromToken(
::mojo::PendingRemote<::blink::mojom::FileSystemAccessTransferToken> in_token, ::mojo::PendingReceiver<::blink::mojom::FileSystemAccessFileHandle> in_file_handle) { … }
void FileSystemAccessManagerProxy::GetDirectoryHandleFromToken(
::mojo::PendingRemote<::blink::mojom::FileSystemAccessTransferToken> in_token, ::mojo::PendingReceiver<::blink::mojom::FileSystemAccessDirectoryHandle> in_directory_handle) { … }
void FileSystemAccessManagerProxy::GetEntryFromDataTransferToken(
::mojo::PendingRemote<::blink::mojom::FileSystemAccessDataTransferToken> in_token, GetEntryFromDataTransferTokenCallback callback) { … }
void FileSystemAccessManagerProxy::BindObserverHost(
::mojo::PendingReceiver<::blink::mojom::FileSystemAccessObserverHost> in_observer_host) { … }
class FileSystemAccessManager_GetSandboxedFileSystem_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessManager_GetSandboxedFileSystem_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessManager_GetSandboxedFileSystem_ProxyToResponder::Run(
::blink::mojom::FileSystemAccessErrorPtr in_result, ::mojo::PendingRemote<::blink::mojom::FileSystemAccessDirectoryHandle> in_directory) { … }
class FileSystemAccessManager_GetSandboxedFileSystemForDevtools_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessManager_GetSandboxedFileSystemForDevtools_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessManager_GetSandboxedFileSystemForDevtools_ProxyToResponder::Run(
::blink::mojom::FileSystemAccessErrorPtr in_result, ::mojo::PendingRemote<::blink::mojom::FileSystemAccessDirectoryHandle> in_directory) { … }
class FileSystemAccessManager_ChooseEntries_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessManager_ChooseEntries_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessManager_ChooseEntries_ProxyToResponder::Run(
::blink::mojom::FileSystemAccessErrorPtr in_result, std::vector<::blink::mojom::FileSystemAccessEntryPtr> in_entries) { … }
class FileSystemAccessManager_GetEntryFromDataTransferToken_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool FileSystemAccessManager_GetEntryFromDataTransferToken_ForwardToCallback::Accept(
mojo::Message* message) { … }
void FileSystemAccessManager_GetEntryFromDataTransferToken_ProxyToResponder::Run(
::blink::mojom::FileSystemAccessErrorPtr in_result, ::blink::mojom::FileSystemAccessEntryPtr in_entry) { … }
bool FileSystemAccessManagerStubDispatch::Accept(
FileSystemAccessManager* impl,
mojo::Message* message) { … }
bool FileSystemAccessManagerStubDispatch::AcceptWithResponder(
FileSystemAccessManager* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kFileSystemAccessManagerValidationInfo[] = …;
bool FileSystemAccessManagerRequestValidator::Accept(mojo::Message* message) { … }
bool FileSystemAccessManagerResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::blink::mojom::ChooseFileSystemEntryAcceptsOption::DataView, ::blink::mojom::ChooseFileSystemEntryAcceptsOptionPtr>::Read(
::blink::mojom::ChooseFileSystemEntryAcceptsOption::DataView input,
::blink::mojom::ChooseFileSystemEntryAcceptsOptionPtr* output) { … }
bool StructTraits<::blink::mojom::AcceptsTypesInfo::DataView, ::blink::mojom::AcceptsTypesInfoPtr>::Read(
::blink::mojom::AcceptsTypesInfo::DataView input,
::blink::mojom::AcceptsTypesInfoPtr* output) { … }
bool StructTraits<::blink::mojom::OpenFilePickerOptions::DataView, ::blink::mojom::OpenFilePickerOptionsPtr>::Read(
::blink::mojom::OpenFilePickerOptions::DataView input,
::blink::mojom::OpenFilePickerOptionsPtr* output) { … }
bool StructTraits<::blink::mojom::SaveFilePickerOptions::DataView, ::blink::mojom::SaveFilePickerOptionsPtr>::Read(
::blink::mojom::SaveFilePickerOptions::DataView input,
::blink::mojom::SaveFilePickerOptionsPtr* output) { … }
bool StructTraits<::blink::mojom::DirectoryPickerOptions::DataView, ::blink::mojom::DirectoryPickerOptionsPtr>::Read(
::blink::mojom::DirectoryPickerOptions::DataView input,
::blink::mojom::DirectoryPickerOptionsPtr* output) { … }
bool StructTraits<::blink::mojom::FilePickerOptions::DataView, ::blink::mojom::FilePickerOptionsPtr>::Read(
::blink::mojom::FilePickerOptions::DataView input,
::blink::mojom::FilePickerOptionsPtr* output) { … }
bool UnionTraits<::blink::mojom::TypeSpecificFilePickerOptionsUnion::DataView, ::blink::mojom::TypeSpecificFilePickerOptionsUnionPtr>::Read(
::blink::mojom::TypeSpecificFilePickerOptionsUnion::DataView input,
::blink::mojom::TypeSpecificFilePickerOptionsUnionPtr* output) { … }
bool UnionTraits<::blink::mojom::FilePickerStartInOptionsUnion::DataView, ::blink::mojom::FilePickerStartInOptionsUnionPtr>::Read(
::blink::mojom::FilePickerStartInOptionsUnion::DataView input,
::blink::mojom::FilePickerStartInOptionsUnionPtr* output) { … }
}
namespace blink::mojom {
void FileSystemAccessManagerInterceptorForTesting::GetSandboxedFileSystem(GetSandboxedFileSystemCallback callback) { … }
void FileSystemAccessManagerInterceptorForTesting::GetSandboxedFileSystemForDevtools(const std::vector<std::string>& directory_path_components, GetSandboxedFileSystemForDevtoolsCallback callback) { … }
void FileSystemAccessManagerInterceptorForTesting::ChooseEntries(FilePickerOptionsPtr options, ChooseEntriesCallback callback) { … }
void FileSystemAccessManagerInterceptorForTesting::GetFileHandleFromToken(::mojo::PendingRemote<::blink::mojom::FileSystemAccessTransferToken> token, ::mojo::PendingReceiver<::blink::mojom::FileSystemAccessFileHandle> file_handle) { … }
void FileSystemAccessManagerInterceptorForTesting::GetDirectoryHandleFromToken(::mojo::PendingRemote<::blink::mojom::FileSystemAccessTransferToken> token, ::mojo::PendingReceiver<::blink::mojom::FileSystemAccessDirectoryHandle> directory_handle) { … }
void FileSystemAccessManagerInterceptorForTesting::GetEntryFromDataTransferToken(::mojo::PendingRemote<::blink::mojom::FileSystemAccessDataTransferToken> token, GetEntryFromDataTransferTokenCallback callback) { … }
void FileSystemAccessManagerInterceptorForTesting::BindObserverHost(::mojo::PendingReceiver<::blink::mojom::FileSystemAccessObserverHost> observer_host) { … }
FileSystemAccessManagerAsyncWaiter::FileSystemAccessManagerAsyncWaiter(
FileSystemAccessManager* proxy) : … { … }
FileSystemAccessManagerAsyncWaiter::~FileSystemAccessManagerAsyncWaiter() = default;
void FileSystemAccessManagerAsyncWaiter::GetSandboxedFileSystem(
::blink::mojom::FileSystemAccessErrorPtr* out_result, ::mojo::PendingRemote<::blink::mojom::FileSystemAccessDirectoryHandle>* out_directory) { … }
void FileSystemAccessManagerAsyncWaiter::GetSandboxedFileSystemForDevtools(
const std::vector<std::string>& directory_path_components, ::blink::mojom::FileSystemAccessErrorPtr* out_result, ::mojo::PendingRemote<::blink::mojom::FileSystemAccessDirectoryHandle>* out_directory) { … }
void FileSystemAccessManagerAsyncWaiter::ChooseEntries(
FilePickerOptionsPtr options, ::blink::mojom::FileSystemAccessErrorPtr* out_result, std::vector<::blink::mojom::FileSystemAccessEntryPtr>* out_entries) { … }
void FileSystemAccessManagerAsyncWaiter::GetEntryFromDataTransferToken(
::mojo::PendingRemote<::blink::mojom::FileSystemAccessDataTransferToken> token, ::blink::mojom::FileSystemAccessErrorPtr* out_result, ::blink::mojom::FileSystemAccessEntryPtr* out_entry) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif