Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/layout/PRemotePrintJobChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/dom/PContentChild.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 layout {
auto PRemotePrintJobChild::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
MOZ_IMPLICIT PRemotePrintJobChild::PRemotePrintJobChild() :
mozilla::ipc::IRefCountedProtocol(PRemotePrintJobMsgStart, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PRemotePrintJobChild);
}
PRemotePrintJobChild::~PRemotePrintJobChild()
{
MOZ_COUNT_DTOR(PRemotePrintJobChild);
}
auto PRemotePrintJobChild::ActorAlloc() -> void
{
AddRef();
}
auto PRemotePrintJobChild::ActorDealloc() -> void
{
Release();
}
auto PRemotePrintJobChild::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PRemotePrintJobChild::Manager() const -> PContentChild*
{
return static_cast<PContentChild*>(IProtocol::Manager());
}
auto PRemotePrintJobChild::AllManagedActors(nsTArray<RefPtr<mozilla::ipc::ActorLifecycleProxy>>& arr__) const -> void
{
uint32_t total = 0;
arr__.SetCapacity(total);
}
auto PRemotePrintJobChild::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PRemotePrintJobChild::SendAbortPrint(const nsresult& aRv) -> bool
{
UniquePtr<IPC::Message> msg__ = PRemotePrintJob::Msg_AbortPrint(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aRv);
// Sentinel = 'aRv'
((&(writer__)))->WriteSentinel(37749034);
if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJob", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemotePrintJobChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_AbortPrint", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PRemotePrintJobChild::SendInitializePrint(
const nsAString& aDocumentTitle,
const int32_t& aStartPage,
const int32_t& aEndPage) -> bool
{
UniquePtr<IPC::Message> msg__ = PRemotePrintJob::Msg_InitializePrint(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aDocumentTitle);
// Sentinel = 'aDocumentTitle'
((&(writer__)))->WriteSentinel(695141795);
IPC::WriteParam((&(writer__)), aStartPage);
// Sentinel = 'aStartPage'
((&(writer__)))->WriteSentinel(361497581);
IPC::WriteParam((&(writer__)), aEndPage);
// Sentinel = 'aEndPage'
((&(writer__)))->WriteSentinel(219218678);
if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJob", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemotePrintJobChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_InitializePrint", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PRemotePrintJobChild::SendProcessPage(
const int32_t& aWidthInPoints,
const int32_t& aHeightInPoints,
mozilla::Span<uint64_t const> aDeps) -> bool
{
UniquePtr<IPC::Message> msg__ = PRemotePrintJob::Msg_ProcessPage(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aWidthInPoints);
// Sentinel = 'aWidthInPoints'
((&(writer__)))->WriteSentinel(684524950);
IPC::WriteParam((&(writer__)), aHeightInPoints);
// Sentinel = 'aHeightInPoints'
((&(writer__)))->WriteSentinel(770311663);
IPC::WriteParam((&(writer__)), aDeps);
// Sentinel = 'aDeps'
((&(writer__)))->WriteSentinel(92013038);
if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJob", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemotePrintJobChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_ProcessPage", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PRemotePrintJobChild::SendFinalizePrint() -> bool
{
UniquePtr<IPC::Message> msg__ = PRemotePrintJob::Msg_FinalizePrint(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJob", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemotePrintJobChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_FinalizePrint", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PRemotePrintJobChild::SendProgressChange(
const long& aCurSelfProgress,
const long& aMaxSelfProgress,
const long& aCurTotalProgress,
const long& aMaxTotalProgress) -> bool
{
UniquePtr<IPC::Message> msg__ = PRemotePrintJob::Msg_ProgressChange(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aCurSelfProgress);
// Sentinel = 'aCurSelfProgress'
((&(writer__)))->WriteSentinel(886113899);
IPC::WriteParam((&(writer__)), aMaxSelfProgress);
// Sentinel = 'aMaxSelfProgress'
((&(writer__)))->WriteSentinel(882706023);
IPC::WriteParam((&(writer__)), aCurTotalProgress);
// Sentinel = 'aCurTotalProgress'
((&(writer__)))->WriteSentinel(1012795109);
IPC::WriteParam((&(writer__)), aMaxTotalProgress);
// Sentinel = 'aMaxTotalProgress'
((&(writer__)))->WriteSentinel(1009125089);
if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJob", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemotePrintJobChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_ProgressChange", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PRemotePrintJobChild::SendStatusChange(const nsresult& aStatus) -> bool
{
UniquePtr<IPC::Message> msg__ = PRemotePrintJob::Msg_StatusChange(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aStatus);
// Sentinel = 'aStatus'
((&(writer__)))->WriteSentinel(186712806);
if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJob", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemotePrintJobChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_StatusChange", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PRemotePrintJobChild::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PRemotePrintJobChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PRemotePrintJobChild::OnMessageReceived(const Message& msg__) -> PRemotePrintJobChild::Result
{
switch (msg__.type()) {
case MANAGED_ENDPOINT_BOUND_MESSAGE_TYPE:
{
if (!mAwaitingManagedEndpointBind) {
NS_WARNING("Unexpected managed endpoint lifecycle message after actor bound!");
return MsgNotAllowed;
}
mAwaitingManagedEndpointBind = false;
return MsgProcessed;
}
case MANAGED_ENDPOINT_DROPPED_MESSAGE_TYPE:
{
if (!mAwaitingManagedEndpointBind) {
NS_WARNING("Unexpected managed endpoint lifecycle message after actor bound!");
return MsgNotAllowed;
}
mAwaitingManagedEndpointBind = false;
IProtocol* mgr = this->Manager();
this->DestroySubtree(ManagedEndpointDropped);
this->ClearSubtree();
mgr->RemoveManagee(PRemotePrintJobMsgStart, this);
return MsgProcessed;
}
case PRemotePrintJob::Msg_AbortPrint__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJob", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemotePrintJobChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_AbortPrint", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aRv = IPC::ReadParam<nsresult>((&(reader__)));
if (!maybe__aRv) {
FatalError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto& aRv = *maybe__aRv;
// Sentinel = 'aRv'
if ((!(((&(reader__)))->ReadSentinel(37749034)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (this)->RecvAbortPrint(std::move(aRv));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PRemotePrintJob::Msg_PrintInitializationResult__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJob", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemotePrintJobChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_PrintInitializationResult", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aRv = IPC::ReadParam<nsresult>((&(reader__)));
if (!maybe__aRv) {
FatalError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto& aRv = *maybe__aRv;
// Sentinel = 'aRv'
if ((!(((&(reader__)))->ReadSentinel(37749034)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto maybe__aFd = IPC::ReadParam<FileDescriptor>((&(reader__)));
if (!maybe__aFd) {
FatalError("Error deserializing 'FileDescriptor'");
return MsgValueError;
}
auto& aFd = *maybe__aFd;
// Sentinel = 'aFd'
if ((!(((&(reader__)))->ReadSentinel(34996492)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'FileDescriptor'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (this)->RecvPrintInitializationResult(std::move(aRv), std::move(aFd));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PRemotePrintJob::Msg_PageProcessed__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJob", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemotePrintJobChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemotePrintJob::Msg_PageProcessed", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aFd = IPC::ReadParam<FileDescriptor>((&(reader__)));
if (!maybe__aFd) {
FatalError("Error deserializing 'FileDescriptor'");
return MsgValueError;
}
auto& aFd = *maybe__aFd;
// Sentinel = 'aFd'
if ((!(((&(reader__)))->ReadSentinel(34996492)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'FileDescriptor'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (this)->RecvPageProcessed(std::move(aFd));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PRemotePrintJob::Msg___delete____ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemotePrintJob", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemotePrintJobChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemotePrintJob::Msg___delete__", OTHER);
mozilla::ipc::IPCResult __ok = (this)->Recv__delete__();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
IProtocol* mgr = this->Manager();
this->DestroySubtree(Deletion);
this->ClearSubtree();
mgr->RemoveManagee(PRemotePrintJobMsgStart, this);
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PRemotePrintJobChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PRemotePrintJobChild::Result
{
return MsgNotKnown;
}
auto PRemotePrintJobChild::ClearSubtree() -> void
{
}
} // namespace layout
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::layout::PRemotePrintJobChild*>::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::layout::PRemotePrintJobChild*>::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, "PRemotePrintJob", PRemotePrintJobMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::layout::PRemotePrintJobChild*>(actor.ref());
}
return {};
}
} // namespace IPC