Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/_ipdltest/PTestUniquePtrIPC.h"
#include "mozilla/_ipdltest/PTestUniquePtrIPCParent.h"
#include "mozilla/_ipdltest/PTestUniquePtrIPCChild.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 {
namespace PTestUniquePtrIPC {
nsresult
CreateEndpoints(
base::ProcessId aParentDestPid,
base::ProcessId aChildDestPid,
mozilla::ipc::Endpoint<::mozilla::_ipdltest::PTestUniquePtrIPCParent>* aParent,
mozilla::ipc::Endpoint<::mozilla::_ipdltest::PTestUniquePtrIPCChild>* aChild)
{
return mozilla::ipc::CreateEndpoints(
mozilla::ipc::PrivateIPDLInterface(),
aParentDestPid, aChildDestPid, aParent, aChild);
}
nsresult
CreateEndpoints(
mozilla::ipc::Endpoint<::mozilla::_ipdltest::PTestUniquePtrIPCParent>* aParent,
mozilla::ipc::Endpoint<::mozilla::_ipdltest::PTestUniquePtrIPCChild>* aChild)
{
return mozilla::ipc::CreateEndpoints(
mozilla::ipc::PrivateIPDLInterface(),
aParent, aChild);
}
mozilla::UniquePtr<IPC::Message>
Msg_TestMessage(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_TestMessage__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_TestSendReference(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_TestSendReference__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
} // namespace PTestUniquePtrIPC
} // namespace _ipdltest
} // namespace mozilla
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct DummyStruct|
//
namespace mozilla {
namespace _ipdltest {
} // namespace _ipdltest
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::_ipdltest::DummyStruct>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, (aVar).x());
// Sentinel = 'x'
(aWriter)->WriteSentinel(7929977);
}
auto ParamTraits<::mozilla::_ipdltest::DummyStruct>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe___x = IPC::ReadParam<::std::string>(aReader);
if (!maybe___x) {
aReader->FatalError("Error deserializing 'x' (string) member of 'DummyStruct'");
return {};
}
auto& _x = *maybe___x;
// Sentinel = 'x'
if ((!((aReader)->ReadSentinel(7929977)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'x' (string) member of 'DummyStruct'");
return {};
}
IPC::ReadResult<paramType> result__{
std::in_place,
std::move(_x)};
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |union DummyUnion|
//
namespace mozilla {
namespace _ipdltest {
auto DummyUnion::MaybeDestroy() -> void
{
if ((mType) == (T__None)) {
return;
}
switch (mType) {
case Tstring:
{
(ptr_string())->~string__tdef();
break;
}
case Tint:
{
(ptr_int())->~int__tdef();
break;
}
default:
{
mozilla::ipc::LogicError("not reached");
break;
}
}
}
MOZ_IMPLICIT DummyUnion::DummyUnion(UniquePtr<string>&& aOther)
{
new (mozilla::KnownNotNull, ptr_string()) UniquePtr<string>(std::move(aOther));
mType = Tstring;
}
MOZ_IMPLICIT DummyUnion::DummyUnion(const int& aOther)
{
new (mozilla::KnownNotNull, ptr_int()) int(aOther);
mType = Tint;
}
MOZ_IMPLICIT DummyUnion::DummyUnion(int&& aOther)
{
new (mozilla::KnownNotNull, ptr_int()) int(std::move(aOther));
mType = Tint;
}
MOZ_IMPLICIT DummyUnion::DummyUnion(DummyUnion&& aOther)
{
(aOther).AssertSanity();
Type t = (aOther).type();
switch (t) {
case Tstring:
{
new (mozilla::KnownNotNull, ptr_string()) UniquePtr<string>(std::move((aOther).get_string()));
(aOther).MaybeDestroy();
break;
}
case Tint:
{
new (mozilla::KnownNotNull, ptr_int()) int(std::move((aOther).get_int()));
(aOther).MaybeDestroy();
break;
}
case T__None:
{
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
return;
}
}
(aOther).mType = T__None;
mType = t;
}
DummyUnion::~DummyUnion()
{
MaybeDestroy();
}
auto DummyUnion::operator=(UniquePtr<string>&& aRhs) -> DummyUnion&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_string()) UniquePtr<string>(std::move(aRhs));
mType = Tstring;
return (*(this));
}
auto DummyUnion::operator=(const int& aRhs) -> DummyUnion&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_int()) int(aRhs);
mType = Tint;
return (*(this));
}
auto DummyUnion::operator=(int&& aRhs) -> DummyUnion&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_int()) int(std::move(aRhs));
mType = Tint;
return (*(this));
}
auto DummyUnion::operator=(DummyUnion&& aRhs) -> DummyUnion&
{
(aRhs).AssertSanity();
Type t = (aRhs).type();
switch (t) {
case Tstring:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_string()) UniquePtr<string>(std::move((aRhs).get_string()));
(aRhs).MaybeDestroy();
break;
}
case Tint:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_int()) int(std::move((aRhs).get_int()));
(aRhs).MaybeDestroy();
break;
}
case T__None:
{
MaybeDestroy();
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
break;
}
}
(aRhs).mType = T__None;
mType = t;
return (*(this));
}
} // namespace _ipdltest
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::_ipdltest::DummyUnion>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
typedef ::mozilla::_ipdltest::DummyUnion union__;
int type = (aVar).type();
IPC::WriteParam(aWriter, type);
// Sentinel = 'DummyUnion'
(aWriter)->WriteSentinel(368051222);
switch (type) {
case union__::Tstring:
{
IPC::WriteParam(aWriter, (aVar).get_string());
// Sentinel = 'Tstring'
(aWriter)->WriteSentinel(193921772);
return;
}
case union__::Tint:
{
IPC::WriteParam(aWriter, (aVar).get_int());
// Sentinel = 'Tint'
(aWriter)->WriteSentinel(64946592);
return;
}
default:
{
aWriter->FatalError("unknown variant of union DummyUnion");
return;
}
}
}
auto ParamTraits<::mozilla::_ipdltest::DummyUnion>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
typedef ::mozilla::_ipdltest::DummyUnion union__;
auto maybe__type = IPC::ReadParam<int>(aReader);
if (!maybe__type) {
aReader->FatalError("Error deserializing type of union DummyUnion");
return {};
}
auto& type = *maybe__type;
// Sentinel = 'DummyUnion'
if ((!((aReader)->ReadSentinel(368051222)))) {
mozilla::ipc::SentinelReadError("Error deserializing type of union DummyUnion");
return {};
}
switch (type) {
case union__::Tstring:
{
auto maybe__tmp = IPC::ReadParam<mozilla::UniquePtr<::std::string>>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant Tstring of union DummyUnion");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'Tstring'
if ((!((aReader)->ReadSentinel(193921772)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant Tstring of union DummyUnion");
return {};
}
return std::move(tmp);
}
case union__::Tint:
{
auto maybe__tmp = IPC::ReadParam<int>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant Tint of union DummyUnion");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'Tint'
if ((!((aReader)->ReadSentinel(64946592)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant Tint of union DummyUnion");
return {};
}
return std::move(tmp);
}
default:
{
aReader->FatalError("unknown variant of union DummyUnion");
return {};
}
}
}
} // namespace IPC