Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/_ipdltest/PTestBasicParent.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/_ipdltest/TestBasicParent.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 PTestBasicParent::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PTestBasicParent::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PTestBasicParent::PTestBasicParent() :
mozilla::ipc::IToplevelProtocol("PTestBasicParent", kProtocolId, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PTestBasicParent);
}
PTestBasicParent::~PTestBasicParent()
{
MOZ_COUNT_DTOR(PTestBasicParent);
}
auto PTestBasicParent::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsParentProcess(), "Invalid process for `PTestBasicParent'");
AddRef();
}
auto PTestBasicParent::ActorDealloc() -> void
{
Release();
}
auto PTestBasicParent::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PTestBasicParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PTestBasicParent::SendHello() -> bool
{
UniquePtr<IPC::Message> msg__ = PTestBasic::Msg_Hello(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PTestBasic", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PTestBasicParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PTestBasic::Msg_Hello", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PTestBasicParent::DeallocManagee(
mozilla::ipc::ProtocolId aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PTestBasicParent::OnMessageReceived(const Message& msg__) -> PTestBasicParent::Result
{
switch (msg__.type()) {
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 PTestBasicParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PTestBasicParent::Result
{
MOZ_ASSERT_UNREACHABLE("message protocol not supported");
return MsgNotKnown;
}
} // namespace _ipdltest
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::_ipdltest::PTestBasicParent*>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, static_cast<mozilla::ipc::IProtocol*>(aVar));
// Sentinel = 'PTestBasic'
(aWriter)->WriteSentinel(343868371);
}
auto ParamTraits<::mozilla::_ipdltest::PTestBasicParent*>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe__actor = IPC::ReadParam<mozilla::ipc::IProtocol*>(aReader);
if (!maybe__actor) {
aReader->FatalError("Error deserializing managed PTestBasic actor");
return {};
}
auto& actor = *maybe__actor;
// Sentinel = 'PTestBasic'
if ((!((aReader)->ReadSentinel(343868371)))) {
mozilla::ipc::SentinelReadError("Error deserializing managed PTestBasic actor");
return {};
}
if (actor && actor->GetProtocolId() != PTestBasicMsgStart) {
aReader->FatalError("Unexpected actor type (expected PTestBasic)");
return {};
}
return static_cast<::mozilla::_ipdltest::PTestBasicParent*>(actor);
}
} // namespace IPC