Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/quota/SerializationHelpers.h"
#include "mozilla/dom/quota/PQuotaParent.h"
#include "mozilla/dom/quota/PQuotaChild.h"
#include "mozilla/dom/quota/PQuotaUsageRequest.h"
#include "mozilla/dom/quota/PQuotaUsageRequestParent.h"
#include "mozilla/dom/quota/PQuotaUsageRequestChild.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 dom {
namespace quota {
namespace PQuotaUsageRequest {
nsresult
CreateEndpoints(
base::ProcessId aParentDestPid,
base::ProcessId aChildDestPid,
mozilla::ipc::Endpoint<::mozilla::dom::quota::PQuotaUsageRequestParent>* aParent,
mozilla::ipc::Endpoint<::mozilla::dom::quota::PQuotaUsageRequestChild>* aChild)
{
return mozilla::ipc::CreateEndpoints(
mozilla::ipc::PrivateIPDLInterface(),
aParentDestPid, aChildDestPid, aParent, aChild);
}
mozilla::UniquePtr<IPC::Message>
Msg_Cancel(int32_t routingId)
{
return IPC::Message::IPDLMessage(routingId, Msg_Cancel__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 PQuotaUsageRequest
} // namespace quota
} // namespace dom
} // namespace mozilla
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct OriginUsage|
//
namespace mozilla {
namespace dom {
namespace quota {
auto OriginUsage::StaticAssertions() const -> void
{
static_assert(
(offsetof(OriginUsage, lastAccessed_) - offsetof(OriginUsage, usage_)) == 8,
"Bad assumptions about field layout!");
}
} // namespace quota
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::quota::OriginUsage>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, (aVar).origin());
// Sentinel = 'origin'
(aWriter)->WriteSentinel(150143625);
IPC::WriteParam(aWriter, (aVar).persisted());
// Sentinel = 'persisted'
(aWriter)->WriteSentinel(324273108);
(aWriter)->WriteBytes((&((aVar).usage())), 16);
// Sentinel = 'usage | lastAccessed'
(aWriter)->WriteSentinel(1328154529);
}
auto ParamTraits<::mozilla::dom::quota::OriginUsage>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe___origin = IPC::ReadParam<::nsCString>(aReader);
if (!maybe___origin) {
aReader->FatalError("Error deserializing 'origin' (nsCString) member of 'OriginUsage'");
return {};
}
auto& _origin = *maybe___origin;
// Sentinel = 'origin'
if ((!((aReader)->ReadSentinel(150143625)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'origin' (nsCString) member of 'OriginUsage'");
return {};
}
auto maybe___persisted = IPC::ReadParam<bool>(aReader);
if (!maybe___persisted) {
aReader->FatalError("Error deserializing 'persisted' (bool) member of 'OriginUsage'");
return {};
}
auto& _persisted = *maybe___persisted;
// Sentinel = 'persisted'
if ((!((aReader)->ReadSentinel(324273108)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'persisted' (bool) member of 'OriginUsage'");
return {};
}
IPC::ReadResult<paramType> result__{
std::in_place,
std::move(_origin),
std::move(_persisted),
::uint64_t{0},
::uint64_t{0}};
if ((!((aReader)->ReadBytesInto((&((result__)->usage())), 16)))) {
aReader->FatalError("Error bulk reading fields from uint64_t");
return {};
}
// Sentinel = 'usage | lastAccessed'
if ((!((aReader)->ReadSentinel(1328154529)))) {
mozilla::ipc::SentinelReadError("Error bulk reading fields from uint64_t");
return {};
}
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct AllUsageResponse|
//
namespace mozilla {
namespace dom {
namespace quota {
} // namespace quota
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::quota::AllUsageResponse>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, (aVar).originUsages());
// Sentinel = 'originUsages'
(aWriter)->WriteSentinel(542901489);
}
auto ParamTraits<::mozilla::dom::quota::AllUsageResponse>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe___originUsages = IPC::ReadParam<nsTArray<::mozilla::dom::quota::OriginUsage>>(aReader);
if (!maybe___originUsages) {
aReader->FatalError("Error deserializing 'originUsages' (OriginUsage[]) member of 'AllUsageResponse'");
return {};
}
auto& _originUsages = *maybe___originUsages;
// Sentinel = 'originUsages'
if ((!((aReader)->ReadSentinel(542901489)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'originUsages' (OriginUsage[]) member of 'AllUsageResponse'");
return {};
}
IPC::ReadResult<paramType> result__{
std::in_place,
std::move(_originUsages)};
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct OriginUsageResponse|
//
namespace mozilla {
namespace dom {
namespace quota {
} // namespace quota
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::quota::OriginUsageResponse>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, (aVar).usageInfo());
// Sentinel = 'usageInfo'
(aWriter)->WriteSentinel(309396386);
}
auto ParamTraits<::mozilla::dom::quota::OriginUsageResponse>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe___usageInfo = IPC::ReadParam<::mozilla::dom::quota::UsageInfo>(aReader);
if (!maybe___usageInfo) {
aReader->FatalError("Error deserializing 'usageInfo' (UsageInfo) member of 'OriginUsageResponse'");
return {};
}
auto& _usageInfo = *maybe___usageInfo;
// Sentinel = 'usageInfo'
if ((!((aReader)->ReadSentinel(309396386)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'usageInfo' (UsageInfo) member of 'OriginUsageResponse'");
return {};
}
IPC::ReadResult<paramType> result__{
std::in_place,
std::move(_usageInfo)};
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |union UsageRequestResponse|
//
namespace mozilla {
namespace dom {
namespace quota {
auto UsageRequestResponse::MaybeDestroy() -> void
{
if ((mType) == (T__None)) {
return;
}
switch (mType) {
case Tnsresult:
{
(ptr_nsresult())->~nsresult__tdef();
break;
}
case TAllUsageResponse:
{
(ptr_AllUsageResponse())->~AllUsageResponse__tdef();
break;
}
case TOriginUsageResponse:
{
(ptr_OriginUsageResponse())->~OriginUsageResponse__tdef();
break;
}
default:
{
mozilla::ipc::LogicError("not reached");
break;
}
}
}
MOZ_IMPLICIT UsageRequestResponse::UsageRequestResponse(const nsresult& aOther)
{
new (mozilla::KnownNotNull, ptr_nsresult()) nsresult(aOther);
mType = Tnsresult;
}
MOZ_IMPLICIT UsageRequestResponse::UsageRequestResponse(nsresult&& aOther)
{
new (mozilla::KnownNotNull, ptr_nsresult()) nsresult(std::move(aOther));
mType = Tnsresult;
}
MOZ_IMPLICIT UsageRequestResponse::UsageRequestResponse(const AllUsageResponse& aOther)
{
new (mozilla::KnownNotNull, ptr_AllUsageResponse()) AllUsageResponse(aOther);
mType = TAllUsageResponse;
}
MOZ_IMPLICIT UsageRequestResponse::UsageRequestResponse(AllUsageResponse&& aOther)
{
new (mozilla::KnownNotNull, ptr_AllUsageResponse()) AllUsageResponse(std::move(aOther));
mType = TAllUsageResponse;
}
MOZ_IMPLICIT UsageRequestResponse::UsageRequestResponse(const OriginUsageResponse& aOther)
{
new (mozilla::KnownNotNull, ptr_OriginUsageResponse()) OriginUsageResponse(aOther);
mType = TOriginUsageResponse;
}
MOZ_IMPLICIT UsageRequestResponse::UsageRequestResponse(OriginUsageResponse&& aOther)
{
new (mozilla::KnownNotNull, ptr_OriginUsageResponse()) OriginUsageResponse(std::move(aOther));
mType = TOriginUsageResponse;
}
MOZ_IMPLICIT UsageRequestResponse::UsageRequestResponse(const UsageRequestResponse& aOther)
{
(aOther).AssertSanity();
switch ((aOther).type()) {
case Tnsresult:
{
new (mozilla::KnownNotNull, ptr_nsresult()) nsresult((aOther).get_nsresult());
break;
}
case TAllUsageResponse:
{
new (mozilla::KnownNotNull, ptr_AllUsageResponse()) AllUsageResponse((aOther).get_AllUsageResponse());
break;
}
case TOriginUsageResponse:
{
new (mozilla::KnownNotNull, ptr_OriginUsageResponse()) OriginUsageResponse((aOther).get_OriginUsageResponse());
break;
}
case T__None:
{
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
return;
}
}
mType = (aOther).type();
}
MOZ_IMPLICIT UsageRequestResponse::UsageRequestResponse(UsageRequestResponse&& aOther)
{
(aOther).AssertSanity();
Type t = (aOther).type();
switch (t) {
case Tnsresult:
{
new (mozilla::KnownNotNull, ptr_nsresult()) nsresult(std::move((aOther).get_nsresult()));
(aOther).MaybeDestroy();
break;
}
case TAllUsageResponse:
{
new (mozilla::KnownNotNull, ptr_AllUsageResponse()) AllUsageResponse(std::move((aOther).get_AllUsageResponse()));
(aOther).MaybeDestroy();
break;
}
case TOriginUsageResponse:
{
new (mozilla::KnownNotNull, ptr_OriginUsageResponse()) OriginUsageResponse(std::move((aOther).get_OriginUsageResponse()));
(aOther).MaybeDestroy();
break;
}
case T__None:
{
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
return;
}
}
(aOther).mType = T__None;
mType = t;
}
UsageRequestResponse::~UsageRequestResponse()
{
MaybeDestroy();
}
auto UsageRequestResponse::operator=(const nsresult& aRhs) -> UsageRequestResponse&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_nsresult()) nsresult(aRhs);
mType = Tnsresult;
return (*(this));
}
auto UsageRequestResponse::operator=(nsresult&& aRhs) -> UsageRequestResponse&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_nsresult()) nsresult(std::move(aRhs));
mType = Tnsresult;
return (*(this));
}
auto UsageRequestResponse::operator=(const AllUsageResponse& aRhs) -> UsageRequestResponse&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_AllUsageResponse()) AllUsageResponse(aRhs);
mType = TAllUsageResponse;
return (*(this));
}
auto UsageRequestResponse::operator=(AllUsageResponse&& aRhs) -> UsageRequestResponse&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_AllUsageResponse()) AllUsageResponse(std::move(aRhs));
mType = TAllUsageResponse;
return (*(this));
}
auto UsageRequestResponse::operator=(const OriginUsageResponse& aRhs) -> UsageRequestResponse&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_OriginUsageResponse()) OriginUsageResponse(aRhs);
mType = TOriginUsageResponse;
return (*(this));
}
auto UsageRequestResponse::operator=(OriginUsageResponse&& aRhs) -> UsageRequestResponse&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_OriginUsageResponse()) OriginUsageResponse(std::move(aRhs));
mType = TOriginUsageResponse;
return (*(this));
}
auto UsageRequestResponse::operator=(const UsageRequestResponse& aRhs) -> UsageRequestResponse&
{
(aRhs).AssertSanity();
Type t = (aRhs).type();
switch (t) {
case Tnsresult:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_nsresult()) nsresult((aRhs).get_nsresult());
break;
}
case TAllUsageResponse:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_AllUsageResponse()) AllUsageResponse((aRhs).get_AllUsageResponse());
break;
}
case TOriginUsageResponse:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_OriginUsageResponse()) OriginUsageResponse((aRhs).get_OriginUsageResponse());
break;
}
case T__None:
{
MaybeDestroy();
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
break;
}
}
mType = t;
return (*(this));
}
auto UsageRequestResponse::operator=(UsageRequestResponse&& aRhs) -> UsageRequestResponse&
{
(aRhs).AssertSanity();
Type t = (aRhs).type();
switch (t) {
case Tnsresult:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_nsresult()) nsresult(std::move((aRhs).get_nsresult()));
(aRhs).MaybeDestroy();
break;
}
case TAllUsageResponse:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_AllUsageResponse()) AllUsageResponse(std::move((aRhs).get_AllUsageResponse()));
(aRhs).MaybeDestroy();
break;
}
case TOriginUsageResponse:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_OriginUsageResponse()) OriginUsageResponse(std::move((aRhs).get_OriginUsageResponse()));
(aRhs).MaybeDestroy();
break;
}
case T__None:
{
MaybeDestroy();
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
break;
}
}
(aRhs).mType = T__None;
mType = t;
return (*(this));
}
} // namespace quota
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::quota::UsageRequestResponse>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
typedef ::mozilla::dom::quota::UsageRequestResponse union__;
int type = (aVar).type();
IPC::WriteParam(aWriter, type);
// Sentinel = 'UsageRequestResponse'
(aWriter)->WriteSentinel(1412827182);
switch (type) {
case union__::Tnsresult:
{
IPC::WriteParam(aWriter, (aVar).get_nsresult());
// Sentinel = 'Tnsresult'
(aWriter)->WriteSentinel(313394133);
return;
}
case union__::TAllUsageResponse:
{
IPC::WriteParam(aWriter, (aVar).get_AllUsageResponse());
// Sentinel = 'TAllUsageResponse'
(aWriter)->WriteSentinel(971638450);
return;
}
case union__::TOriginUsageResponse:
{
IPC::WriteParam(aWriter, (aVar).get_OriginUsageResponse());
// Sentinel = 'TOriginUsageResponse'
(aWriter)->WriteSentinel(1376913409);
return;
}
default:
{
aWriter->FatalError("unknown variant of union UsageRequestResponse");
return;
}
}
}
auto ParamTraits<::mozilla::dom::quota::UsageRequestResponse>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
typedef ::mozilla::dom::quota::UsageRequestResponse union__;
auto maybe__type = IPC::ReadParam<int>(aReader);
if (!maybe__type) {
aReader->FatalError("Error deserializing type of union UsageRequestResponse");
return {};
}
auto& type = *maybe__type;
// Sentinel = 'UsageRequestResponse'
if ((!((aReader)->ReadSentinel(1412827182)))) {
mozilla::ipc::SentinelReadError("Error deserializing type of union UsageRequestResponse");
return {};
}
switch (type) {
case union__::Tnsresult:
{
auto maybe__tmp = IPC::ReadParam<::nsresult>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant Tnsresult of union UsageRequestResponse");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'Tnsresult'
if ((!((aReader)->ReadSentinel(313394133)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant Tnsresult of union UsageRequestResponse");
return {};
}
return std::move(tmp);
}
case union__::TAllUsageResponse:
{
auto maybe__tmp = IPC::ReadParam<::mozilla::dom::quota::AllUsageResponse>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TAllUsageResponse of union UsageRequestResponse");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TAllUsageResponse'
if ((!((aReader)->ReadSentinel(971638450)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TAllUsageResponse of union UsageRequestResponse");
return {};
}
return std::move(tmp);
}
case union__::TOriginUsageResponse:
{
auto maybe__tmp = IPC::ReadParam<::mozilla::dom::quota::OriginUsageResponse>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TOriginUsageResponse of union UsageRequestResponse");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TOriginUsageResponse'
if ((!((aReader)->ReadSentinel(1376913409)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TOriginUsageResponse of union UsageRequestResponse");
return {};
}
return std::move(tmp);
}
default:
{
aReader->FatalError("unknown variant of union UsageRequestResponse");
return {};
}
}
}
} // namespace IPC