#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "media/mojo/mojom/speech_recognizer.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 "media/mojo/mojom/speech_recognizer.mojom-params-data.h"
#include "media/mojo/mojom/speech_recognizer.mojom-shared-message-ids.h"
#include "media/mojo/mojom/speech_recognizer.mojom-import-headers.h"
#include "media/mojo/mojom/speech_recognizer.mojom-test-utils.h"
namespace media::mojom {
StartSpeechRecognitionRequestParams::StartSpeechRecognitionRequestParams()
: … { … }
StartSpeechRecognitionRequestParams::StartSpeechRecognitionRequestParams(
::mojo::PendingReceiver<SpeechRecognitionSession> session_receiver_in,
::mojo::PendingRemote<SpeechRecognitionSessionClient> client_in,
const std::string& language_in,
std::vector<::media::mojom::SpeechRecognitionGrammarPtr> grammars_in,
uint32_t max_hypotheses_in,
bool continuous_in,
bool interim_results_in,
bool on_device_in,
bool allow_cloud_fallback_in,
::mojo::PendingReceiver<::media::mojom::SpeechRecognitionAudioForwarder> audio_forwarder_in,
int32_t channel_count_in,
int32_t sample_rate_in)
: … { … }
StartSpeechRecognitionRequestParams::~StartSpeechRecognitionRequestParams() = default;
void StartSpeechRecognitionRequestParams::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool StartSpeechRecognitionRequestParams::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char SpeechRecognizer::Name_[] = …;
SpeechRecognizer::IPCStableHashFunction SpeechRecognizer::MessageToMethodInfo_(mojo::Message& message) { … }
const char* SpeechRecognizer::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t SpeechRecognizer::Start_Sym::IPCStableHash() { … }
# endif
SpeechRecognizerProxy::SpeechRecognizerProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void SpeechRecognizerProxy::Start(
StartSpeechRecognitionRequestParamsPtr in_params) { … }
bool SpeechRecognizerStubDispatch::Accept(
SpeechRecognizer* impl,
mojo::Message* message) { … }
bool SpeechRecognizerStubDispatch::AcceptWithResponder(
SpeechRecognizer* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kSpeechRecognizerValidationInfo[] = …;
bool SpeechRecognizerRequestValidator::Accept(mojo::Message* message) { … }
const char OnDeviceSpeechRecognition::Name_[] = …;
OnDeviceSpeechRecognition::IPCStableHashFunction OnDeviceSpeechRecognition::MessageToMethodInfo_(mojo::Message& message) { … }
const char* OnDeviceSpeechRecognition::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t OnDeviceSpeechRecognition::OnDeviceWebSpeechAvailable_Sym::IPCStableHash() { … }
uint32_t OnDeviceSpeechRecognition::InstallOnDeviceSpeechRecognition_Sym::IPCStableHash() { … }
# endif
class OnDeviceSpeechRecognition_OnDeviceWebSpeechAvailable_ForwardToCallback
: public mojo::MessageReceiver { … };
class OnDeviceSpeechRecognition_InstallOnDeviceSpeechRecognition_ForwardToCallback
: public mojo::MessageReceiver { … };
OnDeviceSpeechRecognitionProxy::OnDeviceSpeechRecognitionProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void OnDeviceSpeechRecognitionProxy::OnDeviceWebSpeechAvailable(
const std::string& in_language, OnDeviceWebSpeechAvailableCallback callback) { … }
void OnDeviceSpeechRecognitionProxy::InstallOnDeviceSpeechRecognition(
const std::string& in_language, InstallOnDeviceSpeechRecognitionCallback callback) { … }
class OnDeviceSpeechRecognition_OnDeviceWebSpeechAvailable_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool OnDeviceSpeechRecognition_OnDeviceWebSpeechAvailable_ForwardToCallback::Accept(
mojo::Message* message) { … }
void OnDeviceSpeechRecognition_OnDeviceWebSpeechAvailable_ProxyToResponder::Run(
bool in_available) { … }
class OnDeviceSpeechRecognition_InstallOnDeviceSpeechRecognition_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool OnDeviceSpeechRecognition_InstallOnDeviceSpeechRecognition_ForwardToCallback::Accept(
mojo::Message* message) { … }
void OnDeviceSpeechRecognition_InstallOnDeviceSpeechRecognition_ProxyToResponder::Run(
bool in_success) { … }
bool OnDeviceSpeechRecognitionStubDispatch::Accept(
OnDeviceSpeechRecognition* impl,
mojo::Message* message) { … }
bool OnDeviceSpeechRecognitionStubDispatch::AcceptWithResponder(
OnDeviceSpeechRecognition* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kOnDeviceSpeechRecognitionValidationInfo[] = …;
bool OnDeviceSpeechRecognitionRequestValidator::Accept(mojo::Message* message) { … }
bool OnDeviceSpeechRecognitionResponseValidator::Accept(mojo::Message* message) { … }
const char SpeechRecognitionSession::Name_[] = …;
SpeechRecognitionSession::IPCStableHashFunction SpeechRecognitionSession::MessageToMethodInfo_(mojo::Message& message) { … }
const char* SpeechRecognitionSession::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t SpeechRecognitionSession::Abort_Sym::IPCStableHash() { … }
uint32_t SpeechRecognitionSession::StopCapture_Sym::IPCStableHash() { … }
# endif
SpeechRecognitionSessionProxy::SpeechRecognitionSessionProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void SpeechRecognitionSessionProxy::Abort(
) { … }
void SpeechRecognitionSessionProxy::StopCapture(
) { … }
bool SpeechRecognitionSessionStubDispatch::Accept(
SpeechRecognitionSession* impl,
mojo::Message* message) { … }
bool SpeechRecognitionSessionStubDispatch::AcceptWithResponder(
SpeechRecognitionSession* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kSpeechRecognitionSessionValidationInfo[] = …;
bool SpeechRecognitionSessionRequestValidator::Accept(mojo::Message* message) { … }
const char SpeechRecognitionSessionClient::Name_[] = …;
SpeechRecognitionSessionClient::IPCStableHashFunction SpeechRecognitionSessionClient::MessageToMethodInfo_(mojo::Message& message) { … }
const char* SpeechRecognitionSessionClient::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t SpeechRecognitionSessionClient::ResultRetrieved_Sym::IPCStableHash() { … }
uint32_t SpeechRecognitionSessionClient::ErrorOccurred_Sym::IPCStableHash() { … }
uint32_t SpeechRecognitionSessionClient::Started_Sym::IPCStableHash() { … }
uint32_t SpeechRecognitionSessionClient::AudioStarted_Sym::IPCStableHash() { … }
uint32_t SpeechRecognitionSessionClient::SoundStarted_Sym::IPCStableHash() { … }
uint32_t SpeechRecognitionSessionClient::SoundEnded_Sym::IPCStableHash() { … }
uint32_t SpeechRecognitionSessionClient::AudioEnded_Sym::IPCStableHash() { … }
uint32_t SpeechRecognitionSessionClient::Ended_Sym::IPCStableHash() { … }
# endif
SpeechRecognitionSessionClientProxy::SpeechRecognitionSessionClientProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void SpeechRecognitionSessionClientProxy::ResultRetrieved(
std::vector<::media::mojom::WebSpeechRecognitionResultPtr> in_results) { … }
void SpeechRecognitionSessionClientProxy::ErrorOccurred(
::media::mojom::SpeechRecognitionErrorPtr in_error) { … }
void SpeechRecognitionSessionClientProxy::Started(
) { … }
void SpeechRecognitionSessionClientProxy::AudioStarted(
) { … }
void SpeechRecognitionSessionClientProxy::SoundStarted(
) { … }
void SpeechRecognitionSessionClientProxy::SoundEnded(
) { … }
void SpeechRecognitionSessionClientProxy::AudioEnded(
) { … }
void SpeechRecognitionSessionClientProxy::Ended(
) { … }
bool SpeechRecognitionSessionClientStubDispatch::Accept(
SpeechRecognitionSessionClient* impl,
mojo::Message* message) { … }
bool SpeechRecognitionSessionClientStubDispatch::AcceptWithResponder(
SpeechRecognitionSessionClient* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kSpeechRecognitionSessionClientValidationInfo[] = …;
bool SpeechRecognitionSessionClientRequestValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::media::mojom::StartSpeechRecognitionRequestParams::DataView, ::media::mojom::StartSpeechRecognitionRequestParamsPtr>::Read(
::media::mojom::StartSpeechRecognitionRequestParams::DataView input,
::media::mojom::StartSpeechRecognitionRequestParamsPtr* output) { … }
}
namespace media::mojom {
void SpeechRecognizerInterceptorForTesting::Start(StartSpeechRecognitionRequestParamsPtr params) { … }
SpeechRecognizerAsyncWaiter::SpeechRecognizerAsyncWaiter(
SpeechRecognizer* proxy) : … { … }
SpeechRecognizerAsyncWaiter::~SpeechRecognizerAsyncWaiter() = default;
void OnDeviceSpeechRecognitionInterceptorForTesting::OnDeviceWebSpeechAvailable(const std::string& language, OnDeviceWebSpeechAvailableCallback callback) { … }
void OnDeviceSpeechRecognitionInterceptorForTesting::InstallOnDeviceSpeechRecognition(const std::string& language, InstallOnDeviceSpeechRecognitionCallback callback) { … }
OnDeviceSpeechRecognitionAsyncWaiter::OnDeviceSpeechRecognitionAsyncWaiter(
OnDeviceSpeechRecognition* proxy) : … { … }
OnDeviceSpeechRecognitionAsyncWaiter::~OnDeviceSpeechRecognitionAsyncWaiter() = default;
void OnDeviceSpeechRecognitionAsyncWaiter::OnDeviceWebSpeechAvailable(
const std::string& language, bool* out_available) { … }
bool OnDeviceSpeechRecognitionAsyncWaiter::OnDeviceWebSpeechAvailable(
const std::string& language) { … }
void OnDeviceSpeechRecognitionAsyncWaiter::InstallOnDeviceSpeechRecognition(
const std::string& language, bool* out_success) { … }
bool OnDeviceSpeechRecognitionAsyncWaiter::InstallOnDeviceSpeechRecognition(
const std::string& language) { … }
void SpeechRecognitionSessionInterceptorForTesting::Abort() { … }
void SpeechRecognitionSessionInterceptorForTesting::StopCapture() { … }
SpeechRecognitionSessionAsyncWaiter::SpeechRecognitionSessionAsyncWaiter(
SpeechRecognitionSession* proxy) : … { … }
SpeechRecognitionSessionAsyncWaiter::~SpeechRecognitionSessionAsyncWaiter() = default;
void SpeechRecognitionSessionClientInterceptorForTesting::ResultRetrieved(std::vector<::media::mojom::WebSpeechRecognitionResultPtr> results) { … }
void SpeechRecognitionSessionClientInterceptorForTesting::ErrorOccurred(::media::mojom::SpeechRecognitionErrorPtr error) { … }
void SpeechRecognitionSessionClientInterceptorForTesting::Started() { … }
void SpeechRecognitionSessionClientInterceptorForTesting::AudioStarted() { … }
void SpeechRecognitionSessionClientInterceptorForTesting::SoundStarted() { … }
void SpeechRecognitionSessionClientInterceptorForTesting::SoundEnded() { … }
void SpeechRecognitionSessionClientInterceptorForTesting::AudioEnded() { … }
void SpeechRecognitionSessionClientInterceptorForTesting::Ended() { … }
SpeechRecognitionSessionClientAsyncWaiter::SpeechRecognitionSessionClientAsyncWaiter(
SpeechRecognitionSessionClient* proxy) : … { … }
SpeechRecognitionSessionClientAsyncWaiter::~SpeechRecognitionSessionClientAsyncWaiter() = default;
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif