#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "services/media_session/public/mojom/audio_focus.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 "services/media_session/public/mojom/audio_focus.mojom-params-data.h"
#include "services/media_session/public/mojom/audio_focus.mojom-shared-message-ids.h"
#include "services/media_session/public/mojom/audio_focus.mojom-import-headers.h"
#include "services/media_session/public/mojom/audio_focus.mojom-test-utils.h"
namespace media_session::mojom {
AudioFocusRequestState::AudioFocusRequestState()
: … { … }
AudioFocusRequestState::AudioFocusRequestState(
::media_session::mojom::MediaSessionInfoPtr session_info_in,
AudioFocusType audio_focus_type_in)
: … { … }
AudioFocusRequestState::AudioFocusRequestState(
::media_session::mojom::MediaSessionInfoPtr session_info_in,
AudioFocusType audio_focus_type_in,
const std::optional<std::string>& source_name_in)
: … { … }
AudioFocusRequestState::AudioFocusRequestState(
::media_session::mojom::MediaSessionInfoPtr session_info_in,
AudioFocusType audio_focus_type_in,
const std::optional<std::string>& source_name_in,
const std::optional<::base::UnguessableToken>& request_id_in)
: … { … }
AudioFocusRequestState::AudioFocusRequestState(
::media_session::mojom::MediaSessionInfoPtr session_info_in,
AudioFocusType audio_focus_type_in,
const std::optional<std::string>& source_name_in,
const std::optional<::base::UnguessableToken>& request_id_in,
const std::optional<::base::UnguessableToken>& source_id_in)
: … { … }
AudioFocusRequestState::~AudioFocusRequestState() = default;
void AudioFocusRequestState::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool AudioFocusRequestState::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char AudioFocusObserver::Name_[] = …;
AudioFocusObserver::IPCStableHashFunction AudioFocusObserver::MessageToMethodInfo_(mojo::Message& message) { … }
const char* AudioFocusObserver::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t AudioFocusObserver::OnFocusGained_Sym::IPCStableHash() { … }
uint32_t AudioFocusObserver::OnFocusLost_Sym::IPCStableHash() { … }
uint32_t AudioFocusObserver::OnRequestIdReleased_Sym::IPCStableHash() { … }
# endif
AudioFocusObserverProxy::AudioFocusObserverProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void AudioFocusObserverProxy::OnFocusGained(
AudioFocusRequestStatePtr in_state) { … }
void AudioFocusObserverProxy::OnFocusLost(
AudioFocusRequestStatePtr in_state) { … }
void AudioFocusObserverProxy::OnRequestIdReleased(
const ::base::UnguessableToken& in_request_id) { … }
bool AudioFocusObserverStubDispatch::Accept(
AudioFocusObserver* impl,
mojo::Message* message) { … }
bool AudioFocusObserverStubDispatch::AcceptWithResponder(
AudioFocusObserver* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kAudioFocusObserverValidationInfo[] = …;
bool AudioFocusObserverRequestValidator::Accept(mojo::Message* message) { … }
const char AudioFocusRequestClient::Name_[] = …;
AudioFocusRequestClient::IPCStableHashFunction AudioFocusRequestClient::MessageToMethodInfo_(mojo::Message& message) { … }
const char* AudioFocusRequestClient::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t AudioFocusRequestClient::RequestAudioFocus_Sym::IPCStableHash() { … }
uint32_t AudioFocusRequestClient::AbandonAudioFocus_Sym::IPCStableHash() { … }
uint32_t AudioFocusRequestClient::MediaSessionInfoChanged_Sym::IPCStableHash() { … }
# endif
class AudioFocusRequestClient_RequestAudioFocus_ForwardToCallback
: public mojo::MessageReceiver { … };
AudioFocusRequestClientProxy::AudioFocusRequestClientProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void AudioFocusRequestClientProxy::RequestAudioFocus(
::media_session::mojom::MediaSessionInfoPtr in_session_info, AudioFocusType in_type, RequestAudioFocusCallback callback) { … }
void AudioFocusRequestClientProxy::AbandonAudioFocus(
) { … }
void AudioFocusRequestClientProxy::MediaSessionInfoChanged(
::media_session::mojom::MediaSessionInfoPtr in_session_info) { … }
class AudioFocusRequestClient_RequestAudioFocus_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool AudioFocusRequestClient_RequestAudioFocus_ForwardToCallback::Accept(
mojo::Message* message) { … }
void AudioFocusRequestClient_RequestAudioFocus_ProxyToResponder::Run(
) { … }
bool AudioFocusRequestClientStubDispatch::Accept(
AudioFocusRequestClient* impl,
mojo::Message* message) { … }
bool AudioFocusRequestClientStubDispatch::AcceptWithResponder(
AudioFocusRequestClient* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kAudioFocusRequestClientValidationInfo[] = …;
bool AudioFocusRequestClientRequestValidator::Accept(mojo::Message* message) { … }
bool AudioFocusRequestClientResponseValidator::Accept(mojo::Message* message) { … }
const char AudioFocusManager::Name_[] = …;
constexpr base::Token AudioFocusManager::Uuid_;
AudioFocusManager::IPCStableHashFunction AudioFocusManager::MessageToMethodInfo_(mojo::Message& message) { … }
const char* AudioFocusManager::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t AudioFocusManager::RequestAudioFocus_Sym::IPCStableHash() { … }
uint32_t AudioFocusManager::RequestGroupedAudioFocus_Sym::IPCStableHash() { … }
uint32_t AudioFocusManager::GetFocusRequests_Sym::IPCStableHash() { … }
uint32_t AudioFocusManager::AddObserver_Sym::IPCStableHash() { … }
uint32_t AudioFocusManager::SetSource_Sym::IPCStableHash() { … }
uint32_t AudioFocusManager::SetEnforcementMode_Sym::IPCStableHash() { … }
uint32_t AudioFocusManager::AddSourceObserver_Sym::IPCStableHash() { … }
uint32_t AudioFocusManager::GetSourceFocusRequests_Sym::IPCStableHash() { … }
uint32_t AudioFocusManager::RequestIdReleased_Sym::IPCStableHash() { … }
# endif
class AudioFocusManager_RequestAudioFocus_ForwardToCallback
: public mojo::MessageReceiver { … };
class AudioFocusManager_RequestGroupedAudioFocus_ForwardToCallback
: public mojo::MessageReceiver { … };
class AudioFocusManager_GetFocusRequests_ForwardToCallback
: public mojo::MessageReceiver { … };
class AudioFocusManager_GetSourceFocusRequests_ForwardToCallback
: public mojo::MessageReceiver { … };
AudioFocusManagerProxy::AudioFocusManagerProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void AudioFocusManagerProxy::RequestAudioFocus(
::mojo::PendingReceiver<AudioFocusRequestClient> in_client, ::mojo::PendingRemote<::media_session::mojom::MediaSession> in_session, ::media_session::mojom::MediaSessionInfoPtr in_session_info, AudioFocusType in_type, RequestAudioFocusCallback callback) { … }
void AudioFocusManagerProxy::RequestGroupedAudioFocus(
const ::base::UnguessableToken& in_request_id, ::mojo::PendingReceiver<AudioFocusRequestClient> in_client, ::mojo::PendingRemote<::media_session::mojom::MediaSession> in_session, ::media_session::mojom::MediaSessionInfoPtr in_session_info, AudioFocusType in_type, const ::base::UnguessableToken& in_group_id, RequestGroupedAudioFocusCallback callback) { … }
void AudioFocusManagerProxy::GetFocusRequests(
GetFocusRequestsCallback callback) { … }
void AudioFocusManagerProxy::AddObserver(
::mojo::PendingRemote<AudioFocusObserver> in_observer) { … }
void AudioFocusManagerProxy::SetSource(
const ::base::UnguessableToken& in_identity, const std::string& in_name) { … }
void AudioFocusManagerProxy::SetEnforcementMode(
EnforcementMode in_mode) { … }
void AudioFocusManagerProxy::AddSourceObserver(
const ::base::UnguessableToken& in_source_id, ::mojo::PendingRemote<AudioFocusObserver> in_observer) { … }
void AudioFocusManagerProxy::GetSourceFocusRequests(
const ::base::UnguessableToken& in_source_id, GetSourceFocusRequestsCallback callback) { … }
void AudioFocusManagerProxy::RequestIdReleased(
const ::base::UnguessableToken& in_request_id) { … }
class AudioFocusManager_RequestAudioFocus_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool AudioFocusManager_RequestAudioFocus_ForwardToCallback::Accept(
mojo::Message* message) { … }
void AudioFocusManager_RequestAudioFocus_ProxyToResponder::Run(
const ::base::UnguessableToken& in_request_id) { … }
class AudioFocusManager_RequestGroupedAudioFocus_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool AudioFocusManager_RequestGroupedAudioFocus_ForwardToCallback::Accept(
mojo::Message* message) { … }
void AudioFocusManager_RequestGroupedAudioFocus_ProxyToResponder::Run(
bool in_success) { … }
class AudioFocusManager_GetFocusRequests_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool AudioFocusManager_GetFocusRequests_ForwardToCallback::Accept(
mojo::Message* message) { … }
void AudioFocusManager_GetFocusRequests_ProxyToResponder::Run(
std::vector<AudioFocusRequestStatePtr> in_requests) { … }
class AudioFocusManager_GetSourceFocusRequests_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool AudioFocusManager_GetSourceFocusRequests_ForwardToCallback::Accept(
mojo::Message* message) { … }
void AudioFocusManager_GetSourceFocusRequests_ProxyToResponder::Run(
std::vector<AudioFocusRequestStatePtr> in_requests) { … }
bool AudioFocusManagerStubDispatch::Accept(
AudioFocusManager* impl,
mojo::Message* message) { … }
bool AudioFocusManagerStubDispatch::AcceptWithResponder(
AudioFocusManager* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kAudioFocusManagerValidationInfo[] = …;
bool AudioFocusManagerRequestValidator::Accept(mojo::Message* message) { … }
bool AudioFocusManagerResponseValidator::Accept(mojo::Message* message) { … }
const char AudioFocusManagerDebug::Name_[] = …;
constexpr base::Token AudioFocusManagerDebug::Uuid_;
AudioFocusManagerDebug::IPCStableHashFunction AudioFocusManagerDebug::MessageToMethodInfo_(mojo::Message& message) { … }
const char* AudioFocusManagerDebug::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t AudioFocusManagerDebug::GetDebugInfoForRequest_Sym::IPCStableHash() { … }
# endif
class AudioFocusManagerDebug_GetDebugInfoForRequest_ForwardToCallback
: public mojo::MessageReceiver { … };
AudioFocusManagerDebugProxy::AudioFocusManagerDebugProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void AudioFocusManagerDebugProxy::GetDebugInfoForRequest(
const ::base::UnguessableToken& in_request_id, GetDebugInfoForRequestCallback callback) { … }
class AudioFocusManagerDebug_GetDebugInfoForRequest_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool AudioFocusManagerDebug_GetDebugInfoForRequest_ForwardToCallback::Accept(
mojo::Message* message) { … }
void AudioFocusManagerDebug_GetDebugInfoForRequest_ProxyToResponder::Run(
::media_session::mojom::MediaSessionDebugInfoPtr in_debug_info) { … }
bool AudioFocusManagerDebugStubDispatch::Accept(
AudioFocusManagerDebug* impl,
mojo::Message* message) { … }
bool AudioFocusManagerDebugStubDispatch::AcceptWithResponder(
AudioFocusManagerDebug* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kAudioFocusManagerDebugValidationInfo[] = …;
bool AudioFocusManagerDebugRequestValidator::Accept(mojo::Message* message) { … }
bool AudioFocusManagerDebugResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::media_session::mojom::AudioFocusRequestState::DataView, ::media_session::mojom::AudioFocusRequestStatePtr>::Read(
::media_session::mojom::AudioFocusRequestState::DataView input,
::media_session::mojom::AudioFocusRequestStatePtr* output) { … }
}
namespace media_session::mojom {
void AudioFocusObserverInterceptorForTesting::OnFocusGained(AudioFocusRequestStatePtr state) { … }
void AudioFocusObserverInterceptorForTesting::OnFocusLost(AudioFocusRequestStatePtr state) { … }
void AudioFocusObserverInterceptorForTesting::OnRequestIdReleased(const ::base::UnguessableToken& request_id) { … }
AudioFocusObserverAsyncWaiter::AudioFocusObserverAsyncWaiter(
AudioFocusObserver* proxy) : … { … }
AudioFocusObserverAsyncWaiter::~AudioFocusObserverAsyncWaiter() = default;
void AudioFocusRequestClientInterceptorForTesting::RequestAudioFocus(::media_session::mojom::MediaSessionInfoPtr session_info, AudioFocusType type, RequestAudioFocusCallback callback) { … }
void AudioFocusRequestClientInterceptorForTesting::AbandonAudioFocus() { … }
void AudioFocusRequestClientInterceptorForTesting::MediaSessionInfoChanged(::media_session::mojom::MediaSessionInfoPtr session_info) { … }
AudioFocusRequestClientAsyncWaiter::AudioFocusRequestClientAsyncWaiter(
AudioFocusRequestClient* proxy) : … { … }
AudioFocusRequestClientAsyncWaiter::~AudioFocusRequestClientAsyncWaiter() = default;
void AudioFocusRequestClientAsyncWaiter::RequestAudioFocus(
::media_session::mojom::MediaSessionInfoPtr session_info, AudioFocusType type) { … }
void AudioFocusManagerInterceptorForTesting::RequestAudioFocus(::mojo::PendingReceiver<AudioFocusRequestClient> client, ::mojo::PendingRemote<::media_session::mojom::MediaSession> session, ::media_session::mojom::MediaSessionInfoPtr session_info, AudioFocusType type, RequestAudioFocusCallback callback) { … }
void AudioFocusManagerInterceptorForTesting::RequestGroupedAudioFocus(const ::base::UnguessableToken& request_id, ::mojo::PendingReceiver<AudioFocusRequestClient> client, ::mojo::PendingRemote<::media_session::mojom::MediaSession> session, ::media_session::mojom::MediaSessionInfoPtr session_info, AudioFocusType type, const ::base::UnguessableToken& group_id, RequestGroupedAudioFocusCallback callback) { … }
void AudioFocusManagerInterceptorForTesting::GetFocusRequests(GetFocusRequestsCallback callback) { … }
void AudioFocusManagerInterceptorForTesting::AddObserver(::mojo::PendingRemote<AudioFocusObserver> observer) { … }
void AudioFocusManagerInterceptorForTesting::SetSource(const ::base::UnguessableToken& identity, const std::string& name) { … }
void AudioFocusManagerInterceptorForTesting::SetEnforcementMode(EnforcementMode mode) { … }
void AudioFocusManagerInterceptorForTesting::AddSourceObserver(const ::base::UnguessableToken& source_id, ::mojo::PendingRemote<AudioFocusObserver> observer) { … }
void AudioFocusManagerInterceptorForTesting::GetSourceFocusRequests(const ::base::UnguessableToken& source_id, GetSourceFocusRequestsCallback callback) { … }
void AudioFocusManagerInterceptorForTesting::RequestIdReleased(const ::base::UnguessableToken& request_id) { … }
AudioFocusManagerAsyncWaiter::AudioFocusManagerAsyncWaiter(
AudioFocusManager* proxy) : … { … }
AudioFocusManagerAsyncWaiter::~AudioFocusManagerAsyncWaiter() = default;
void AudioFocusManagerAsyncWaiter::RequestAudioFocus(
::mojo::PendingReceiver<AudioFocusRequestClient> client, ::mojo::PendingRemote<::media_session::mojom::MediaSession> session, ::media_session::mojom::MediaSessionInfoPtr session_info, AudioFocusType type, ::base::UnguessableToken* out_request_id) { … }
::base::UnguessableToken AudioFocusManagerAsyncWaiter::RequestAudioFocus(
::mojo::PendingReceiver<AudioFocusRequestClient> client, ::mojo::PendingRemote<::media_session::mojom::MediaSession> session, ::media_session::mojom::MediaSessionInfoPtr session_info, AudioFocusType type) { … }
void AudioFocusManagerAsyncWaiter::RequestGroupedAudioFocus(
const ::base::UnguessableToken& request_id, ::mojo::PendingReceiver<AudioFocusRequestClient> client, ::mojo::PendingRemote<::media_session::mojom::MediaSession> session, ::media_session::mojom::MediaSessionInfoPtr session_info, AudioFocusType type, const ::base::UnguessableToken& group_id, bool* out_success) { … }
bool AudioFocusManagerAsyncWaiter::RequestGroupedAudioFocus(
const ::base::UnguessableToken& request_id, ::mojo::PendingReceiver<AudioFocusRequestClient> client, ::mojo::PendingRemote<::media_session::mojom::MediaSession> session, ::media_session::mojom::MediaSessionInfoPtr session_info, AudioFocusType type, const ::base::UnguessableToken& group_id) { … }
void AudioFocusManagerAsyncWaiter::GetFocusRequests(
std::vector<AudioFocusRequestStatePtr>* out_requests) { … }
std::vector<AudioFocusRequestStatePtr> AudioFocusManagerAsyncWaiter::GetFocusRequests(
) { … }
void AudioFocusManagerAsyncWaiter::GetSourceFocusRequests(
const ::base::UnguessableToken& source_id, std::vector<AudioFocusRequestStatePtr>* out_requests) { … }
std::vector<AudioFocusRequestStatePtr> AudioFocusManagerAsyncWaiter::GetSourceFocusRequests(
const ::base::UnguessableToken& source_id) { … }
void AudioFocusManagerDebugInterceptorForTesting::GetDebugInfoForRequest(const ::base::UnguessableToken& request_id, GetDebugInfoForRequestCallback callback) { … }
AudioFocusManagerDebugAsyncWaiter::AudioFocusManagerDebugAsyncWaiter(
AudioFocusManagerDebug* proxy) : … { … }
AudioFocusManagerDebugAsyncWaiter::~AudioFocusManagerDebugAsyncWaiter() = default;
void AudioFocusManagerDebugAsyncWaiter::GetDebugInfoForRequest(
const ::base::UnguessableToken& request_id, ::media_session::mojom::MediaSessionDebugInfoPtr* out_debug_info) { … }
::media_session::mojom::MediaSessionDebugInfoPtr AudioFocusManagerDebugAsyncWaiter::GetDebugInfoForRequest(
const ::base::UnguessableToken& request_id) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif