Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/_ipdltest/PTestUniquePtrIPCChild.h"
#include "mozilla/ProfilerLabels.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 PTestUniquePtrIPCChild::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PTestUniquePtrIPCChild::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PTestUniquePtrIPCChild::PTestUniquePtrIPCChild() :
mozilla::ipc::IToplevelProtocol("PTestUniquePtrIPCChild", kProtocolId, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PTestUniquePtrIPCChild);
}
PTestUniquePtrIPCChild::~PTestUniquePtrIPCChild()
{
MOZ_COUNT_DTOR(PTestUniquePtrIPCChild);
}
auto PTestUniquePtrIPCChild::ActorAlloc() -> void
{
AddRef();
}
auto PTestUniquePtrIPCChild::ActorDealloc() -> void
{
Release();
}
auto PTestUniquePtrIPCChild::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PTestUniquePtrIPCChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PTestUniquePtrIPCChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PTestUniquePtrIPCChild::OnMessageReceived(const Message& msg__) -> PTestUniquePtrIPCChild::Result
{
switch (msg__.type()) {
case PTestUniquePtrIPC::Msg_TestMessage__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PTestUniquePtrIPC", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PTestUniquePtrIPCChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PTestUniquePtrIPC::Msg_TestMessage", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__a1 = IPC::ReadParam<UniquePtr<string>>((&(reader__)));
if (!maybe__a1) {
FatalError("Error deserializing 'UniquePtr<string>'");
return MsgValueError;
}
auto& a1 = *maybe__a1;
// Sentinel = 'a1'
if ((!(((&(reader__)))->ReadSentinel(16056467)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'UniquePtr<string>'");
return MsgValueError;
}
auto maybe__a2 = IPC::ReadParam<UniquePtr<DummyStruct>>((&(reader__)));
if (!maybe__a2) {
FatalError("Error deserializing 'UniquePtr<DummyStruct>'");
return MsgValueError;
}
auto& a2 = *maybe__a2;
// Sentinel = 'a2'
if ((!(((&(reader__)))->ReadSentinel(16122004)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'UniquePtr<DummyStruct>'");
return MsgValueError;
}
auto maybe__a3 = IPC::ReadParam<DummyStruct>((&(reader__)));
if (!maybe__a3) {
FatalError("Error deserializing 'DummyStruct'");
return MsgValueError;
}
auto& a3 = *maybe__a3;
// Sentinel = 'a3'
if ((!(((&(reader__)))->ReadSentinel(16187541)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'DummyStruct'");
return MsgValueError;
}
auto maybe__a4 = IPC::ReadParam<UniquePtr<string>>((&(reader__)));
if (!maybe__a4) {
FatalError("Error deserializing 'UniquePtr<string>'");
return MsgValueError;
}
auto& a4 = *maybe__a4;
// Sentinel = 'a4'
if ((!(((&(reader__)))->ReadSentinel(16253078)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'UniquePtr<string>'");
return MsgValueError;
}
auto maybe__a5 = IPC::ReadParam<DummyUnion>((&(reader__)));
if (!maybe__a5) {
FatalError("Error deserializing 'DummyUnion'");
return MsgValueError;
}
auto& a5 = *maybe__a5;
// Sentinel = 'a5'
if ((!(((&(reader__)))->ReadSentinel(16318615)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'DummyUnion'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (this)->RecvTestMessage(std::move(a1), std::move(a2), std::move(a3), std::move(a4), std::move(a5));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PTestUniquePtrIPC::Msg_TestSendReference__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PTestUniquePtrIPC", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PTestUniquePtrIPCChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PTestUniquePtrIPC::Msg_TestSendReference", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__a = IPC::ReadParam<UniquePtr<DummyStruct>>((&(reader__)));
if (!maybe__a) {
FatalError("Error deserializing 'UniquePtr<DummyStruct>'");
return MsgValueError;
}
auto& a = *maybe__a;
// Sentinel = 'a'
if ((!(((&(reader__)))->ReadSentinel(6422626)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'UniquePtr<DummyStruct>'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (this)->RecvTestSendReference(std::move(a));
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 PTestUniquePtrIPCChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PTestUniquePtrIPCChild::Result
{
MOZ_ASSERT_UNREACHABLE("message protocol not supported");
return MsgNotKnown;
}
} // namespace _ipdltest
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::_ipdltest::PTestUniquePtrIPCChild*>::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::_ipdltest::PTestUniquePtrIPCChild*>::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, "PTestUniquePtrIPC", PTestUniquePtrIPCMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::_ipdltest::PTestUniquePtrIPCChild*>(actor.ref());
}
return {};
}
} // namespace IPC