Generated file

Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/hwinference/PSpeechRecognitionChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/hwinference/SpeechRecognitionChild.h"
#include "ipc/IPCMessageUtils.h"
#include "ipc/IPCMessageUtilsSpecializations.h"
#include "nsIFile.h"
#include "mozilla/ipc/Endpoint.h"
#include "mozilla/ipc/ProtocolMessageUtils.h"
#include "mozilla/ipc/ProtocolUtils.h"
#include "mozilla/ipc/ShmemMessageUtils.h"
#include "mozilla/ipc/TaintingIPCUtils.h"
namespace mozilla {
namespace hwinference {
auto PSpeechRecognitionChild::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PSpeechRecognitionChild::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PSpeechRecognitionChild::PSpeechRecognitionChild() :
mozilla::ipc::IToplevelProtocol("PSpeechRecognitionChild", kProtocolId, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PSpeechRecognitionChild);
}
PSpeechRecognitionChild::~PSpeechRecognitionChild()
{
MOZ_COUNT_DTOR(PSpeechRecognitionChild);
}
auto PSpeechRecognitionChild::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsContentProcess(), "Invalid process for `PSpeechRecognitionChild'");
AddRef();
}
auto PSpeechRecognitionChild::ActorDealloc() -> void
{
Release();
}
auto PSpeechRecognitionChild::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PSpeechRecognitionChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PSpeechRecognitionChild::RejectPendingResponses(ResponseRejectReason aReason) -> void
{
mAsyncCallbacks.RejectPendingResponses(aReason);
}
auto PSpeechRecognitionChild::SendIsModelAvailable(
mozilla::Span<nsCString const> languages,
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PSpeechRecognition::Msg_IsModelAvailable(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), languages);
// Sentinel = 'languages'
((&(writer__)))->WriteSentinel(310903736);
if (mozilla::ipc::LoggingEnabledFor("PSpeechRecognition", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechRecognitionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSpeechRecognition::Msg_IsModelAvailable", OTHER);
IPC::Message::seqno_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PSpeechRecognition::Reply_IsModelAvailable__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__available = IPC::ReadParam<bool>(aReader);
if (!maybe__available) {
(aReader)->FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& available = *maybe__available;
// Sentinel = 'available'
if ((!((aReader)->ReadSentinel(306316194)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(available));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PSpeechRecognitionChild::SendIsModelAvailable(mozilla::Span<nsCString const> languages) -> RefPtr<IsModelAvailablePromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendIsModelAvailable(std::forward<mozilla::Span<nsCString const>>(languages), [promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PSpeechRecognitionChild::SendIsModelInstalled(
mozilla::Span<nsCString const> languages,
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PSpeechRecognition::Msg_IsModelInstalled(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), languages);
// Sentinel = 'languages'
((&(writer__)))->WriteSentinel(310903736);
if (mozilla::ipc::LoggingEnabledFor("PSpeechRecognition", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechRecognitionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSpeechRecognition::Msg_IsModelInstalled", OTHER);
IPC::Message::seqno_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PSpeechRecognition::Reply_IsModelInstalled__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__installed = IPC::ReadParam<bool>(aReader);
if (!maybe__installed) {
(aReader)->FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& installed = *maybe__installed;
// Sentinel = 'installed'
if ((!((aReader)->ReadSentinel(319685569)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(installed));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PSpeechRecognitionChild::SendIsModelInstalled(mozilla::Span<nsCString const> languages) -> RefPtr<IsModelInstalledPromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendIsModelInstalled(std::forward<mozilla::Span<nsCString const>>(languages), [promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PSpeechRecognitionChild::SendInstallModels(
mozilla::Span<nsCString const> languages,
const uint64_t& innerWindowId,
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PSpeechRecognition::Msg_InstallModels(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), languages);
// Sentinel = 'languages'
((&(writer__)))->WriteSentinel(310903736);
IPC::WriteParam((&(writer__)), innerWindowId);
// Sentinel = 'innerWindowId'
((&(writer__)))->WriteSentinel(627967298);
if (mozilla::ipc::LoggingEnabledFor("PSpeechRecognition", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechRecognitionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSpeechRecognition::Msg_InstallModels", OTHER);
IPC::Message::seqno_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PSpeechRecognition::Reply_InstallModels__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__success = IPC::ReadParam<bool>(aReader);
if (!maybe__success) {
(aReader)->FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& success = *maybe__success;
// Sentinel = 'success'
if ((!((aReader)->ReadSentinel(200082170)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(success));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PSpeechRecognitionChild::SendInstallModels(
mozilla::Span<nsCString const> languages,
const uint64_t& innerWindowId) -> RefPtr<InstallModelsPromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendInstallModels(std::forward<mozilla::Span<nsCString const>>(languages), std::forward<const uint64_t&>(innerWindowId), [promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PSpeechRecognitionChild::SendInit(
const nsACString& engineId,
const nsACString& language,
mozilla::Span<nsString const> phrases,
mozilla::ipc::ResolveCallback<nsCString>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PSpeechRecognition::Msg_Init(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), engineId);
// Sentinel = 'engineId'
((&(writer__)))->WriteSentinel(243663652);
IPC::WriteParam((&(writer__)), language);
// Sentinel = 'language'
((&(writer__)))->WriteSentinel(248513349);
IPC::WriteParam((&(writer__)), phrases);
// Sentinel = 'phrases'
((&(writer__)))->WriteSentinel(198902519);
if (mozilla::ipc::LoggingEnabledFor("PSpeechRecognition", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechRecognitionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSpeechRecognition::Msg_Init", OTHER);
IPC::Message::seqno_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PSpeechRecognition::Reply_Init__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__error = IPC::ReadParam<nsCString>(aReader);
if (!maybe__error) {
(aReader)->FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& error = *maybe__error;
// Sentinel = 'error'
if ((!((aReader)->ReadSentinel(107741739)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(error));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PSpeechRecognitionChild::SendInit(
const nsACString& engineId,
const nsACString& language,
mozilla::Span<nsString const> phrases) -> RefPtr<InitPromise>
{
RefPtr<MozPromise<nsCString, ResponseRejectReason, true>::Private> promise__ = new MozPromise<nsCString, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendInit(std::forward<const nsACString&>(engineId), std::forward<const nsACString&>(language), std::forward<mozilla::Span<nsString const>>(phrases), [promise__](nsCString&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PSpeechRecognitionChild::SendProcessAudioData(
mozilla::Span<float const> audioData,
const TimeStamp& captureEndTime) -> bool
{
UniquePtr<IPC::Message> msg__ = PSpeechRecognition::Msg_ProcessAudioData(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), audioData);
// Sentinel = 'audioData'
((&(writer__)))->WriteSentinel(301138829);
IPC::WriteParam((&(writer__)), captureEndTime);
// Sentinel = 'captureEndTime'
((&(writer__)))->WriteSentinel(714212763);
if (mozilla::ipc::LoggingEnabledFor("PSpeechRecognition", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechRecognitionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSpeechRecognition::Msg_ProcessAudioData", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PSpeechRecognitionChild::SendStop(
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PSpeechRecognition::Msg_Stop(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PSpeechRecognition", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechRecognitionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSpeechRecognition::Msg_Stop", OTHER);
IPC::Message::seqno_t seqno__ = 0;
if (ChannelSend(std::move(msg__), (&(seqno__)))) {
mAsyncCallbacks.AddCallback(seqno__, PSpeechRecognition::Reply_Stop__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
auto maybe__anyFinalResult = IPC::ReadParam<bool>(aReader);
if (!maybe__anyFinalResult) {
(aReader)->FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& anyFinalResult = *maybe__anyFinalResult;
// Sentinel = 'anyFinalResult'
if ((!((aReader)->ReadSentinel(703595954)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
aReader->EndRead();
resolve(std::move(anyFinalResult));
return MsgProcessed;
}, std::move(aReject));
}
else {
aReject(::mozilla::ipc::ResponseRejectReason::SendError);
}
return;
}
auto PSpeechRecognitionChild::SendStop() -> RefPtr<StopPromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendStop([promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PSpeechRecognitionChild::DeallocManagee(
mozilla::ipc::ProtocolId aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PSpeechRecognitionChild::OnMessageReceived(const Message& msg__) -> PSpeechRecognitionChild::Result
{
if (!CanSend()) {
if (mozilla::ipc::LoggingEnabledFor("PSpeechRecognition", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechRecognitionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Ignored message for dead actor",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eSending);
}
return MsgProcessed;
}
switch (msg__.type()) {
case PSpeechRecognition::Reply_IsModelAvailable__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSpeechRecognition", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechRecognitionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSpeechRecognition::Msg_IsModelAvailable", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PSpeechRecognition::Reply_IsModelInstalled__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSpeechRecognition", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechRecognitionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSpeechRecognition::Msg_IsModelInstalled", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PSpeechRecognition::Reply_InstallModels__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSpeechRecognition", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechRecognitionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSpeechRecognition::Msg_InstallModels", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PSpeechRecognition::Reply_Init__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSpeechRecognition", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechRecognitionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSpeechRecognition::Msg_Init", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PSpeechRecognition::Reply_Stop__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSpeechRecognition", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechRecognitionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSpeechRecognition::Msg_Stop", OTHER);
return mAsyncCallbacks.GotReply(this, msg__);
}
case PSpeechRecognition::Msg_OnRecognitionResult__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSpeechRecognition", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechRecognitionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSpeechRecognition::Msg_OnRecognitionResult", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__transcript = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__transcript) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& transcript = *maybe__transcript;
// Sentinel = 'transcript'
if ((!(((&(reader__)))->ReadSentinel(395707467)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto maybe__isFinal = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__isFinal) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& isFinal = *maybe__isFinal;
// Sentinel = 'isFinal'
if ((!(((&(reader__)))->ReadSentinel(185729735)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
auto maybe__confidence = IPC::ReadParam<float>((&(reader__)));
if (!maybe__confidence) {
FatalError("Error deserializing 'float'");
return MsgValueError;
}
auto& confidence = *maybe__confidence;
// Sentinel = 'confidence'
if ((!(((&(reader__)))->ReadSentinel(377226255)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'float'");
return MsgValueError;
}
auto maybe__eventTime = IPC::ReadParam<TimeStamp>((&(reader__)));
if (!maybe__eventTime) {
FatalError("Error deserializing 'TimeStamp'");
return MsgValueError;
}
auto& eventTime = *maybe__eventTime;
// Sentinel = 'eventTime'
if ((!(((&(reader__)))->ReadSentinel(313197490)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'TimeStamp'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::hwinference::SpeechRecognitionChild*>(this))->RecvOnRecognitionResult(std::move(transcript), std::move(isFinal), std::move(confidence), std::move(eventTime));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PSpeechRecognition::Msg_OnRecognitionError__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSpeechRecognition", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechRecognitionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSpeechRecognition::Msg_OnRecognitionError", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__error = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__error) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& error = *maybe__error;
// Sentinel = 'error'
if ((!(((&(reader__)))->ReadSentinel(107741739)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::hwinference::SpeechRecognitionChild*>(this))->RecvOnRecognitionError(std::move(error));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PSpeechRecognition::Msg_OnSpeechChange__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSpeechRecognition", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechRecognitionChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSpeechRecognition::Msg_OnSpeechChange", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__speechDetected = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__speechDetected) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& speechDetected = *maybe__speechDetected;
// Sentinel = 'speechDetected'
if ((!(((&(reader__)))->ReadSentinel(709559707)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
auto maybe__eventTime = IPC::ReadParam<TimeStamp>((&(reader__)));
if (!maybe__eventTime) {
FatalError("Error deserializing 'TimeStamp'");
return MsgValueError;
}
auto& eventTime = *maybe__eventTime;
// Sentinel = 'eventTime'
if ((!(((&(reader__)))->ReadSentinel(313197490)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'TimeStamp'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::hwinference::SpeechRecognitionChild*>(this))->RecvOnSpeechChange(std::move(speechDetected), std::move(eventTime));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
default:
return MsgNotKnown;
case SHMEM_CREATED_MESSAGE_TYPE:
{
if (!ShmemCreated(msg__)) {
return MsgPayloadError;
}
return MsgProcessed;
}
case SHMEM_DESTROYED_MESSAGE_TYPE:
{
if (!ShmemDestroyed(msg__)) {
return MsgPayloadError;
}
return MsgProcessed;
}
}
}
auto PSpeechRecognitionChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PSpeechRecognitionChild::Result
{
if (!CanSend()) {
return MsgDropped;
}
MOZ_ASSERT_UNREACHABLE("message protocol not supported");
return MsgNotKnown;
}
} // namespace hwinference
} // namespace mozilla