Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/_ipdltest/PTestMostNestedChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/ProfilerMarkers.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 PTestMostNestedChild::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PTestMostNestedChild::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PTestMostNestedChild::PTestMostNestedChild() :
mozilla::ipc::IToplevelProtocol("PTestMostNestedChild", kProtocolId, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PTestMostNestedChild);
}
PTestMostNestedChild::~PTestMostNestedChild()
{
MOZ_COUNT_DTOR(PTestMostNestedChild);
}
auto PTestMostNestedChild::ActorAlloc() -> void
{
AddRef();
}
auto PTestMostNestedChild::ActorDealloc() -> void
{
Release();
}
auto PTestMostNestedChild::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PTestMostNestedChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PTestMostNestedChild::SendMsg1() -> bool
{
UniquePtr<IPC::Message> msg__ = PTestMostNested::Msg_Msg1(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PTestMostNested", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PTestMostNestedChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PTestMostNested::Msg_Msg1", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PTestMostNestedChild::SendMsg2() -> bool
{
UniquePtr<IPC::Message> msg__ = PTestMostNested::Msg_Msg2(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
UniquePtr<Message> reply__;
if (mozilla::ipc::LoggingEnabledFor("PTestMostNested", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PTestMostNestedChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PTestMostNested::Msg_Msg2", OTHER);
bool sendok__ = false;
{
AUTO_PROFILER_TRACING_MARKER("Sync IPC", "PTestMostNested::Msg_Msg2", IPC);
sendok__ = ChannelSend(std::move(msg__), (&(reply__)));
}
if ((!(sendok__))) {
return false;
}
if (mozilla::ipc::LoggingEnabledFor("PTestMostNested", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PTestMostNestedChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
return true;
}
auto PTestMostNestedChild::SendMsg3() -> bool
{
UniquePtr<IPC::Message> msg__ = PTestMostNested::Msg_Msg3(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PTestMostNested", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PTestMostNestedChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PTestMostNested::Msg_Msg3", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PTestMostNestedChild::SendMsg4() -> bool
{
UniquePtr<IPC::Message> msg__ = PTestMostNested::Msg_Msg4(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
UniquePtr<Message> reply__;
if (mozilla::ipc::LoggingEnabledFor("PTestMostNested", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PTestMostNestedChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PTestMostNested::Msg_Msg4", OTHER);
bool sendok__ = false;
{
AUTO_PROFILER_TRACING_MARKER("Sync IPC", "PTestMostNested::Msg_Msg4", IPC);
sendok__ = ChannelSend(std::move(msg__), (&(reply__)));
}
if ((!(sendok__))) {
return false;
}
if (mozilla::ipc::LoggingEnabledFor("PTestMostNested", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PTestMostNestedChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
return true;
}
auto PTestMostNestedChild::DeallocManagee(
mozilla::ipc::ProtocolId aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PTestMostNestedChild::OnMessageReceived(const Message& msg__) -> PTestMostNestedChild::Result
{
switch (msg__.type()) {
case PTestMostNested::Msg_Start__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PTestMostNested", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PTestMostNestedChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PTestMostNested::Msg_Start", OTHER);
mozilla::ipc::IPCResult __ok = (this)->RecvStart();
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 PTestMostNestedChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PTestMostNestedChild::Result
{
switch (msg__.type()) {
case PTestMostNested::Msg_StartInner__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PTestMostNested", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PTestMostNestedChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PTestMostNested::Msg_StartInner", OTHER);
mozilla::ipc::ActorId id__ = MSG_ROUTING_CONTROL;
mozilla::ipc::IPCResult __ok = (this)->RecvStartInner();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
reply__ = PTestMostNested::Reply_StartInner(id__);
IPC::MessageWriter writer__{
(*(reply__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PTestMostNested", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PTestMostNestedChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
} // namespace _ipdltest
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::_ipdltest::PTestMostNestedChild*>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, static_cast<mozilla::ipc::IProtocol*>(aVar));
// Sentinel = 'PTestMostNested'
(aWriter)->WriteSentinel(782763511);
}
auto ParamTraits<::mozilla::_ipdltest::PTestMostNestedChild*>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe__actor = IPC::ReadParam<mozilla::ipc::IProtocol*>(aReader);
if (!maybe__actor) {
aReader->FatalError("Error deserializing managed PTestMostNested actor");
return {};
}
auto& actor = *maybe__actor;
// Sentinel = 'PTestMostNested'
if ((!((aReader)->ReadSentinel(782763511)))) {
mozilla::ipc::SentinelReadError("Error deserializing managed PTestMostNested actor");
return {};
}
if (actor && actor->GetProtocolId() != PTestMostNestedMsgStart) {
aReader->FatalError("Unexpected actor type (expected PTestMostNested)");
return {};
}
return static_cast<::mozilla::_ipdltest::PTestMostNestedChild*>(actor);
}
} // namespace IPC