#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "third_party/blink/public/mojom/permissions/permission.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/permissions/permission.mojom-params-data.h"
#include "third_party/blink/public/mojom/permissions/permission.mojom-shared-message-ids.h"
#include "third_party/blink/public/mojom/permissions/permission.mojom-import-headers.h"
#include "third_party/blink/public/mojom/permissions/permission.mojom-test-utils.h"
namespace blink::mojom {
MidiPermissionDescriptor::MidiPermissionDescriptor()
: … { … }
MidiPermissionDescriptor::MidiPermissionDescriptor(
bool sysex_in)
: … { … }
MidiPermissionDescriptor::~MidiPermissionDescriptor() = default;
size_t MidiPermissionDescriptor::Hash(size_t seed) const { … }
void MidiPermissionDescriptor::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool MidiPermissionDescriptor::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
ClipboardPermissionDescriptor::ClipboardPermissionDescriptor()
: … { … }
ClipboardPermissionDescriptor::ClipboardPermissionDescriptor(
bool has_user_gesture_in,
bool will_be_sanitized_in)
: … { … }
ClipboardPermissionDescriptor::~ClipboardPermissionDescriptor() = default;
size_t ClipboardPermissionDescriptor::Hash(size_t seed) const { … }
void ClipboardPermissionDescriptor::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool ClipboardPermissionDescriptor::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
CameraDevicePermissionDescriptor::CameraDevicePermissionDescriptor()
: … { … }
CameraDevicePermissionDescriptor::CameraDevicePermissionDescriptor(
bool panTiltZoom_in)
: … { … }
CameraDevicePermissionDescriptor::~CameraDevicePermissionDescriptor() = default;
size_t CameraDevicePermissionDescriptor::Hash(size_t seed) const { … }
void CameraDevicePermissionDescriptor::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool CameraDevicePermissionDescriptor::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
TopLevelStorageAccessPermissionDescriptor::TopLevelStorageAccessPermissionDescriptor()
: … { … }
TopLevelStorageAccessPermissionDescriptor::TopLevelStorageAccessPermissionDescriptor(
const ::url::Origin& requestedOrigin_in)
: … { … }
TopLevelStorageAccessPermissionDescriptor::~TopLevelStorageAccessPermissionDescriptor() = default;
void TopLevelStorageAccessPermissionDescriptor::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool TopLevelStorageAccessPermissionDescriptor::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
FullscreenPermissionDescriptor::FullscreenPermissionDescriptor()
: … { … }
FullscreenPermissionDescriptor::FullscreenPermissionDescriptor(
bool allow_without_user_gesture_in)
: … { … }
FullscreenPermissionDescriptor::~FullscreenPermissionDescriptor() = default;
size_t FullscreenPermissionDescriptor::Hash(size_t seed) const { … }
void FullscreenPermissionDescriptor::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool FullscreenPermissionDescriptor::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
PermissionDescriptor::PermissionDescriptor()
: … { … }
PermissionDescriptor::PermissionDescriptor(
PermissionName name_in,
PermissionDescriptorExtensionPtr extension_in)
: … { … }
PermissionDescriptor::~PermissionDescriptor() = default;
void PermissionDescriptor::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool PermissionDescriptor::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
EmbeddedPermissionRequestDescriptor::EmbeddedPermissionRequestDescriptor()
: … { … }
EmbeddedPermissionRequestDescriptor::EmbeddedPermissionRequestDescriptor(
std::vector<PermissionDescriptorPtr> permissions_in,
const ::gfx::Rect& element_position_in)
: … { … }
EmbeddedPermissionRequestDescriptor::~EmbeddedPermissionRequestDescriptor() = default;
void EmbeddedPermissionRequestDescriptor::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool EmbeddedPermissionRequestDescriptor::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
PermissionDescriptorExtension::PermissionDescriptorExtension() : … { … }
PermissionDescriptorExtension::~PermissionDescriptorExtension() { … }
void PermissionDescriptorExtension::set_midi(
MidiPermissionDescriptorPtr midi) { … }
void PermissionDescriptorExtension::set_clipboard(
ClipboardPermissionDescriptorPtr clipboard) { … }
void PermissionDescriptorExtension::set_camera_device(
CameraDevicePermissionDescriptorPtr camera_device) { … }
void PermissionDescriptorExtension::set_top_level_storage_access(
TopLevelStorageAccessPermissionDescriptorPtr top_level_storage_access) { … }
void PermissionDescriptorExtension::set_fullscreen(
FullscreenPermissionDescriptorPtr fullscreen) { … }
void PermissionDescriptorExtension::DestroyActive() { … }
bool PermissionDescriptorExtension::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char PermissionObserver::Name_[] = …;
PermissionObserver::IPCStableHashFunction PermissionObserver::MessageToMethodInfo_(mojo::Message& message) { … }
const char* PermissionObserver::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t PermissionObserver::OnPermissionStatusChange_Sym::IPCStableHash() { … }
# endif
PermissionObserverProxy::PermissionObserverProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void PermissionObserverProxy::OnPermissionStatusChange(
::blink::mojom::PermissionStatus in_status) { … }
bool PermissionObserverStubDispatch::Accept(
PermissionObserver* impl,
mojo::Message* message) { … }
bool PermissionObserverStubDispatch::AcceptWithResponder(
PermissionObserver* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kPermissionObserverValidationInfo[] = …;
bool PermissionObserverRequestValidator::Accept(mojo::Message* message) { … }
const char EmbeddedPermissionControlClient::Name_[] = …;
EmbeddedPermissionControlClient::IPCStableHashFunction EmbeddedPermissionControlClient::MessageToMethodInfo_(mojo::Message& message) { … }
const char* EmbeddedPermissionControlClient::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t EmbeddedPermissionControlClient::OnEmbeddedPermissionControlRegistered_Sym::IPCStableHash() { … }
# endif
EmbeddedPermissionControlClientProxy::EmbeddedPermissionControlClientProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void EmbeddedPermissionControlClientProxy::OnEmbeddedPermissionControlRegistered(
bool in_allow, const std::optional<std::vector<::blink::mojom::PermissionStatus>>& in_statuses) { … }
bool EmbeddedPermissionControlClientStubDispatch::Accept(
EmbeddedPermissionControlClient* impl,
mojo::Message* message) { … }
bool EmbeddedPermissionControlClientStubDispatch::AcceptWithResponder(
EmbeddedPermissionControlClient* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kEmbeddedPermissionControlClientValidationInfo[] = …;
bool EmbeddedPermissionControlClientRequestValidator::Accept(mojo::Message* message) { … }
const char PermissionService::Name_[] = …;
PermissionService::IPCStableHashFunction PermissionService::MessageToMethodInfo_(mojo::Message& message) { … }
const char* PermissionService::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t PermissionService::HasPermission_Sym::IPCStableHash() { … }
uint32_t PermissionService::RegisterPageEmbeddedPermissionControl_Sym::IPCStableHash() { … }
uint32_t PermissionService::RequestPageEmbeddedPermission_Sym::IPCStableHash() { … }
uint32_t PermissionService::RequestPermission_Sym::IPCStableHash() { … }
uint32_t PermissionService::RequestPermissions_Sym::IPCStableHash() { … }
uint32_t PermissionService::RevokePermission_Sym::IPCStableHash() { … }
uint32_t PermissionService::AddPermissionObserver_Sym::IPCStableHash() { … }
uint32_t PermissionService::AddPageEmbeddedPermissionObserver_Sym::IPCStableHash() { … }
uint32_t PermissionService::NotifyEventListener_Sym::IPCStableHash() { … }
# endif
class PermissionService_HasPermission_ForwardToCallback
: public mojo::MessageReceiver { … };
class PermissionService_RequestPageEmbeddedPermission_ForwardToCallback
: public mojo::MessageReceiver { … };
class PermissionService_RequestPermission_ForwardToCallback
: public mojo::MessageReceiver { … };
class PermissionService_RequestPermissions_ForwardToCallback
: public mojo::MessageReceiver { … };
class PermissionService_RevokePermission_ForwardToCallback
: public mojo::MessageReceiver { … };
PermissionServiceProxy::PermissionServiceProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void PermissionServiceProxy::HasPermission(
PermissionDescriptorPtr in_permission, HasPermissionCallback callback) { … }
void PermissionServiceProxy::RegisterPageEmbeddedPermissionControl(
std::vector<PermissionDescriptorPtr> in_permissions, ::mojo::PendingRemote<EmbeddedPermissionControlClient> in_client) { … }
void PermissionServiceProxy::RequestPageEmbeddedPermission(
EmbeddedPermissionRequestDescriptorPtr in_descriptor, RequestPageEmbeddedPermissionCallback callback) { … }
void PermissionServiceProxy::RequestPermission(
PermissionDescriptorPtr in_permission, bool in_user_gesture, RequestPermissionCallback callback) { … }
void PermissionServiceProxy::RequestPermissions(
std::vector<PermissionDescriptorPtr> in_permission, bool in_user_gesture, RequestPermissionsCallback callback) { … }
void PermissionServiceProxy::RevokePermission(
PermissionDescriptorPtr in_permission, RevokePermissionCallback callback) { … }
void PermissionServiceProxy::AddPermissionObserver(
PermissionDescriptorPtr in_permission, ::blink::mojom::PermissionStatus in_last_known_status, ::mojo::PendingRemote<PermissionObserver> in_observer) { … }
void PermissionServiceProxy::AddPageEmbeddedPermissionObserver(
PermissionDescriptorPtr in_permission, ::blink::mojom::PermissionStatus in_last_known_status, ::mojo::PendingRemote<PermissionObserver> in_observer) { … }
void PermissionServiceProxy::NotifyEventListener(
PermissionDescriptorPtr in_permission, const std::string& in_event_type, bool in_is_added) { … }
class PermissionService_HasPermission_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool PermissionService_HasPermission_ForwardToCallback::Accept(
mojo::Message* message) { … }
void PermissionService_HasPermission_ProxyToResponder::Run(
::blink::mojom::PermissionStatus in_status) { … }
class PermissionService_RequestPageEmbeddedPermission_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool PermissionService_RequestPageEmbeddedPermission_ForwardToCallback::Accept(
mojo::Message* message) { … }
void PermissionService_RequestPageEmbeddedPermission_ProxyToResponder::Run(
EmbeddedPermissionControlResult in_status) { … }
class PermissionService_RequestPermission_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool PermissionService_RequestPermission_ForwardToCallback::Accept(
mojo::Message* message) { … }
void PermissionService_RequestPermission_ProxyToResponder::Run(
::blink::mojom::PermissionStatus in_status) { … }
class PermissionService_RequestPermissions_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool PermissionService_RequestPermissions_ForwardToCallback::Accept(
mojo::Message* message) { … }
void PermissionService_RequestPermissions_ProxyToResponder::Run(
const std::vector<::blink::mojom::PermissionStatus>& in_statuses) { … }
class PermissionService_RevokePermission_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool PermissionService_RevokePermission_ForwardToCallback::Accept(
mojo::Message* message) { … }
void PermissionService_RevokePermission_ProxyToResponder::Run(
::blink::mojom::PermissionStatus in_status) { … }
bool PermissionServiceStubDispatch::Accept(
PermissionService* impl,
mojo::Message* message) { … }
bool PermissionServiceStubDispatch::AcceptWithResponder(
PermissionService* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kPermissionServiceValidationInfo[] = …;
bool PermissionServiceRequestValidator::Accept(mojo::Message* message) { … }
bool PermissionServiceResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::blink::mojom::MidiPermissionDescriptor::DataView, ::blink::mojom::MidiPermissionDescriptorPtr>::Read(
::blink::mojom::MidiPermissionDescriptor::DataView input,
::blink::mojom::MidiPermissionDescriptorPtr* output) { … }
bool StructTraits<::blink::mojom::ClipboardPermissionDescriptor::DataView, ::blink::mojom::ClipboardPermissionDescriptorPtr>::Read(
::blink::mojom::ClipboardPermissionDescriptor::DataView input,
::blink::mojom::ClipboardPermissionDescriptorPtr* output) { … }
bool StructTraits<::blink::mojom::CameraDevicePermissionDescriptor::DataView, ::blink::mojom::CameraDevicePermissionDescriptorPtr>::Read(
::blink::mojom::CameraDevicePermissionDescriptor::DataView input,
::blink::mojom::CameraDevicePermissionDescriptorPtr* output) { … }
bool StructTraits<::blink::mojom::TopLevelStorageAccessPermissionDescriptor::DataView, ::blink::mojom::TopLevelStorageAccessPermissionDescriptorPtr>::Read(
::blink::mojom::TopLevelStorageAccessPermissionDescriptor::DataView input,
::blink::mojom::TopLevelStorageAccessPermissionDescriptorPtr* output) { … }
bool StructTraits<::blink::mojom::FullscreenPermissionDescriptor::DataView, ::blink::mojom::FullscreenPermissionDescriptorPtr>::Read(
::blink::mojom::FullscreenPermissionDescriptor::DataView input,
::blink::mojom::FullscreenPermissionDescriptorPtr* output) { … }
bool StructTraits<::blink::mojom::PermissionDescriptor::DataView, ::blink::mojom::PermissionDescriptorPtr>::Read(
::blink::mojom::PermissionDescriptor::DataView input,
::blink::mojom::PermissionDescriptorPtr* output) { … }
bool StructTraits<::blink::mojom::EmbeddedPermissionRequestDescriptor::DataView, ::blink::mojom::EmbeddedPermissionRequestDescriptorPtr>::Read(
::blink::mojom::EmbeddedPermissionRequestDescriptor::DataView input,
::blink::mojom::EmbeddedPermissionRequestDescriptorPtr* output) { … }
bool UnionTraits<::blink::mojom::PermissionDescriptorExtension::DataView, ::blink::mojom::PermissionDescriptorExtensionPtr>::Read(
::blink::mojom::PermissionDescriptorExtension::DataView input,
::blink::mojom::PermissionDescriptorExtensionPtr* output) { … }
}
namespace blink::mojom {
void PermissionObserverInterceptorForTesting::OnPermissionStatusChange(::blink::mojom::PermissionStatus status) { … }
PermissionObserverAsyncWaiter::PermissionObserverAsyncWaiter(
PermissionObserver* proxy) : … { … }
PermissionObserverAsyncWaiter::~PermissionObserverAsyncWaiter() = default;
void EmbeddedPermissionControlClientInterceptorForTesting::OnEmbeddedPermissionControlRegistered(bool allow, const std::optional<std::vector<::blink::mojom::PermissionStatus>>& statuses) { … }
EmbeddedPermissionControlClientAsyncWaiter::EmbeddedPermissionControlClientAsyncWaiter(
EmbeddedPermissionControlClient* proxy) : … { … }
EmbeddedPermissionControlClientAsyncWaiter::~EmbeddedPermissionControlClientAsyncWaiter() = default;
void PermissionServiceInterceptorForTesting::HasPermission(PermissionDescriptorPtr permission, HasPermissionCallback callback) { … }
void PermissionServiceInterceptorForTesting::RegisterPageEmbeddedPermissionControl(std::vector<PermissionDescriptorPtr> permissions, ::mojo::PendingRemote<EmbeddedPermissionControlClient> client) { … }
void PermissionServiceInterceptorForTesting::RequestPageEmbeddedPermission(EmbeddedPermissionRequestDescriptorPtr descriptor, RequestPageEmbeddedPermissionCallback callback) { … }
void PermissionServiceInterceptorForTesting::RequestPermission(PermissionDescriptorPtr permission, bool user_gesture, RequestPermissionCallback callback) { … }
void PermissionServiceInterceptorForTesting::RequestPermissions(std::vector<PermissionDescriptorPtr> permission, bool user_gesture, RequestPermissionsCallback callback) { … }
void PermissionServiceInterceptorForTesting::RevokePermission(PermissionDescriptorPtr permission, RevokePermissionCallback callback) { … }
void PermissionServiceInterceptorForTesting::AddPermissionObserver(PermissionDescriptorPtr permission, ::blink::mojom::PermissionStatus last_known_status, ::mojo::PendingRemote<PermissionObserver> observer) { … }
void PermissionServiceInterceptorForTesting::AddPageEmbeddedPermissionObserver(PermissionDescriptorPtr permission, ::blink::mojom::PermissionStatus last_known_status, ::mojo::PendingRemote<PermissionObserver> observer) { … }
void PermissionServiceInterceptorForTesting::NotifyEventListener(PermissionDescriptorPtr permission, const std::string& event_type, bool is_added) { … }
PermissionServiceAsyncWaiter::PermissionServiceAsyncWaiter(
PermissionService* proxy) : … { … }
PermissionServiceAsyncWaiter::~PermissionServiceAsyncWaiter() = default;
void PermissionServiceAsyncWaiter::HasPermission(
PermissionDescriptorPtr permission, ::blink::mojom::PermissionStatus* out_status) { … }
::blink::mojom::PermissionStatus PermissionServiceAsyncWaiter::HasPermission(
PermissionDescriptorPtr permission) { … }
void PermissionServiceAsyncWaiter::RequestPageEmbeddedPermission(
EmbeddedPermissionRequestDescriptorPtr descriptor, EmbeddedPermissionControlResult* out_status) { … }
EmbeddedPermissionControlResult PermissionServiceAsyncWaiter::RequestPageEmbeddedPermission(
EmbeddedPermissionRequestDescriptorPtr descriptor) { … }
void PermissionServiceAsyncWaiter::RequestPermission(
PermissionDescriptorPtr permission, bool user_gesture, ::blink::mojom::PermissionStatus* out_status) { … }
::blink::mojom::PermissionStatus PermissionServiceAsyncWaiter::RequestPermission(
PermissionDescriptorPtr permission, bool user_gesture) { … }
void PermissionServiceAsyncWaiter::RequestPermissions(
std::vector<PermissionDescriptorPtr> permission, bool user_gesture, std::vector<::blink::mojom::PermissionStatus>* out_statuses) { … }
std::vector<::blink::mojom::PermissionStatus> PermissionServiceAsyncWaiter::RequestPermissions(
std::vector<PermissionDescriptorPtr> permission, bool user_gesture) { … }
void PermissionServiceAsyncWaiter::RevokePermission(
PermissionDescriptorPtr permission, ::blink::mojom::PermissionStatus* out_status) { … }
::blink::mojom::PermissionStatus PermissionServiceAsyncWaiter::RevokePermission(
PermissionDescriptorPtr permission) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif