Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/quota/PRemoteQuotaObjectParent.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/dom/quota/RemoteQuotaObjectParent.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 {
auto PRemoteQuotaObjectParent::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PRemoteQuotaObjectParent::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PRemoteQuotaObjectParent::PRemoteQuotaObjectParent() :
mozilla::ipc::IToplevelProtocol("PRemoteQuotaObjectParent", kProtocolId, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PRemoteQuotaObjectParent);
}
PRemoteQuotaObjectParent::~PRemoteQuotaObjectParent()
{
MOZ_COUNT_DTOR(PRemoteQuotaObjectParent);
}
auto PRemoteQuotaObjectParent::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsParentProcess(), "Invalid process for `PRemoteQuotaObjectParent'");
AddRef();
}
auto PRemoteQuotaObjectParent::ActorDealloc() -> void
{
Release();
}
auto PRemoteQuotaObjectParent::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PRemoteQuotaObjectParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PRemoteQuotaObjectParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PRemoteQuotaObjectParent::OnMessageReceived(const Message& msg__) -> PRemoteQuotaObjectParent::Result
{
switch (msg__.type()) {
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 PRemoteQuotaObjectParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PRemoteQuotaObjectParent::Result
{
switch (msg__.type()) {
case PRemoteQuotaObject::Msg_MaybeUpdateSize__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemoteQuotaObject", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteQuotaObjectParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemoteQuotaObject::Msg_MaybeUpdateSize", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__size = IPC::ReadParam<int64_t>((&(reader__)));
if (!maybe__size) {
FatalError("Error deserializing 'int64_t'");
return MsgValueError;
}
auto& size = *maybe__size;
// Sentinel = 'size'
if ((!(((&(reader__)))->ReadSentinel(73662908)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'int64_t'");
return MsgValueError;
}
auto maybe__truncate = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__truncate) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& truncate = *maybe__truncate;
// Sentinel = 'truncate'
if ((!(((&(reader__)))->ReadSentinel(262538087)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = MSG_ROUTING_CONTROL;
bool result{};
mozilla::ipc::IPCResult __ok = (static_cast<RemoteQuotaObjectParent*>(this))->RecvMaybeUpdateSize(std::move(size), std::move(truncate), (&(result)));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
reply__ = PRemoteQuotaObject::Reply_MaybeUpdateSize(id__);
IPC::MessageWriter writer__{
(*(reply__)),
this};
IPC::WriteParam((&(writer__)), result);
// Sentinel = 'result'
((&(writer__)))->WriteSentinel(153223840);
if (mozilla::ipc::LoggingEnabledFor("PRemoteQuotaObject", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteQuotaObjectParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
} // namespace quota
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::quota::PRemoteQuotaObjectParent*>::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::dom::quota::PRemoteQuotaObjectParent*>::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, "PRemoteQuotaObject", PRemoteQuotaObjectMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::dom::quota::PRemoteQuotaObjectParent*>(actor.ref());
}
return {};
}
} // namespace IPC