Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/PSpeechSynthesisParent.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/dom/SpeechSynthesisParent.h"
#include "mozilla/dom/PContentParent.h"
#include "mozilla/dom/PSpeechSynthesisRequestParent.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 {
auto PSpeechSynthesisParent::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
auto PSpeechSynthesisParent::RecvPSpeechSynthesisRequestConstructor(
PSpeechSynthesisRequestParent* actor,
const nsAString& aText,
const nsAString& aUri,
const nsAString& aLang,
const float& aVolume,
const float& aRate,
const float& aPitch,
const bool& aShouldResistFingerprinting) -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
MOZ_IMPLICIT PSpeechSynthesisParent::PSpeechSynthesisParent() :
mozilla::ipc::IRefCountedProtocol(kProtocolId, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PSpeechSynthesisParent);
}
PSpeechSynthesisParent::~PSpeechSynthesisParent()
{
MOZ_COUNT_DTOR(PSpeechSynthesisParent);
}
auto PSpeechSynthesisParent::ActorAlloc() -> void
{
AddRef();
}
auto PSpeechSynthesisParent::ActorDealloc() -> void
{
Release();
}
auto PSpeechSynthesisParent::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PSpeechSynthesisParent::OtherChildID() const -> ::GeckoChildID
{
::GeckoChildID childID =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid();
MOZ_RELEASE_ASSERT(childID != -1);
return childID;
}
auto PSpeechSynthesisParent::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo
{
return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()};
}
auto PSpeechSynthesisParent::Manager() const -> PContentParent*
{
return static_cast<PContentParent*>(IProtocol::Manager());
}
auto PSpeechSynthesisParent::ManagedPSpeechSynthesisRequestParent(nsTArray<PSpeechSynthesisRequestParent*>& aArr) const -> void
{
mManagedPSpeechSynthesisRequestParent.ToArray(aArr);
}
auto PSpeechSynthesisParent::ManagedPSpeechSynthesisRequestParent() const -> const ManagedContainer<PSpeechSynthesisRequestParent>&
{
return mManagedPSpeechSynthesisRequestParent;
}
auto PSpeechSynthesisParent::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
static constexpr ::mozilla::ipc::ProtocolId sIds[] = {
PSpeechSynthesisRequestMsgStart
};
return sIds;
}
auto PSpeechSynthesisParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
case PSpeechSynthesisRequestMsgStart:
return (&(mManagedPSpeechSynthesisRequestParent));
default:
return nullptr;
}
}
auto PSpeechSynthesisParent::OpenPSpeechSynthesisRequestEndpoint(PSpeechSynthesisRequestParent* aActor) -> ManagedEndpoint<PSpeechSynthesisRequestChild>
{
if (!aActor) {
NS_WARNING("Cannot bind null PSpeechSynthesisRequestParent actor");
return ManagedEndpoint<PSpeechSynthesisRequestChild>();
}
if (!aActor->SetManagerAndRegister(this)) {
NS_WARNING("Failed to bind PSpeechSynthesisRequestParent actor");
return ManagedEndpoint<PSpeechSynthesisRequestChild>();
}
// 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<PSpeechSynthesisRequestChild>(mozilla::ipc::PrivateIPDLInterface(), aActor);
}
auto PSpeechSynthesisParent::BindPSpeechSynthesisRequestEndpoint(
ManagedEndpoint<PSpeechSynthesisRequestParent> aEndpoint,
PSpeechSynthesisRequestParent* aActor) -> bool
{
return aEndpoint.Bind(mozilla::ipc::PrivateIPDLInterface(), aActor, this);
}
auto PSpeechSynthesisParent::SendVoiceAdded(const RemoteVoice& aVoice) -> bool
{
UniquePtr<IPC::Message> msg__ = PSpeechSynthesis::Msg_VoiceAdded(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aVoice);
// Sentinel = 'aVoice'
((&(writer__)))->WriteSentinel(136053336);
if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechSynthesisParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_VoiceAdded", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PSpeechSynthesisParent::SendVoiceRemoved(const nsAString& aUri) -> bool
{
UniquePtr<IPC::Message> msg__ = PSpeechSynthesis::Msg_VoiceRemoved(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aUri);
// Sentinel = 'aUri'
((&(writer__)))->WriteSentinel(64225682);
if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechSynthesisParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_VoiceRemoved", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PSpeechSynthesisParent::SendSetDefaultVoice(
const nsAString& aUri,
const bool& aIsDefault) -> bool
{
UniquePtr<IPC::Message> msg__ = PSpeechSynthesis::Msg_SetDefaultVoice(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aUri);
// Sentinel = 'aUri'
((&(writer__)))->WriteSentinel(64225682);
IPC::WriteParam((&(writer__)), aIsDefault);
// Sentinel = 'aIsDefault'
((&(writer__)))->WriteSentinel(342098915);
if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechSynthesisParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_SetDefaultVoice", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PSpeechSynthesisParent::SendIsSpeakingChanged(const bool& aIsSpeaking) -> bool
{
UniquePtr<IPC::Message> msg__ = PSpeechSynthesis::Msg_IsSpeakingChanged(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aIsSpeaking);
// Sentinel = 'aIsSpeaking'
((&(writer__)))->WriteSentinel(422577232);
if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechSynthesisParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_IsSpeakingChanged", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PSpeechSynthesisParent::SendNotifyVoicesChanged() -> bool
{
UniquePtr<IPC::Message> msg__ = PSpeechSynthesis::Msg_NotifyVoicesChanged(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechSynthesisParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_NotifyVoicesChanged", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PSpeechSynthesisParent::SendNotifyVoicesError(const nsAString& aError) -> bool
{
UniquePtr<IPC::Message> msg__ = PSpeechSynthesis::Msg_NotifyVoicesError(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aError);
// Sentinel = 'aError'
((&(writer__)))->WriteSentinel(135463532);
if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechSynthesisParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_NotifyVoicesError", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PSpeechSynthesisParent::SendInitialVoicesAndState(
mozilla::Span<RemoteVoice const> aVoices,
mozilla::Span<nsString const> aDefaults,
const bool& aIsSpeaking) -> bool
{
UniquePtr<IPC::Message> msg__ = PSpeechSynthesis::Msg_InitialVoicesAndState(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aVoices);
// Sentinel = 'aVoices'
((&(writer__)))->WriteSentinel(182911691);
IPC::WriteParam((&(writer__)), aDefaults);
// Sentinel = 'aDefaults'
((&(writer__)))->WriteSentinel(286327706);
IPC::WriteParam((&(writer__)), aIsSpeaking);
// Sentinel = 'aIsSpeaking'
((&(writer__)))->WriteSentinel(422577232);
if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechSynthesisParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_InitialVoicesAndState", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PSpeechSynthesisParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
switch (aProtocolId) {
case PSpeechSynthesisRequestMsgStart:
static_cast<SpeechSynthesisParent*>(this)->DeallocPSpeechSynthesisRequestParent(static_cast<PSpeechSynthesisRequestParent*>(aListener));
return;
default:
FatalError("unreached");
return;
}
}
auto PSpeechSynthesisParent::OnMessageReceived(const Message& msg__) -> PSpeechSynthesisParent::Result
{
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___delete____ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechSynthesisParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg___delete__", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<SpeechSynthesisParent*>(this))->Recv__delete__();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
this->ActorDisconnected(Deletion);
return MsgProcessed;
}
case PSpeechSynthesis::Msg_PSpeechSynthesisRequestConstructor__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSpeechSynthesis", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSpeechSynthesisParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSpeechSynthesis::Msg_PSpeechSynthesisRequestConstructor", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__handle__ = IPC::ReadParam<ActorHandle>((&(reader__)));
if (!maybe__handle__) {
FatalError("Error deserializing 'ActorHandle'");
return MsgValueError;
}
auto& handle__ = *maybe__handle__;
// Sentinel = 'actor'
if ((!(((&(reader__)))->ReadSentinel(102892058)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'");
return MsgValueError;
}
auto maybe__aText = IPC::ReadParam<nsString>((&(reader__)));
if (!maybe__aText) {
FatalError("Error deserializing 'nsString'");
return MsgValueError;
}
auto& aText = *maybe__aText;
// Sentinel = 'aText'
if ((!(((&(reader__)))->ReadSentinel(97321479)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
return MsgValueError;
}
auto maybe__aUri = IPC::ReadParam<nsString>((&(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__aLang = IPC::ReadParam<nsString>((&(reader__)));
if (!maybe__aLang) {
FatalError("Error deserializing 'nsString'");
return MsgValueError;
}
auto& aLang = *maybe__aLang;
// Sentinel = 'aLang'
if ((!(((&(reader__)))->ReadSentinel(92275172)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
return MsgValueError;
}
auto maybe__aVolume = IPC::ReadParam<float>((&(reader__)));
if (!maybe__aVolume) {
FatalError("Error deserializing 'float'");
return MsgValueError;
}
auto& aVolume = *maybe__aVolume;
// Sentinel = 'aVolume'
if ((!(((&(reader__)))->ReadSentinel(187368154)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'float'");
return MsgValueError;
}
auto maybe__aRate = IPC::ReadParam<float>((&(reader__)));
if (!maybe__aRate) {
FatalError("Error deserializing 'float'");
return MsgValueError;
}
auto& aRate = *maybe__aRate;
// Sentinel = 'aRate'
if ((!(((&(reader__)))->ReadSentinel(94503406)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'float'");
return MsgValueError;
}
auto maybe__aPitch = IPC::ReadParam<float>((&(reader__)));
if (!maybe__aPitch) {
FatalError("Error deserializing 'float'");
return MsgValueError;
}
auto& aPitch = *maybe__aPitch;
// Sentinel = 'aPitch'
if ((!(((&(reader__)))->ReadSentinel(134873690)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'float'");
return MsgValueError;
}
auto maybe__aShouldResistFingerprinting = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__aShouldResistFingerprinting) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& aShouldResistFingerprinting = *maybe__aShouldResistFingerprinting;
// Sentinel = 'aShouldResistFingerprinting'
if ((!(((&(reader__)))->ReadSentinel(2558462737)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
PSpeechSynthesisRequestParent* actor = (static_cast<SpeechSynthesisParent*>(this))->AllocPSpeechSynthesisRequestParent(aText, aUri, aLang, aVolume, aRate, aPitch, aShouldResistFingerprinting);
if (!actor) {
NS_WARNING("Cannot bind null PSpeechSynthesisRequestParent actor");
return MsgValueError;
}
if (!actor->SetManagerAndRegister(this, (handle__).mId)) {
NS_WARNING("Failed to bind PSpeechSynthesisRequestParent actor");
return MsgValueError;
}
mozilla::ipc::IPCResult __ok = (static_cast<SpeechSynthesisParent*>(this))->RecvPSpeechSynthesisRequestConstructor(std::move(actor), std::move(aText), std::move(aUri), std::move(aLang), std::move(aVolume), std::move(aRate), std::move(aPitch), std::move(aShouldResistFingerprinting));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PSpeechSynthesisParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PSpeechSynthesisParent::Result
{
return MsgNotKnown;
}
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::PSpeechSynthesisParent*>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
MOZ_RELEASE_ASSERT(
aWriter->GetActor(),
"Cannot serialize managed actors without an actor");
int32_t id;
if (!aVar) {
id = 0; // kNullActorId
} else {
id = aVar->Id();
if (id == 1) { // kFreedActorId
aVar->FatalError("Actor has been |delete|d");
}
MOZ_RELEASE_ASSERT(
aWriter->GetActor()->GetIPCChannel() == aVar->GetIPCChannel(),
"Actor must be from the same channel as the"
" actor it's being sent over");
MOZ_RELEASE_ASSERT(
aVar->CanSend(),
"Actor must still be open when sending");
}
IPC::WriteParam(aWriter, id);
}
auto ParamTraits<::mozilla::dom::PSpeechSynthesisParent*>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
MOZ_RELEASE_ASSERT(
aReader->GetActor(),
"Cannot deserialize managed actors without an actor");
mozilla::Maybe<mozilla::ipc::IProtocol*> actor = aReader->GetActor()
->ReadActor(aReader, true, "PSpeechSynthesis", PSpeechSynthesisMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::dom::PSpeechSynthesisParent*>(actor.ref());
}
return {};
}
} // namespace IPC