// // Automatically generated by ipdlc. // Edit at your own risk // #include "mozilla/dom/PSpeechSynthesisChild.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/dom/SpeechSynthesisChild.h" #include "mozilla/dom/PContentChild.h" #include "mozilla/dom/PSpeechSynthesisRequestChild.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 dom { MOZ_IMPLICIT PSpeechSynthesisChild::PSpeechSynthesisChild() : mozilla::ipc::IRefCountedProtocol(kProtocolId, mozilla::ipc::ChildSide) { MOZ_COUNT_CTOR(PSpeechSynthesisChild); } PSpeechSynthesisChild::~PSpeechSynthesisChild() { MOZ_COUNT_DTOR(PSpeechSynthesisChild); } auto PSpeechSynthesisChild::ActorAlloc() -> void { AddRef(); } auto PSpeechSynthesisChild::ActorDealloc() -> void { Release(); } auto PSpeechSynthesisChild::OtherPid() const -> ::base::ProcessId { ::base::ProcessId pid = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid(); MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId); return pid; } auto PSpeechSynthesisChild::OtherChildID() const -> ::GeckoChildID { ::GeckoChildID childID = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid(); MOZ_RELEASE_ASSERT(childID != -1); return childID; } auto PSpeechSynthesisChild::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo { return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()}; } auto PSpeechSynthesisChild::Manager() const -> PContentChild* { return static_cast(IProtocol::Manager()); } auto PSpeechSynthesisChild::ManagedPSpeechSynthesisRequestChild(nsTArray& aArr) const -> void { mManagedPSpeechSynthesisRequestChild.ToArray(aArr); } auto PSpeechSynthesisChild::ManagedPSpeechSynthesisRequestChild() const -> const ManagedContainer& { return mManagedPSpeechSynthesisRequestChild; } auto PSpeechSynthesisChild::ManagedProtocolIds() const -> mozilla::Span { static constexpr ::mozilla::ipc::ProtocolId sIds[] = { PSpeechSynthesisRequestMsgStart }; return sIds; } auto PSpeechSynthesisChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer* { switch (aProtocol) { case PSpeechSynthesisRequestMsgStart: return (&(mManagedPSpeechSynthesisRequestChild)); default: return nullptr; } } auto PSpeechSynthesisChild::OpenPSpeechSynthesisRequestEndpoint(PSpeechSynthesisRequestChild* aActor) -> ManagedEndpoint { if (!aActor) { NS_WARNING("Cannot bind null PSpeechSynthesisRequestChild actor"); return ManagedEndpoint(); } if (!aActor->SetManagerAndRegister(this)) { NS_WARNING("Failed to bind PSpeechSynthesisRequestChild actor"); return ManagedEndpoint(); } // Mark our actor as awaiting the other side to be bound. This will // be cleared when a `MANAGED_ENDPOINT_{DROPPED,BOUND}` message is // received. aActor->mAwaitingManagedEndpointBind = true; return ManagedEndpoint(mozilla::ipc::PrivateIPDLInterface(), aActor); } auto PSpeechSynthesisChild::BindPSpeechSynthesisRequestEndpoint( ManagedEndpoint aEndpoint, PSpeechSynthesisRequestChild* aActor) -> bool { return aEndpoint.Bind(mozilla::ipc::PrivateIPDLInterface(), aActor, this); } auto PSpeechSynthesisChild::Send__delete__(PSpeechSynthesisChild* actor) -> bool { if (!actor || !actor->CanSend()) { NS_WARNING("Attempt to __delete__ missing or closed actor"); return false; } UniquePtr msg__ = PSpeechSynthesis::Msg___delete__((actor)->Id()); IPC::MessageWriter writer__{ (*(msg__)), actor}; if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PSpeechSynthesisChild", actor->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg___delete__", OTHER); bool sendok__ = (actor)->ChannelSend(std::move(msg__)); actor->ActorDisconnected(Deletion); return sendok__; } auto PSpeechSynthesisChild::SendPSpeechSynthesisRequestConstructor( const nsAString& aText, const nsAString& aUri, const nsAString& aLang, const float& aVolume, const float& aRate, const float& aPitch, const bool& aShouldResistFingerprinting) -> PSpeechSynthesisRequestChild* { PSpeechSynthesisRequestChild* actor = (static_cast<::mozilla::dom::SpeechSynthesisChild*>(this))->AllocPSpeechSynthesisRequestChild(aText, aUri, aLang, aVolume, aRate, aPitch, aShouldResistFingerprinting); return SendPSpeechSynthesisRequestConstructor(std::forward(actor), std::forward(aText), std::forward(aUri), std::forward(aLang), std::forward(aVolume), std::forward(aRate), std::forward(aPitch), std::forward(aShouldResistFingerprinting)); } auto PSpeechSynthesisChild::SendPSpeechSynthesisRequestConstructor( PSpeechSynthesisRequestChild* actor, const nsAString& aText, const nsAString& aUri, const nsAString& aLang, const float& aVolume, const float& aRate, const float& aPitch, const bool& aShouldResistFingerprinting) -> PSpeechSynthesisRequestChild* { if (!actor) { NS_WARNING("Cannot bind null PSpeechSynthesisRequestChild actor"); return nullptr; } if (!actor->SetManagerAndRegister(this)) { NS_WARNING("Failed to bind PSpeechSynthesisRequestChild actor"); return nullptr; } // Build our constructor message. UniquePtr msg__ = PSpeechSynthesis::Msg_PSpeechSynthesisRequestConstructor(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), (actor)->Id()); // Sentinel = 'actorid' ((&(writer__)))->WriteSentinel(193725159); IPC::WriteParam((&(writer__)), aText); // Sentinel = 'aText' ((&(writer__)))->WriteSentinel(97321479); IPC::WriteParam((&(writer__)), aUri); // Sentinel = 'aUri' ((&(writer__)))->WriteSentinel(64225682); IPC::WriteParam((&(writer__)), aLang); // Sentinel = 'aLang' ((&(writer__)))->WriteSentinel(92275172); IPC::WriteParam((&(writer__)), aVolume); // Sentinel = 'aVolume' ((&(writer__)))->WriteSentinel(187368154); IPC::WriteParam((&(writer__)), aRate); // Sentinel = 'aRate' ((&(writer__)))->WriteSentinel(94503406); IPC::WriteParam((&(writer__)), aPitch); // Sentinel = 'aPitch' ((&(writer__)))->WriteSentinel(134873690); IPC::WriteParam((&(writer__)), aShouldResistFingerprinting); // Sentinel = 'aShouldResistFingerprinting' ((&(writer__)))->WriteSentinel(2558462737); // Notify the other side about the newly created actor. This can // fail if our manager has already been destroyed. // // NOTE: If the send call fails due to toplevel channel teardown, // the `IProtocol::ChannelSend` wrapper absorbs the error for us, // so we don't tear down actors unexpectedly. if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PSpeechSynthesisChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_PSpeechSynthesisRequestConstructor", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); // Warn, destroy the actor, and return null if the message failed to // send. Otherwise, return the successfully created actor reference. if (!sendok__) { NS_WARNING("Error sending PSpeechSynthesisRequestChild constructor"); actor->ActorDisconnected(FailedConstructor); return nullptr; } return actor; } auto PSpeechSynthesisChild::DeallocManagee( mozilla::ipc::ProtocolId aProtocolId, IProtocol* aListener) -> void { switch (aProtocolId) { case PSpeechSynthesisRequestMsgStart: static_cast<::mozilla::dom::SpeechSynthesisChild*>(this)->DeallocPSpeechSynthesisRequestChild(static_cast(aListener)); return; default: FatalError("unreached"); return; } } auto PSpeechSynthesisChild::OnMessageReceived(const Message& msg__) -> PSpeechSynthesisChild::Result { if (!CanSend()) { if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PSpeechSynthesisChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Ignored message for dead actor", (&(msg__))->type(), mozilla::ipc::MessageDirection::eSending); } return MsgProcessed; } switch (msg__.type()) { case MANAGED_ENDPOINT_BOUND_MESSAGE_TYPE: { if (!mAwaitingManagedEndpointBind) { NS_WARNING("Unexpected managed endpoint lifecycle message after actor bound!"); return MsgNotAllowed; } mAwaitingManagedEndpointBind = false; return MsgProcessed; } case MANAGED_ENDPOINT_DROPPED_MESSAGE_TYPE: { if (!mAwaitingManagedEndpointBind) { NS_WARNING("Unexpected managed endpoint lifecycle message after actor bound!"); return MsgNotAllowed; } mAwaitingManagedEndpointBind = false; this->ActorDisconnected(ManagedEndpointDropped); return MsgProcessed; } case PSpeechSynthesis::Msg_VoiceAdded__ID: { if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PSpeechSynthesisChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_VoiceAdded", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aVoice = IPC::ReadParam((&(reader__))); if (!maybe__aVoice) { FatalError("Error deserializing 'RemoteVoice'"); return MsgValueError; } auto& aVoice = *maybe__aVoice; // Sentinel = 'aVoice' if ((!(((&(reader__)))->ReadSentinel(136053336)))) { mozilla::ipc::SentinelReadError("Error deserializing 'RemoteVoice'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SpeechSynthesisChild*>(this))->RecvVoiceAdded(std::move(aVoice)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSpeechSynthesis::Msg_VoiceRemoved__ID: { if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PSpeechSynthesisChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_VoiceRemoved", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aUri = IPC::ReadParam((&(reader__))); if (!maybe__aUri) { FatalError("Error deserializing 'nsString'"); return MsgValueError; } auto& aUri = *maybe__aUri; // Sentinel = 'aUri' if ((!(((&(reader__)))->ReadSentinel(64225682)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SpeechSynthesisChild*>(this))->RecvVoiceRemoved(std::move(aUri)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSpeechSynthesis::Msg_SetDefaultVoice__ID: { if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PSpeechSynthesisChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_SetDefaultVoice", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aUri = IPC::ReadParam((&(reader__))); if (!maybe__aUri) { FatalError("Error deserializing 'nsString'"); return MsgValueError; } auto& aUri = *maybe__aUri; // Sentinel = 'aUri' if ((!(((&(reader__)))->ReadSentinel(64225682)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); return MsgValueError; } auto maybe__aIsDefault = IPC::ReadParam((&(reader__))); if (!maybe__aIsDefault) { FatalError("Error deserializing 'bool'"); return MsgValueError; } auto& aIsDefault = *maybe__aIsDefault; // Sentinel = 'aIsDefault' if ((!(((&(reader__)))->ReadSentinel(342098915)))) { mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SpeechSynthesisChild*>(this))->RecvSetDefaultVoice(std::move(aUri), std::move(aIsDefault)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSpeechSynthesis::Msg_IsSpeakingChanged__ID: { if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PSpeechSynthesisChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_IsSpeakingChanged", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aIsSpeaking = IPC::ReadParam((&(reader__))); if (!maybe__aIsSpeaking) { FatalError("Error deserializing 'bool'"); return MsgValueError; } auto& aIsSpeaking = *maybe__aIsSpeaking; // Sentinel = 'aIsSpeaking' if ((!(((&(reader__)))->ReadSentinel(422577232)))) { mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SpeechSynthesisChild*>(this))->RecvIsSpeakingChanged(std::move(aIsSpeaking)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSpeechSynthesis::Msg_NotifyVoicesChanged__ID: { if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PSpeechSynthesisChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_NotifyVoicesChanged", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SpeechSynthesisChild*>(this))->RecvNotifyVoicesChanged(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSpeechSynthesis::Msg_NotifyVoicesError__ID: { if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PSpeechSynthesisChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_NotifyVoicesError", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aError = IPC::ReadParam((&(reader__))); if (!maybe__aError) { FatalError("Error deserializing 'nsString'"); return MsgValueError; } auto& aError = *maybe__aError; // Sentinel = 'aError' if ((!(((&(reader__)))->ReadSentinel(135463532)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SpeechSynthesisChild*>(this))->RecvNotifyVoicesError(std::move(aError)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSpeechSynthesis::Msg_InitialVoicesAndState__ID: { if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PSpeechSynthesisChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_InitialVoicesAndState", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aVoices = IPC::ReadParam>((&(reader__))); if (!maybe__aVoices) { FatalError("Error deserializing 'RemoteVoice[]'"); return MsgValueError; } auto& aVoices = *maybe__aVoices; // Sentinel = 'aVoices' if ((!(((&(reader__)))->ReadSentinel(182911691)))) { mozilla::ipc::SentinelReadError("Error deserializing 'RemoteVoice[]'"); return MsgValueError; } auto maybe__aDefaults = IPC::ReadParam>((&(reader__))); if (!maybe__aDefaults) { FatalError("Error deserializing 'nsString[]'"); return MsgValueError; } auto& aDefaults = *maybe__aDefaults; // Sentinel = 'aDefaults' if ((!(((&(reader__)))->ReadSentinel(286327706)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsString[]'"); return MsgValueError; } auto maybe__aIsSpeaking = IPC::ReadParam((&(reader__))); if (!maybe__aIsSpeaking) { FatalError("Error deserializing 'bool'"); return MsgValueError; } auto& aIsSpeaking = *maybe__aIsSpeaking; // Sentinel = 'aIsSpeaking' if ((!(((&(reader__)))->ReadSentinel(422577232)))) { mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SpeechSynthesisChild*>(this))->RecvInitialVoicesAndState(std::move(aVoices), std::move(aDefaults), std::move(aIsSpeaking)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSpeechSynthesis::Reply___delete____ID: { return MsgProcessed; } case PSpeechSynthesis::Reply_PSpeechSynthesisRequestConstructor__ID: { return MsgProcessed; } default: return MsgNotKnown; } } auto PSpeechSynthesisChild::OnMessageReceived( const Message& msg__, UniquePtr& reply__) -> PSpeechSynthesisChild::Result { if (!CanSend()) { return MsgDropped; } return MsgNotKnown; } } // namespace dom } // namespace mozilla