Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/_ipdltest/PTestDescendantSubChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/_ipdltest/PTestDescendantChild.h"
#include "mozilla/_ipdltest/PTestDescendantSubsubChild.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 _ipdltest {
auto PTestDescendantSubChild::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
auto PTestDescendantSubChild::RecvPTestDescendantSubsubConstructor(PTestDescendantSubsubChild* actor) -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
MOZ_IMPLICIT PTestDescendantSubChild::PTestDescendantSubChild() :
mozilla::ipc::IRefCountedProtocol(kProtocolId, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PTestDescendantSubChild);
}
PTestDescendantSubChild::~PTestDescendantSubChild()
{
MOZ_COUNT_DTOR(PTestDescendantSubChild);
}
auto PTestDescendantSubChild::ActorAlloc() -> void
{
AddRef();
}
auto PTestDescendantSubChild::ActorDealloc() -> void
{
Release();
}
auto PTestDescendantSubChild::Manager() const -> PTestDescendantChild*
{
return static_cast<PTestDescendantChild*>(IProtocol::Manager());
}
auto PTestDescendantSubChild::ManagedPTestDescendantSubsubChild(nsTArray<PTestDescendantSubsubChild*>& aArr) const -> void
{
mManagedPTestDescendantSubsubChild.ToArray(aArr);
}
auto PTestDescendantSubChild::ManagedPTestDescendantSubsubChild() const -> const ManagedContainer<PTestDescendantSubsubChild>&
{
return mManagedPTestDescendantSubsubChild;
}
auto PTestDescendantSubChild::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
static constexpr ::mozilla::ipc::ProtocolId sIds[] = {
PTestDescendantSubsubMsgStart
};
return sIds;
}
auto PTestDescendantSubChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
case PTestDescendantSubsubMsgStart:
return (&(mManagedPTestDescendantSubsubChild));
default:
return nullptr;
}
}
auto PTestDescendantSubChild::OpenPTestDescendantSubsubEndpoint(PTestDescendantSubsubChild* aActor) -> ManagedEndpoint<PTestDescendantSubsubParent>
{
if (!aActor) {
NS_WARNING("Cannot bind null PTestDescendantSubsubChild actor");
return ManagedEndpoint<PTestDescendantSubsubParent>();
}
if (!aActor->SetManagerAndRegister(this)) {
NS_WARNING("Failed to bind PTestDescendantSubsubChild actor");
return ManagedEndpoint<PTestDescendantSubsubParent>();
}
// 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<PTestDescendantSubsubParent>(mozilla::ipc::PrivateIPDLInterface(), aActor);
}
auto PTestDescendantSubChild::BindPTestDescendantSubsubEndpoint(
ManagedEndpoint<PTestDescendantSubsubChild> aEndpoint,
PTestDescendantSubsubChild* aActor) -> bool
{
return aEndpoint.Bind(mozilla::ipc::PrivateIPDLInterface(), aActor, this);
}
auto PTestDescendantSubChild::DeallocManagee(
mozilla::ipc::ProtocolId aProtocolId,
IProtocol* aListener) -> void
{
switch (aProtocolId) {
default:
FatalError("unreached");
return;
}
}
auto PTestDescendantSubChild::OnMessageReceived(const Message& msg__) -> PTestDescendantSubChild::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 PTestDescendantSub::Msg___delete____ID:
{
if (mozilla::ipc::LoggingEnabledFor("PTestDescendantSub", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PTestDescendantSubChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PTestDescendantSub::Msg___delete__", OTHER);
mozilla::ipc::IPCResult __ok = (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 PTestDescendantSub::Msg_PTestDescendantSubsubConstructor__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PTestDescendantSub", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PTestDescendantSubChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PTestDescendantSub::Msg_PTestDescendantSubsubConstructor", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__actorid__ = IPC::ReadParam<mozilla::ipc::ActorId>((&(reader__)));
if (!maybe__actorid__) {
FatalError("Error deserializing 'mozilla::ipc::ActorId'");
return MsgValueError;
}
auto& actorid__ = *maybe__actorid__;
// Sentinel = 'actorid'
if ((!(((&(reader__)))->ReadSentinel(193725159)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'mozilla::ipc::ActorId'");
return MsgValueError;
}
reader__.EndRead();
RefPtr<PTestDescendantSubsubChild> actor = (this)->AllocPTestDescendantSubsubChild();
if (!actor) {
NS_WARNING("Cannot bind null PTestDescendantSubsubChild actor");
return MsgValueError;
}
if (!actor->SetManagerAndRegister(this, actorid__)) {
NS_WARNING("Failed to bind PTestDescendantSubsubChild actor");
return MsgValueError;
}
mozilla::ipc::IPCResult __ok = (this)->RecvPTestDescendantSubsubConstructor(actor);
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PTestDescendantSubChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PTestDescendantSubChild::Result
{
MOZ_ASSERT_UNREACHABLE("message protocol not supported");
return MsgNotKnown;
}
} // namespace _ipdltest
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::_ipdltest::PTestDescendantSubChild*>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, static_cast<mozilla::ipc::IProtocol*>(aVar));
// Sentinel = 'PTestDescendantSub'
(aWriter)->WriteSentinel(1105463060);
}
auto ParamTraits<::mozilla::_ipdltest::PTestDescendantSubChild*>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe__actor = IPC::ReadParam<mozilla::ipc::IProtocol*>(aReader);
if (!maybe__actor) {
aReader->FatalError("Error deserializing managed PTestDescendantSub actor");
return {};
}
auto& actor = *maybe__actor;
// Sentinel = 'PTestDescendantSub'
if ((!((aReader)->ReadSentinel(1105463060)))) {
mozilla::ipc::SentinelReadError("Error deserializing managed PTestDescendantSub actor");
return {};
}
if (actor && actor->GetProtocolId() != PTestDescendantSubMsgStart) {
aReader->FatalError("Unexpected actor type (expected PTestDescendantSub)");
return {};
}
return static_cast<::mozilla::_ipdltest::PTestDescendantSubChild*>(actor);
}
} // namespace IPC