Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/_ipdltest/PTestJSONHandleParent.h"
#include "mozilla/_ipdltest/PTestJSONHandleChild.h"
#include "mozilla/_ipdltest/PTestJSON.h"
#include "mozilla/_ipdltest/PTestJSONParent.h"
#include "mozilla/_ipdltest/PTestJSONChild.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 PTestJSON {
nsresult
CreateEndpoints(
mozilla::ipc::EndpointProcInfo aParentDestInfo,
mozilla::ipc::EndpointProcInfo aChildDestInfo,
mozilla::ipc::Endpoint<::mozilla::_ipdltest::PTestJSONParent>* aParent,
mozilla::ipc::Endpoint<::mozilla::_ipdltest::PTestJSONChild>* aChild)
{
return mozilla::ipc::CreateEndpoints(
mozilla::ipc::PrivateIPDLInterface(),
aParentDestInfo, aChildDestInfo, aParent, aChild);
}
nsresult
CreateEndpoints(
mozilla::ipc::Endpoint<::mozilla::_ipdltest::PTestJSONParent>* aParent,
mozilla::ipc::Endpoint<::mozilla::_ipdltest::PTestJSONChild>* aChild)
{
return mozilla::ipc::CreateEndpoints(
mozilla::ipc::PrivateIPDLInterface(),
aParent, aChild);
}
mozilla::UniquePtr<IPC::Message>
Msg_Start(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_Start__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_PTestJSONHandleConstructor(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_PTestJSONHandleConstructor__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Reply_PTestJSONHandleConstructor(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Reply_PTestJSONHandleConstructor__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_Test(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_Test__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::SYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Reply_Test(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Reply_Test__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::SYNC, IPC::Message::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 PTestJSON
} // namespace _ipdltest
} // namespace mozilla
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct KeyValue|
//
namespace mozilla {
namespace _ipdltest {
auto KeyValue::operator==(const KeyValue& _o) const -> bool
{
if ((!((key()) == ((_o).key())))) {
return false;
}
if ((!((value()) == ((_o).value())))) {
return false;
}
return true;
}
auto KeyValue::operator!=(const KeyValue& _o) const -> bool
{
return (!(operator==(_o)));
}
} // namespace _ipdltest
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::_ipdltest::KeyValue>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, (aVar).key());
// Sentinel = 'key'
(aWriter)->WriteSentinel(42402122);
IPC::WriteParam(aWriter, (aVar).value());
// Sentinel = 'value'
(aWriter)->WriteSentinel(107610654);
}
auto ParamTraits<::mozilla::_ipdltest::KeyValue>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe___key = IPC::ReadParam<::nsString>(aReader);
if (!maybe___key) {
aReader->FatalError("Error deserializing 'key' (nsString) member of 'KeyValue'");
return {};
}
auto& _key = *maybe___key;
// Sentinel = 'key'
if ((!((aReader)->ReadSentinel(42402122)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'key' (nsString) member of 'KeyValue'");
return {};
}
auto maybe___value = IPC::ReadParam<::mozilla::_ipdltest::JSONVariant>(aReader);
if (!maybe___value) {
aReader->FatalError("Error deserializing 'value' (JSONVariant) member of 'KeyValue'");
return {};
}
auto& _value = *maybe___value;
// Sentinel = 'value'
if ((!((aReader)->ReadSentinel(107610654)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'value' (JSONVariant) member of 'KeyValue'");
return {};
}
IPC::ReadResult<paramType> result__{
std::in_place,
std::move(_key),
std::move(_value)};
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |union JSONVariant|
//
namespace mozilla {
namespace _ipdltest {
auto JSONVariant::MaybeDestroy() -> void
{
if ((mType) == (T__None)) {
return;
}
switch (mType) {
case Tvoid_t:
{
(ptr_void_t())->~void_t__tdef();
break;
}
case Tnull_t:
{
(ptr_null_t())->~null_t__tdef();
break;
}
case Tbool:
{
(ptr_bool())->~bool__tdef();
break;
}
case Tint:
{
(ptr_int())->~int__tdef();
break;
}
case Tdouble:
{
(ptr_double())->~double__tdef();
break;
}
case TnsString:
{
(ptr_nsString())->~nsString__tdef();
break;
}
case TPTestJSONHandle:
{
(ptr_PTestJSONHandle())->~PTestJSONHandle__tdef();
break;
}
case TArrayOfKeyValue:
{
delete ptr_ArrayOfKeyValue();
break;
}
case TArrayOfJSONVariant:
{
delete ptr_ArrayOfJSONVariant();
break;
}
default:
{
mozilla::ipc::LogicError("not reached");
break;
}
}
}
MOZ_IMPLICIT JSONVariant::JSONVariant(const void_t& aOther)
{
new (mozilla::KnownNotNull, ptr_void_t()) void_t(aOther);
mType = Tvoid_t;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(void_t&& aOther)
{
new (mozilla::KnownNotNull, ptr_void_t()) void_t(std::move(aOther));
mType = Tvoid_t;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(const null_t& aOther)
{
new (mozilla::KnownNotNull, ptr_null_t()) null_t(aOther);
mType = Tnull_t;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(null_t&& aOther)
{
new (mozilla::KnownNotNull, ptr_null_t()) null_t(std::move(aOther));
mType = Tnull_t;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(const bool& aOther)
{
new (mozilla::KnownNotNull, ptr_bool()) bool(aOther);
mType = Tbool;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(bool&& aOther)
{
new (mozilla::KnownNotNull, ptr_bool()) bool(std::move(aOther));
mType = Tbool;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(const int& aOther)
{
new (mozilla::KnownNotNull, ptr_int()) int(aOther);
mType = Tint;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(int&& aOther)
{
new (mozilla::KnownNotNull, ptr_int()) int(std::move(aOther));
mType = Tint;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(const double& aOther)
{
new (mozilla::KnownNotNull, ptr_double()) double(aOther);
mType = Tdouble;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(double&& aOther)
{
new (mozilla::KnownNotNull, ptr_double()) double(std::move(aOther));
mType = Tdouble;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(const nsString& aOther)
{
new (mozilla::KnownNotNull, ptr_nsString()) nsString(aOther);
mType = TnsString;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(nsString&& aOther)
{
new (mozilla::KnownNotNull, ptr_nsString()) nsString(std::move(aOther));
mType = TnsString;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(const mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>& aOther)
{
new (mozilla::KnownNotNull, ptr_PTestJSONHandle()) mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>(aOther);
mType = TPTestJSONHandle;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>&& aOther)
{
new (mozilla::KnownNotNull, ptr_PTestJSONHandle()) mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>(std::move(aOther));
mType = TPTestJSONHandle;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(const nsTArray<KeyValue>& aOther)
{
ptr_ArrayOfKeyValue() = new nsTArray<KeyValue>((aOther).Clone());
mType = TArrayOfKeyValue;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(nsTArray<KeyValue>&& aOther)
{
ptr_ArrayOfKeyValue() = new nsTArray<KeyValue>(std::move(aOther));
mType = TArrayOfKeyValue;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(const nsTArray<JSONVariant>& aOther)
{
ptr_ArrayOfJSONVariant() = new nsTArray<JSONVariant>((aOther).Clone());
mType = TArrayOfJSONVariant;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(nsTArray<JSONVariant>&& aOther)
{
ptr_ArrayOfJSONVariant() = new nsTArray<JSONVariant>(std::move(aOther));
mType = TArrayOfJSONVariant;
}
MOZ_IMPLICIT JSONVariant::JSONVariant(const JSONVariant& aOther)
{
(aOther).AssertSanity();
switch ((aOther).type()) {
case Tvoid_t:
{
new (mozilla::KnownNotNull, ptr_void_t()) void_t((aOther).get_void_t());
break;
}
case Tnull_t:
{
new (mozilla::KnownNotNull, ptr_null_t()) null_t((aOther).get_null_t());
break;
}
case Tbool:
{
new (mozilla::KnownNotNull, ptr_bool()) bool((aOther).get_bool());
break;
}
case Tint:
{
new (mozilla::KnownNotNull, ptr_int()) int((aOther).get_int());
break;
}
case Tdouble:
{
new (mozilla::KnownNotNull, ptr_double()) double((aOther).get_double());
break;
}
case TnsString:
{
new (mozilla::KnownNotNull, ptr_nsString()) nsString((aOther).get_nsString());
break;
}
case TPTestJSONHandle:
{
new (mozilla::KnownNotNull, ptr_PTestJSONHandle()) mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>((aOther).get_PTestJSONHandle());
break;
}
case TArrayOfKeyValue:
{
ptr_ArrayOfKeyValue() = new nsTArray<KeyValue>(((aOther).get_ArrayOfKeyValue()).Clone());
break;
}
case TArrayOfJSONVariant:
{
ptr_ArrayOfJSONVariant() = new nsTArray<JSONVariant>(((aOther).get_ArrayOfJSONVariant()).Clone());
break;
}
case T__None:
{
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
return;
}
}
mType = (aOther).type();
}
MOZ_IMPLICIT JSONVariant::JSONVariant(JSONVariant&& aOther)
{
(aOther).AssertSanity();
Type t = (aOther).type();
switch (t) {
case Tvoid_t:
{
new (mozilla::KnownNotNull, ptr_void_t()) void_t(std::move((aOther).get_void_t()));
(aOther).MaybeDestroy();
break;
}
case Tnull_t:
{
new (mozilla::KnownNotNull, ptr_null_t()) null_t(std::move((aOther).get_null_t()));
(aOther).MaybeDestroy();
break;
}
case Tbool:
{
new (mozilla::KnownNotNull, ptr_bool()) bool(std::move((aOther).get_bool()));
(aOther).MaybeDestroy();
break;
}
case Tint:
{
new (mozilla::KnownNotNull, ptr_int()) int(std::move((aOther).get_int()));
(aOther).MaybeDestroy();
break;
}
case Tdouble:
{
new (mozilla::KnownNotNull, ptr_double()) double(std::move((aOther).get_double()));
(aOther).MaybeDestroy();
break;
}
case TnsString:
{
new (mozilla::KnownNotNull, ptr_nsString()) nsString(std::move((aOther).get_nsString()));
(aOther).MaybeDestroy();
break;
}
case TPTestJSONHandle:
{
new (mozilla::KnownNotNull, ptr_PTestJSONHandle()) mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>(std::move((aOther).get_PTestJSONHandle()));
(aOther).MaybeDestroy();
break;
}
case TArrayOfKeyValue:
{
ptr_ArrayOfKeyValue() = (aOther).ptr_ArrayOfKeyValue();
break;
}
case TArrayOfJSONVariant:
{
ptr_ArrayOfJSONVariant() = (aOther).ptr_ArrayOfJSONVariant();
break;
}
case T__None:
{
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
return;
}
}
(aOther).mType = T__None;
mType = t;
}
JSONVariant::~JSONVariant()
{
MaybeDestroy();
}
auto JSONVariant::operator=(const void_t& aRhs) -> JSONVariant&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_void_t()) void_t(aRhs);
mType = Tvoid_t;
return (*(this));
}
auto JSONVariant::operator=(void_t&& aRhs) -> JSONVariant&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_void_t()) void_t(std::move(aRhs));
mType = Tvoid_t;
return (*(this));
}
auto JSONVariant::operator=(const null_t& aRhs) -> JSONVariant&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_null_t()) null_t(aRhs);
mType = Tnull_t;
return (*(this));
}
auto JSONVariant::operator=(null_t&& aRhs) -> JSONVariant&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_null_t()) null_t(std::move(aRhs));
mType = Tnull_t;
return (*(this));
}
auto JSONVariant::operator=(const bool& aRhs) -> JSONVariant&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_bool()) bool(aRhs);
mType = Tbool;
return (*(this));
}
auto JSONVariant::operator=(bool&& aRhs) -> JSONVariant&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_bool()) bool(std::move(aRhs));
mType = Tbool;
return (*(this));
}
auto JSONVariant::operator=(const int& aRhs) -> JSONVariant&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_int()) int(aRhs);
mType = Tint;
return (*(this));
}
auto JSONVariant::operator=(int&& aRhs) -> JSONVariant&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_int()) int(std::move(aRhs));
mType = Tint;
return (*(this));
}
auto JSONVariant::operator=(const double& aRhs) -> JSONVariant&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_double()) double(aRhs);
mType = Tdouble;
return (*(this));
}
auto JSONVariant::operator=(double&& aRhs) -> JSONVariant&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_double()) double(std::move(aRhs));
mType = Tdouble;
return (*(this));
}
auto JSONVariant::operator=(const nsString& aRhs) -> JSONVariant&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_nsString()) nsString(aRhs);
mType = TnsString;
return (*(this));
}
auto JSONVariant::operator=(nsString&& aRhs) -> JSONVariant&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_nsString()) nsString(std::move(aRhs));
mType = TnsString;
return (*(this));
}
auto JSONVariant::operator=(const mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>& aRhs) -> JSONVariant&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_PTestJSONHandle()) mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>(aRhs);
mType = TPTestJSONHandle;
return (*(this));
}
auto JSONVariant::operator=(mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>&& aRhs) -> JSONVariant&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_PTestJSONHandle()) mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>(std::move(aRhs));
mType = TPTestJSONHandle;
return (*(this));
}
auto JSONVariant::operator=(const nsTArray<KeyValue>& aRhs) -> JSONVariant&
{
MaybeDestroy();
ptr_ArrayOfKeyValue() = new nsTArray<KeyValue>((aRhs).Clone());
mType = TArrayOfKeyValue;
return (*(this));
}
auto JSONVariant::operator=(nsTArray<KeyValue>&& aRhs) -> JSONVariant&
{
MaybeDestroy();
ptr_ArrayOfKeyValue() = new nsTArray<KeyValue>(std::move(aRhs));
mType = TArrayOfKeyValue;
return (*(this));
}
auto JSONVariant::operator=(const nsTArray<JSONVariant>& aRhs) -> JSONVariant&
{
MaybeDestroy();
ptr_ArrayOfJSONVariant() = new nsTArray<JSONVariant>((aRhs).Clone());
mType = TArrayOfJSONVariant;
return (*(this));
}
auto JSONVariant::operator=(nsTArray<JSONVariant>&& aRhs) -> JSONVariant&
{
MaybeDestroy();
ptr_ArrayOfJSONVariant() = new nsTArray<JSONVariant>(std::move(aRhs));
mType = TArrayOfJSONVariant;
return (*(this));
}
auto JSONVariant::operator=(const JSONVariant& aRhs) -> JSONVariant&
{
(aRhs).AssertSanity();
Type t = (aRhs).type();
switch (t) {
case Tvoid_t:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_void_t()) void_t((aRhs).get_void_t());
break;
}
case Tnull_t:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_null_t()) null_t((aRhs).get_null_t());
break;
}
case Tbool:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_bool()) bool((aRhs).get_bool());
break;
}
case Tint:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_int()) int((aRhs).get_int());
break;
}
case Tdouble:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_double()) double((aRhs).get_double());
break;
}
case TnsString:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_nsString()) nsString((aRhs).get_nsString());
break;
}
case TPTestJSONHandle:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_PTestJSONHandle()) mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>((aRhs).get_PTestJSONHandle());
break;
}
case TArrayOfKeyValue:
{
MaybeDestroy();
ptr_ArrayOfKeyValue() = new nsTArray<KeyValue>(((aRhs).get_ArrayOfKeyValue()).Clone());
break;
}
case TArrayOfJSONVariant:
{
MaybeDestroy();
ptr_ArrayOfJSONVariant() = new nsTArray<JSONVariant>(((aRhs).get_ArrayOfJSONVariant()).Clone());
break;
}
case T__None:
{
MaybeDestroy();
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
break;
}
}
mType = t;
return (*(this));
}
auto JSONVariant::operator=(JSONVariant&& aRhs) -> JSONVariant&
{
(aRhs).AssertSanity();
Type t = (aRhs).type();
switch (t) {
case Tvoid_t:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_void_t()) void_t(std::move((aRhs).get_void_t()));
(aRhs).MaybeDestroy();
break;
}
case Tnull_t:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_null_t()) null_t(std::move((aRhs).get_null_t()));
(aRhs).MaybeDestroy();
break;
}
case Tbool:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_bool()) bool(std::move((aRhs).get_bool()));
(aRhs).MaybeDestroy();
break;
}
case Tint:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_int()) int(std::move((aRhs).get_int()));
(aRhs).MaybeDestroy();
break;
}
case Tdouble:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_double()) double(std::move((aRhs).get_double()));
(aRhs).MaybeDestroy();
break;
}
case TnsString:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_nsString()) nsString(std::move((aRhs).get_nsString()));
(aRhs).MaybeDestroy();
break;
}
case TPTestJSONHandle:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_PTestJSONHandle()) mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>(std::move((aRhs).get_PTestJSONHandle()));
(aRhs).MaybeDestroy();
break;
}
case TArrayOfKeyValue:
{
MaybeDestroy();
ptr_ArrayOfKeyValue() = (aRhs).ptr_ArrayOfKeyValue();
break;
}
case TArrayOfJSONVariant:
{
MaybeDestroy();
ptr_ArrayOfJSONVariant() = (aRhs).ptr_ArrayOfJSONVariant();
break;
}
case T__None:
{
MaybeDestroy();
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
break;
}
}
(aRhs).mType = T__None;
mType = t;
return (*(this));
}
auto JSONVariant::operator==(const void_t& aRhs) const -> bool
{
return (get_void_t()) == (aRhs);
}
auto JSONVariant::operator==(const null_t& aRhs) const -> bool
{
return (get_null_t()) == (aRhs);
}
auto JSONVariant::operator==(const bool& aRhs) const -> bool
{
return (get_bool()) == (aRhs);
}
auto JSONVariant::operator==(const int& aRhs) const -> bool
{
return (get_int()) == (aRhs);
}
auto JSONVariant::operator==(const double& aRhs) const -> bool
{
return (get_double()) == (aRhs);
}
auto JSONVariant::operator==(const nsString& aRhs) const -> bool
{
return (get_nsString()) == (aRhs);
}
auto JSONVariant::operator==(const mozilla::NotNull<::mozilla::ipc::SideVariant<PTestJSONHandleParent*, PTestJSONHandleChild*>>& aRhs) const -> bool
{
return (get_PTestJSONHandle()) == (aRhs);
}
auto JSONVariant::operator==(const nsTArray<KeyValue>& aRhs) const -> bool
{
return (get_ArrayOfKeyValue()) == (aRhs);
}
auto JSONVariant::operator==(const nsTArray<JSONVariant>& aRhs) const -> bool
{
return (get_ArrayOfJSONVariant()) == (aRhs);
}
auto JSONVariant::operator==(const JSONVariant& aRhs) const -> bool
{
if ((type()) != ((aRhs).type())) {
return false;
}
switch (type()) {
case Tvoid_t:
{
return (get_void_t()) == ((aRhs).get_void_t());
}
case Tnull_t:
{
return (get_null_t()) == ((aRhs).get_null_t());
}
case Tbool:
{
return (get_bool()) == ((aRhs).get_bool());
}
case Tint:
{
return (get_int()) == ((aRhs).get_int());
}
case Tdouble:
{
return (get_double()) == ((aRhs).get_double());
}
case TnsString:
{
return (get_nsString()) == ((aRhs).get_nsString());
}
case TPTestJSONHandle:
{
return (get_PTestJSONHandle()) == ((aRhs).get_PTestJSONHandle());
}
case TArrayOfKeyValue:
{
return (get_ArrayOfKeyValue()) == ((aRhs).get_ArrayOfKeyValue());
}
case TArrayOfJSONVariant:
{
return (get_ArrayOfJSONVariant()) == ((aRhs).get_ArrayOfJSONVariant());
}
default:
{
mozilla::ipc::LogicError("unreached");
return false;
}
}
}
} // namespace _ipdltest
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::_ipdltest::JSONVariant>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
typedef ::mozilla::_ipdltest::JSONVariant union__;
int type = (aVar).type();
IPC::WriteParam(aWriter, type);
// Sentinel = 'JSONVariant'
(aWriter)->WriteSentinel(379520016);
switch (type) {
case union__::Tvoid_t:
{
IPC::WriteParam(aWriter, (aVar).get_void_t());
// Sentinel = 'Tvoid_t'
(aWriter)->WriteSentinel(189006554);
return;
}
case union__::Tnull_t:
{
IPC::WriteParam(aWriter, (aVar).get_null_t());
// Sentinel = 'Tnull_t'
(aWriter)->WriteSentinel(190186211);
return;
}
case union__::Tbool:
{
IPC::WriteParam(aWriter, (aVar).get_bool());
// Sentinel = 'Tbool'
(aWriter)->WriteSentinel(96993793);
return;
}
case union__::Tint:
{
IPC::WriteParam(aWriter, (aVar).get_int());
// Sentinel = 'Tint'
(aWriter)->WriteSentinel(64946592);
return;
}
case union__::Tdouble:
{
IPC::WriteParam(aWriter, (aVar).get_double());
// Sentinel = 'Tdouble'
(aWriter)->WriteSentinel(185402064);
return;
}
case union__::TnsString:
{
IPC::WriteParam(aWriter, (aVar).get_nsString());
// Sentinel = 'TnsString'
(aWriter)->WriteSentinel(302908333);
return;
}
case union__::TPTestJSONHandle:
{
IPC::WriteParam(aWriter, (aVar).get_PTestJSONHandle());
// Sentinel = 'TPTestJSONHandle'
(aWriter)->WriteSentinel(808977867);
return;
}
case union__::TArrayOfKeyValue:
{
IPC::WriteParam(aWriter, (aVar).get_ArrayOfKeyValue());
// Sentinel = 'TArrayOfKeyValue'
(aWriter)->WriteSentinel(860227119);
return;
}
case union__::TArrayOfJSONVariant:
{
IPC::WriteParam(aWriter, (aVar).get_ArrayOfJSONVariant());
// Sentinel = 'TArrayOfJSONVariant'
(aWriter)->WriteSentinel(1161758488);
return;
}
default:
{
aWriter->FatalError("unknown variant of union JSONVariant");
return;
}
}
}
auto ParamTraits<::mozilla::_ipdltest::JSONVariant>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
typedef ::mozilla::_ipdltest::JSONVariant union__;
auto maybe__type = IPC::ReadParam<int>(aReader);
if (!maybe__type) {
aReader->FatalError("Error deserializing type of union JSONVariant");
return {};
}
auto& type = *maybe__type;
// Sentinel = 'JSONVariant'
if ((!((aReader)->ReadSentinel(379520016)))) {
mozilla::ipc::SentinelReadError("Error deserializing type of union JSONVariant");
return {};
}
switch (type) {
case union__::Tvoid_t:
{
auto maybe__tmp = IPC::ReadParam<::mozilla::void_t>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant Tvoid_t of union JSONVariant");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'Tvoid_t'
if ((!((aReader)->ReadSentinel(189006554)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant Tvoid_t of union JSONVariant");
return {};
}
return std::move(tmp);
}
case union__::Tnull_t:
{
auto maybe__tmp = IPC::ReadParam<::mozilla::null_t>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant Tnull_t of union JSONVariant");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'Tnull_t'
if ((!((aReader)->ReadSentinel(190186211)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant Tnull_t of union JSONVariant");
return {};
}
return std::move(tmp);
}
case union__::Tbool:
{
auto maybe__tmp = IPC::ReadParam<bool>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant Tbool of union JSONVariant");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'Tbool'
if ((!((aReader)->ReadSentinel(96993793)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant Tbool of union JSONVariant");
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 JSONVariant");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'Tint'
if ((!((aReader)->ReadSentinel(64946592)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant Tint of union JSONVariant");
return {};
}
return std::move(tmp);
}
case union__::Tdouble:
{
auto maybe__tmp = IPC::ReadParam<double>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant Tdouble of union JSONVariant");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'Tdouble'
if ((!((aReader)->ReadSentinel(185402064)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant Tdouble of union JSONVariant");
return {};
}
return std::move(tmp);
}
case union__::TnsString:
{
auto maybe__tmp = IPC::ReadParam<::nsString>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TnsString of union JSONVariant");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TnsString'
if ((!((aReader)->ReadSentinel(302908333)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TnsString of union JSONVariant");
return {};
}
return std::move(tmp);
}
case union__::TPTestJSONHandle:
{
auto maybe__tmp = IPC::ReadParam<mozilla::NotNull<::mozilla::ipc::SideVariant<::mozilla::_ipdltest::PTestJSONHandleParent*, ::mozilla::_ipdltest::PTestJSONHandleChild*>>>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TPTestJSONHandle of union JSONVariant");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TPTestJSONHandle'
if ((!((aReader)->ReadSentinel(808977867)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TPTestJSONHandle of union JSONVariant");
return {};
}
return std::move(tmp);
}
case union__::TArrayOfKeyValue:
{
auto maybe__tmp = IPC::ReadParam<nsTArray<::mozilla::_ipdltest::KeyValue>>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TArrayOfKeyValue of union JSONVariant");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TArrayOfKeyValue'
if ((!((aReader)->ReadSentinel(860227119)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TArrayOfKeyValue of union JSONVariant");
return {};
}
return std::move(tmp);
}
case union__::TArrayOfJSONVariant:
{
auto maybe__tmp = IPC::ReadParam<nsTArray<::mozilla::_ipdltest::JSONVariant>>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TArrayOfJSONVariant of union JSONVariant");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TArrayOfJSONVariant'
if ((!((aReader)->ReadSentinel(1161758488)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TArrayOfJSONVariant of union JSONVariant");
return {};
}
return std::move(tmp);
}
default:
{
aReader->FatalError("unknown variant of union JSONVariant");
return {};
}
}
}
} // namespace IPC