Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/PSandboxTestingChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/ProfilerMarkers.h"
#include "mozilla/SandboxTestingChild.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 PSandboxTestingChild::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PSandboxTestingChild::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PSandboxTestingChild::PSandboxTestingChild() :
mozilla::ipc::IToplevelProtocol("PSandboxTestingChild", PSandboxTestingMsgStart, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PSandboxTestingChild);
}
PSandboxTestingChild::~PSandboxTestingChild()
{
MOZ_COUNT_DTOR(PSandboxTestingChild);
}
auto PSandboxTestingChild::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(!XRE_IsParentProcess(), "Invalid process for `PSandboxTestingChild'");
AddRef();
}
auto PSandboxTestingChild::ActorDealloc() -> void
{
Release();
}
auto PSandboxTestingChild::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PSandboxTestingChild::SendReportTestResults(
const nsACString& testName,
const bool& passed,
const nsACString& message) -> bool
{
UniquePtr<IPC::Message> msg__ = PSandboxTesting::Msg_ReportTestResults(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), testName);
// Sentinel = 'testName'
((&(writer__)))->WriteSentinel(251331394);
IPC::WriteParam((&(writer__)), passed);
// Sentinel = 'passed'
((&(writer__)))->WriteSentinel(148767361);
IPC::WriteParam((&(writer__)), message);
// Sentinel = 'message'
((&(writer__)))->WriteSentinel(197198566);
if (mozilla::ipc::LoggingEnabledFor("PSandboxTesting", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSandboxTestingChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSandboxTesting::Msg_ReportTestResults", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PSandboxTestingChild::SendTestCompleted() -> bool
{
UniquePtr<IPC::Message> msg__ = PSandboxTesting::Msg_TestCompleted(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PSandboxTesting", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSandboxTestingChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSandboxTesting::Msg_TestCompleted", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PSandboxTestingChild::SendGetSpecialDirectory(
const nsACString& aSpecialDirName,
nsString* aDirPath) -> bool
{
UniquePtr<IPC::Message> msg__ = PSandboxTesting::Msg_GetSpecialDirectory(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aSpecialDirName);
// Sentinel = 'aSpecialDirName'
((&(writer__)))->WriteSentinel(771622339);
UniquePtr<Message> reply__;
if (mozilla::ipc::LoggingEnabledFor("PSandboxTesting", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSandboxTestingChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSandboxTesting::Msg_GetSpecialDirectory", OTHER);
bool sendok__ = false;
{
AUTO_PROFILER_TRACING_MARKER("Sync IPC", "PSandboxTesting::Msg_GetSpecialDirectory", IPC);
sendok__ = ChannelSend(std::move(msg__), (&(reply__)));
}
if ((!(sendok__))) {
return false;
}
if (mozilla::ipc::LoggingEnabledFor("PSandboxTesting", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSandboxTestingChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
IPC::MessageReader reader__{
(*(reply__)),
this};
auto maybe__aDirPath__reply = IPC::ReadParam<nsString>((&(reader__)));
if (!maybe__aDirPath__reply) {
FatalError("Error deserializing 'nsString'");
return false;
}
auto& aDirPath__reply = *maybe__aDirPath__reply;
// Sentinel = 'aDirPath'
if ((!(((&(reader__)))->ReadSentinel(223281934)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
return false;
}
(*(aDirPath)) = std::move(aDirPath__reply);
reader__.EndRead();
return true;
}
auto PSandboxTestingChild::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PSandboxTestingChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PSandboxTestingChild::OnMessageReceived(const Message& msg__) -> PSandboxTestingChild::Result
{
switch (msg__.type()) {
case PSandboxTesting::Msg_ShutDown__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSandboxTesting", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSandboxTestingChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSandboxTesting::Msg_ShutDown", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<SandboxTestingChild*>(this))->RecvShutDown();
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 PSandboxTestingChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PSandboxTestingChild::Result
{
return MsgNotKnown;
}
auto PSandboxTestingChild::DoomSubtree() -> void
{
SetDoomed();
}
auto PSandboxTestingChild::PeekManagedActor() -> IProtocol*
{
return nullptr;
}
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::PSandboxTestingChild*>::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::PSandboxTestingChild*>::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, "PSandboxTesting", PSandboxTestingMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::PSandboxTestingChild*>(actor.ref());
}
return {};
}
} // namespace IPC