Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/quota/PRemoteQuotaObjectChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/ProfilerMarkers.h"
#include "mozilla/dom/quota/RemoteQuotaObjectChild.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 PRemoteQuotaObjectChild::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PRemoteQuotaObjectChild::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PRemoteQuotaObjectChild::PRemoteQuotaObjectChild() :
mozilla::ipc::IToplevelProtocol("PRemoteQuotaObjectChild", PRemoteQuotaObjectMsgStart, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PRemoteQuotaObjectChild);
}
PRemoteQuotaObjectChild::~PRemoteQuotaObjectChild()
{
MOZ_COUNT_DTOR(PRemoteQuotaObjectChild);
}
auto PRemoteQuotaObjectChild::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsParentProcess() || XRE_IsContentProcess(), "Invalid process for `PRemoteQuotaObjectChild'");
AddRef();
}
auto PRemoteQuotaObjectChild::ActorDealloc() -> void
{
Release();
}
auto PRemoteQuotaObjectChild::AllManagedActors(nsTArray<RefPtr<mozilla::ipc::ActorLifecycleProxy>>& arr__) const -> void
{
uint32_t total = 0;
arr__.SetCapacity(total);
}
auto PRemoteQuotaObjectChild::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PRemoteQuotaObjectChild::SendMaybeUpdateSize(
const int64_t& size,
const bool& truncate,
bool* result) -> bool
{
UniquePtr<IPC::Message> msg__ = PRemoteQuotaObject::Msg_MaybeUpdateSize(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), size);
// Sentinel = 'size'
((&(writer__)))->WriteSentinel(73662908);
IPC::WriteParam((&(writer__)), truncate);
// Sentinel = 'truncate'
((&(writer__)))->WriteSentinel(262538087);
UniquePtr<Message> reply__;
if (mozilla::ipc::LoggingEnabledFor("PRemoteQuotaObject", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteQuotaObjectChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PRemoteQuotaObject::Msg_MaybeUpdateSize", OTHER);
bool sendok__ = false;
{
AUTO_PROFILER_TRACING_MARKER("Sync IPC", "PRemoteQuotaObject::Msg_MaybeUpdateSize", IPC);
sendok__ = ChannelSend(std::move(msg__), (&(reply__)));
}
if ((!(sendok__))) {
return false;
}
if (mozilla::ipc::LoggingEnabledFor("PRemoteQuotaObject", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteQuotaObjectChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
IPC::MessageReader reader__{
(*(reply__)),
this};
auto maybe__result__reply = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__result__reply) {
FatalError("Error deserializing 'bool'");
return false;
}
auto& result__reply = *maybe__result__reply;
// Sentinel = 'result'
if ((!(((&(reader__)))->ReadSentinel(153223840)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return false;
}
(*(result)) = std::move(result__reply);
reader__.EndRead();
return true;
}
auto PRemoteQuotaObjectChild::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PRemoteQuotaObjectChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PRemoteQuotaObjectChild::OnMessageReceived(const Message& msg__) -> PRemoteQuotaObjectChild::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 PRemoteQuotaObjectChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PRemoteQuotaObjectChild::Result
{
return MsgNotKnown;
}
auto PRemoteQuotaObjectChild::OnChannelClose() -> void
{
DestroySubtree(NormalShutdown);
ClearSubtree();
DeallocShmems();
if (GetLifecycleProxy()) {
GetLifecycleProxy()->Release();
}
}
auto PRemoteQuotaObjectChild::OnChannelError() -> void
{
DestroySubtree(AbnormalShutdown);
ClearSubtree();
DeallocShmems();
if (GetLifecycleProxy()) {
GetLifecycleProxy()->Release();
}
}
auto PRemoteQuotaObjectChild::ClearSubtree() -> void
{
}
} // namespace quota
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::quota::PRemoteQuotaObjectChild*>::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::PRemoteQuotaObjectChild*>::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::PRemoteQuotaObjectChild*>(actor.ref());
}
return {};
}
} // namespace IPC