Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/net/NeckoMessageUtils.h"
#include "mozilla/net/DNS.h"
#include "prio.h"
#include "mozilla/dom/network/UDPSocketParent.h"
#include "mozilla/dom/network/UDPSocketChild.h"
#include "mozilla/net/PNeckoParent.h"
#include "mozilla/net/PNeckoChild.h"
#include "mozilla/ipc/PBackgroundParent.h"
#include "mozilla/ipc/PBackgroundChild.h"
#include "mozilla/net/PUDPSocket.h"
#include "mozilla/net/PUDPSocketParent.h"
#include "mozilla/net/PUDPSocketChild.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 net {
namespace PUDPSocket {
nsresult
CreateEndpoints(
base::ProcessId aParentDestPid,
base::ProcessId aChildDestPid,
mozilla::ipc::Endpoint<::mozilla::net::PUDPSocketParent>* aParent,
mozilla::ipc::Endpoint<::mozilla::net::PUDPSocketChild>* aChild)
{
return mozilla::ipc::CreateEndpoints(
mozilla::ipc::PrivateIPDLInterface(),
aParentDestPid, aChildDestPid, aParent, aChild);
}
mozilla::UniquePtr<IPC::Message>
Msg_Bind(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_Bind__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_Connect(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_Connect__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_OutgoingData(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_OutgoingData__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_JoinMulticast(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_JoinMulticast__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_LeaveMulticast(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_LeaveMulticast__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_Close(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_Close__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_RequestDelete(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_RequestDelete__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_CallbackOpened(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_CallbackOpened__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_CallbackConnected(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_CallbackConnected__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_CallbackClosed(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_CallbackClosed__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_CallbackReceivedData(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_CallbackReceivedData__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_CallbackError(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_CallbackError__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___delete__(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg___delete____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>
Reply___delete__(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Reply___delete____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::REPLY));
}
} // namespace PUDPSocket
} // namespace net
} // namespace mozilla
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct UDPAddressInfo|
//
namespace IPC {
auto ParamTraits<::UDPAddressInfo>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, (aVar).addr());
// Sentinel = 'addr'
(aWriter)->WriteSentinel(65929628);
(aWriter)->WriteBytes((&((aVar).port())), 2);
// Sentinel = 'port'
(aWriter)->WriteSentinel(73990598);
}
auto ParamTraits<::UDPAddressInfo>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe___addr = IPC::ReadParam<::nsCString>(aReader);
if (!maybe___addr) {
aReader->FatalError("Error deserializing 'addr' (nsCString) member of 'UDPAddressInfo'");
return {};
}
auto& _addr = *maybe___addr;
// Sentinel = 'addr'
if ((!((aReader)->ReadSentinel(65929628)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'addr' (nsCString) member of 'UDPAddressInfo'");
return {};
}
IPC::ReadResult<paramType> result__{
std::in_place,
std::move(_addr),
::uint16_t{0}};
if ((!((aReader)->ReadBytesInto((&((result__)->port())), 2)))) {
aReader->FatalError("Error bulk reading fields from uint16_t");
return {};
}
// Sentinel = 'port'
if ((!((aReader)->ReadSentinel(73990598)))) {
mozilla::ipc::SentinelReadError("Error bulk reading fields from uint16_t");
return {};
}
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |union UDPSocketAddr|
//
auto UDPSocketAddr::MaybeDestroy() -> void
{
if ((mType) == (T__None)) {
return;
}
switch (mType) {
case TUDPAddressInfo:
{
(ptr_UDPAddressInfo())->~UDPAddressInfo__tdef();
break;
}
case TNetAddr:
{
(ptr_NetAddr())->~NetAddr__tdef();
break;
}
default:
{
mozilla::ipc::LogicError("not reached");
break;
}
}
}
MOZ_IMPLICIT UDPSocketAddr::UDPSocketAddr(const UDPAddressInfo& aOther)
{
new (mozilla::KnownNotNull, ptr_UDPAddressInfo()) UDPAddressInfo(aOther);
mType = TUDPAddressInfo;
}
MOZ_IMPLICIT UDPSocketAddr::UDPSocketAddr(UDPAddressInfo&& aOther)
{
new (mozilla::KnownNotNull, ptr_UDPAddressInfo()) UDPAddressInfo(std::move(aOther));
mType = TUDPAddressInfo;
}
MOZ_IMPLICIT UDPSocketAddr::UDPSocketAddr(const NetAddr& aOther)
{
new (mozilla::KnownNotNull, ptr_NetAddr()) NetAddr(aOther);
mType = TNetAddr;
}
MOZ_IMPLICIT UDPSocketAddr::UDPSocketAddr(NetAddr&& aOther)
{
new (mozilla::KnownNotNull, ptr_NetAddr()) NetAddr(std::move(aOther));
mType = TNetAddr;
}
MOZ_IMPLICIT UDPSocketAddr::UDPSocketAddr(const UDPSocketAddr& aOther)
{
(aOther).AssertSanity();
switch ((aOther).type()) {
case TUDPAddressInfo:
{
new (mozilla::KnownNotNull, ptr_UDPAddressInfo()) UDPAddressInfo((aOther).get_UDPAddressInfo());
break;
}
case TNetAddr:
{
new (mozilla::KnownNotNull, ptr_NetAddr()) NetAddr((aOther).get_NetAddr());
break;
}
case T__None:
{
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
return;
}
}
mType = (aOther).type();
}
MOZ_IMPLICIT UDPSocketAddr::UDPSocketAddr(UDPSocketAddr&& aOther)
{
(aOther).AssertSanity();
Type t = (aOther).type();
switch (t) {
case TUDPAddressInfo:
{
new (mozilla::KnownNotNull, ptr_UDPAddressInfo()) UDPAddressInfo(std::move((aOther).get_UDPAddressInfo()));
(aOther).MaybeDestroy();
break;
}
case TNetAddr:
{
new (mozilla::KnownNotNull, ptr_NetAddr()) NetAddr(std::move((aOther).get_NetAddr()));
(aOther).MaybeDestroy();
break;
}
case T__None:
{
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
return;
}
}
(aOther).mType = T__None;
mType = t;
}
UDPSocketAddr::~UDPSocketAddr()
{
MaybeDestroy();
}
auto UDPSocketAddr::operator=(const UDPAddressInfo& aRhs) -> UDPSocketAddr&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_UDPAddressInfo()) UDPAddressInfo(aRhs);
mType = TUDPAddressInfo;
return (*(this));
}
auto UDPSocketAddr::operator=(UDPAddressInfo&& aRhs) -> UDPSocketAddr&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_UDPAddressInfo()) UDPAddressInfo(std::move(aRhs));
mType = TUDPAddressInfo;
return (*(this));
}
auto UDPSocketAddr::operator=(const NetAddr& aRhs) -> UDPSocketAddr&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_NetAddr()) NetAddr(aRhs);
mType = TNetAddr;
return (*(this));
}
auto UDPSocketAddr::operator=(NetAddr&& aRhs) -> UDPSocketAddr&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_NetAddr()) NetAddr(std::move(aRhs));
mType = TNetAddr;
return (*(this));
}
auto UDPSocketAddr::operator=(const UDPSocketAddr& aRhs) -> UDPSocketAddr&
{
(aRhs).AssertSanity();
Type t = (aRhs).type();
switch (t) {
case TUDPAddressInfo:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_UDPAddressInfo()) UDPAddressInfo((aRhs).get_UDPAddressInfo());
break;
}
case TNetAddr:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_NetAddr()) NetAddr((aRhs).get_NetAddr());
break;
}
case T__None:
{
MaybeDestroy();
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
break;
}
}
mType = t;
return (*(this));
}
auto UDPSocketAddr::operator=(UDPSocketAddr&& aRhs) -> UDPSocketAddr&
{
(aRhs).AssertSanity();
Type t = (aRhs).type();
switch (t) {
case TUDPAddressInfo:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_UDPAddressInfo()) UDPAddressInfo(std::move((aRhs).get_UDPAddressInfo()));
(aRhs).MaybeDestroy();
break;
}
case TNetAddr:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_NetAddr()) NetAddr(std::move((aRhs).get_NetAddr()));
(aRhs).MaybeDestroy();
break;
}
case T__None:
{
MaybeDestroy();
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
break;
}
}
(aRhs).mType = T__None;
mType = t;
return (*(this));
}
namespace IPC {
auto ParamTraits<::UDPSocketAddr>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
typedef ::UDPSocketAddr union__;
int type = (aVar).type();
IPC::WriteParam(aWriter, type);
// Sentinel = 'UDPSocketAddr'
(aWriter)->WriteSentinel(540280014);
switch (type) {
case union__::TUDPAddressInfo:
{
IPC::WriteParam(aWriter, (aVar).get_UDPAddressInfo());
// Sentinel = 'TUDPAddressInfo'
(aWriter)->WriteSentinel(704185744);
return;
}
case union__::TNetAddr:
{
IPC::WriteParam(aWriter, (aVar).get_NetAddr());
// Sentinel = 'TNetAddr'
(aWriter)->WriteSentinel(215352055);
return;
}
default:
{
aWriter->FatalError("unknown variant of union UDPSocketAddr");
return;
}
}
}
auto ParamTraits<::UDPSocketAddr>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
typedef ::UDPSocketAddr union__;
auto maybe__type = IPC::ReadParam<int>(aReader);
if (!maybe__type) {
aReader->FatalError("Error deserializing type of union UDPSocketAddr");
return {};
}
auto& type = *maybe__type;
// Sentinel = 'UDPSocketAddr'
if ((!((aReader)->ReadSentinel(540280014)))) {
mozilla::ipc::SentinelReadError("Error deserializing type of union UDPSocketAddr");
return {};
}
switch (type) {
case union__::TUDPAddressInfo:
{
auto maybe__tmp = IPC::ReadParam<::UDPAddressInfo>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TUDPAddressInfo of union UDPSocketAddr");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TUDPAddressInfo'
if ((!((aReader)->ReadSentinel(704185744)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TUDPAddressInfo of union UDPSocketAddr");
return {};
}
return std::move(tmp);
}
case union__::TNetAddr:
{
auto maybe__tmp = IPC::ReadParam<::mozilla::net::NetAddr>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TNetAddr of union UDPSocketAddr");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TNetAddr'
if ((!((aReader)->ReadSentinel(215352055)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TNetAddr of union UDPSocketAddr");
return {};
}
return std::move(tmp);
}
default:
{
aReader->FatalError("unknown variant of union UDPSocketAddr");
return {};
}
}
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |union UDPData|
//
auto UDPData::MaybeDestroy() -> void
{
if ((mType) == (T__None)) {
return;
}
switch (mType) {
case TArrayOfuint8_t:
{
(ptr_ArrayOfuint8_t())->~ArrayOfuint8_t__tdef();
break;
}
case TIPCStream:
{
(ptr_IPCStream())->~IPCStream__tdef();
break;
}
default:
{
mozilla::ipc::LogicError("not reached");
break;
}
}
}
MOZ_IMPLICIT UDPData::UDPData(const nsTArray<uint8_t>& aOther)
{
new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>((aOther).Clone());
mType = TArrayOfuint8_t;
}
MOZ_IMPLICIT UDPData::UDPData(nsTArray<uint8_t>&& aOther)
{
new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>(std::move(aOther));
mType = TArrayOfuint8_t;
}
MOZ_IMPLICIT UDPData::UDPData(const IPCStream& aOther)
{
new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream(aOther);
mType = TIPCStream;
}
MOZ_IMPLICIT UDPData::UDPData(IPCStream&& aOther)
{
new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream(std::move(aOther));
mType = TIPCStream;
}
MOZ_IMPLICIT UDPData::UDPData(const UDPData& aOther)
{
(aOther).AssertSanity();
switch ((aOther).type()) {
case TArrayOfuint8_t:
{
new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>(((aOther).get_ArrayOfuint8_t()).Clone());
break;
}
case TIPCStream:
{
new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream((aOther).get_IPCStream());
break;
}
case T__None:
{
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
return;
}
}
mType = (aOther).type();
}
MOZ_IMPLICIT UDPData::UDPData(UDPData&& aOther)
{
(aOther).AssertSanity();
Type t = (aOther).type();
switch (t) {
case TArrayOfuint8_t:
{
new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>(std::move((aOther).get_ArrayOfuint8_t()));
(aOther).MaybeDestroy();
break;
}
case TIPCStream:
{
new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream(std::move((aOther).get_IPCStream()));
(aOther).MaybeDestroy();
break;
}
case T__None:
{
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
return;
}
}
(aOther).mType = T__None;
mType = t;
}
UDPData::~UDPData()
{
MaybeDestroy();
}
auto UDPData::operator=(const nsTArray<uint8_t>& aRhs) -> UDPData&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>((aRhs).Clone());
mType = TArrayOfuint8_t;
return (*(this));
}
auto UDPData::operator=(nsTArray<uint8_t>&& aRhs) -> UDPData&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>(std::move(aRhs));
mType = TArrayOfuint8_t;
return (*(this));
}
auto UDPData::operator=(const IPCStream& aRhs) -> UDPData&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream(aRhs);
mType = TIPCStream;
return (*(this));
}
auto UDPData::operator=(IPCStream&& aRhs) -> UDPData&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream(std::move(aRhs));
mType = TIPCStream;
return (*(this));
}
auto UDPData::operator=(const UDPData& aRhs) -> UDPData&
{
(aRhs).AssertSanity();
Type t = (aRhs).type();
switch (t) {
case TArrayOfuint8_t:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>(((aRhs).get_ArrayOfuint8_t()).Clone());
break;
}
case TIPCStream:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream((aRhs).get_IPCStream());
break;
}
case T__None:
{
MaybeDestroy();
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
break;
}
}
mType = t;
return (*(this));
}
auto UDPData::operator=(UDPData&& aRhs) -> UDPData&
{
(aRhs).AssertSanity();
Type t = (aRhs).type();
switch (t) {
case TArrayOfuint8_t:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>(std::move((aRhs).get_ArrayOfuint8_t()));
(aRhs).MaybeDestroy();
break;
}
case TIPCStream:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream(std::move((aRhs).get_IPCStream()));
(aRhs).MaybeDestroy();
break;
}
case T__None:
{
MaybeDestroy();
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
break;
}
}
(aRhs).mType = T__None;
mType = t;
return (*(this));
}
namespace IPC {
auto ParamTraits<::UDPData>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
typedef ::UDPData union__;
int type = (aVar).type();
IPC::WriteParam(aWriter, type);
// Sentinel = 'UDPData'
(aWriter)->WriteSentinel(150864484);
switch (type) {
case union__::TArrayOfuint8_t:
{
IPC::WriteParam(aWriter, (aVar).get_ArrayOfuint8_t());
// Sentinel = 'TArrayOfuint8_t'
(aWriter)->WriteSentinel(771753428);
return;
}
case union__::TIPCStream:
{
IPC::WriteParam(aWriter, (aVar).get_IPCStream());
// Sentinel = 'TIPCStream'
(aWriter)->WriteSentinel(311690141);
return;
}
default:
{
aWriter->FatalError("unknown variant of union UDPData");
return;
}
}
}
auto ParamTraits<::UDPData>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
typedef ::UDPData union__;
auto maybe__type = IPC::ReadParam<int>(aReader);
if (!maybe__type) {
aReader->FatalError("Error deserializing type of union UDPData");
return {};
}
auto& type = *maybe__type;
// Sentinel = 'UDPData'
if ((!((aReader)->ReadSentinel(150864484)))) {
mozilla::ipc::SentinelReadError("Error deserializing type of union UDPData");
return {};
}
switch (type) {
case union__::TArrayOfuint8_t:
{
auto maybe__tmp = IPC::ReadParam<nsTArray<::uint8_t>>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TArrayOfuint8_t of union UDPData");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TArrayOfuint8_t'
if ((!((aReader)->ReadSentinel(771753428)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TArrayOfuint8_t of union UDPData");
return {};
}
return std::move(tmp);
}
case union__::TIPCStream:
{
auto maybe__tmp = IPC::ReadParam<::mozilla::ipc::IPCStream>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TIPCStream of union UDPData");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TIPCStream'
if ((!((aReader)->ReadSentinel(311690141)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TIPCStream of union UDPData");
return {};
}
return std::move(tmp);
}
default:
{
aReader->FatalError("unknown variant of union UDPData");
return {};
}
}
}
} // namespace IPC