Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/PRemoteLazyInputStreamParent.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/RemoteLazyInputStreamParent.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 {
auto PRemoteLazyInputStreamParent::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PRemoteLazyInputStreamParent::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PRemoteLazyInputStreamParent::PRemoteLazyInputStreamParent() :
mozilla::ipc::IToplevelProtocol("PRemoteLazyInputStreamParent", PRemoteLazyInputStreamMsgStart, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PRemoteLazyInputStreamParent);
}
PRemoteLazyInputStreamParent::~PRemoteLazyInputStreamParent()
{
MOZ_COUNT_DTOR(PRemoteLazyInputStreamParent);
}
auto PRemoteLazyInputStreamParent::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsParentProcess(), "Invalid process for `PRemoteLazyInputStreamParent'");
AddRef();
}
auto PRemoteLazyInputStreamParent::ActorDealloc() -> void
{
Release();
}
auto PRemoteLazyInputStreamParent::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PRemoteLazyInputStreamParent::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PRemoteLazyInputStreamParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PRemoteLazyInputStreamParent::OnMessageReceived(const Message& msg__) -> PRemoteLazyInputStreamParent::Result
{
switch (msg__.type()) {
case PRemoteLazyInputStream::Msg_Clone__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemoteLazyInputStream", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteLazyInputStreamParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemoteLazyInputStream::Msg_Clone", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aCloneEndpoint = IPC::ReadParam<Endpoint<::mozilla::PRemoteLazyInputStreamParent>>((&(reader__)));
if (!maybe__aCloneEndpoint) {
FatalError("Error deserializing 'Endpoint<::mozilla::PRemoteLazyInputStreamParent>'");
return MsgValueError;
}
auto& aCloneEndpoint = *maybe__aCloneEndpoint;
// Sentinel = 'aCloneEndpoint'
if ((!(((&(reader__)))->ReadSentinel(678036884)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'Endpoint<::mozilla::PRemoteLazyInputStreamParent>'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<RemoteLazyInputStreamParent*>(this))->RecvClone(std::move(aCloneEndpoint));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PRemoteLazyInputStream::Msg_StreamNeeded__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemoteLazyInputStream", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteLazyInputStreamParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemoteLazyInputStream::Msg_StreamNeeded", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aStart = IPC::ReadParam<uint64_t>((&(reader__)));
if (!maybe__aStart) {
FatalError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto& aStart = *maybe__aStart;
// Sentinel = 'aStart'
if ((!(((&(reader__)))->ReadSentinel(137757296)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto maybe__aLength = IPC::ReadParam<uint64_t>((&(reader__)));
if (!maybe__aLength) {
FatalError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto& aLength = *maybe__aLength;
// Sentinel = 'aLength'
if ((!(((&(reader__)))->ReadSentinel(179045060)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = MSG_ROUTING_CONTROL;
UniquePtr<IPC::Message> reply__(PRemoteLazyInputStream::Reply_StreamNeeded(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
StreamNeededResolver resolver = [resolver__ = std::move(resolver__)](const mozilla::Maybe<IPCStream>& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'stream'
((&(writer__)))->WriteSentinel(153223821);
if (mozilla::ipc::LoggingEnabledFor("PRemoteLazyInputStream", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteLazyInputStreamParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (static_cast<RemoteLazyInputStreamParent*>(this))->RecvStreamNeeded(std::move(aStart), std::move(aLength), std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PRemoteLazyInputStream::Msg_LengthNeeded__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemoteLazyInputStream", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteLazyInputStreamParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemoteLazyInputStream::Msg_LengthNeeded", OTHER);
int32_t id__ = MSG_ROUTING_CONTROL;
UniquePtr<IPC::Message> reply__(PRemoteLazyInputStream::Reply_LengthNeeded(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
LengthNeededResolver resolver = [resolver__ = std::move(resolver__)](const int64_t& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'length'
((&(writer__)))->WriteSentinel(147063427);
if (mozilla::ipc::LoggingEnabledFor("PRemoteLazyInputStream", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteLazyInputStreamParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (static_cast<RemoteLazyInputStreamParent*>(this))->RecvLengthNeeded(std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PRemoteLazyInputStream::Msg_Goodbye__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemoteLazyInputStream", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteLazyInputStreamParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemoteLazyInputStream::Msg_Goodbye", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<RemoteLazyInputStreamParent*>(this))->RecvGoodbye();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
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 PRemoteLazyInputStreamParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PRemoteLazyInputStreamParent::Result
{
MOZ_ASSERT_UNREACHABLE("message protocol not supported");
return MsgNotKnown;
}
auto PRemoteLazyInputStreamParent::DoomSubtree() -> void
{
SetDoomed();
}
auto PRemoteLazyInputStreamParent::PeekManagedActor() -> IProtocol*
{
return nullptr;
}
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::PRemoteLazyInputStreamParent*>::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::PRemoteLazyInputStreamParent*>::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, "PRemoteLazyInputStream", PRemoteLazyInputStreamMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::PRemoteLazyInputStreamParent*>(actor.ref());
}
return {};
}
} // namespace IPC