Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/PSandboxTestingParent.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/SandboxTestingParent.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 PSandboxTestingParent::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PSandboxTestingParent::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PSandboxTestingParent::PSandboxTestingParent() :
mozilla::ipc::IToplevelProtocol("PSandboxTestingParent", PSandboxTestingMsgStart, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PSandboxTestingParent);
}
PSandboxTestingParent::~PSandboxTestingParent()
{
MOZ_COUNT_DTOR(PSandboxTestingParent);
}
auto PSandboxTestingParent::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsParentProcess(), "Invalid process for `PSandboxTestingParent'");
AddRef();
}
auto PSandboxTestingParent::ActorDealloc() -> void
{
Release();
}
auto PSandboxTestingParent::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PSandboxTestingParent::SendShutDown() -> bool
{
UniquePtr<IPC::Message> msg__ = PSandboxTesting::Msg_ShutDown(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PSandboxTesting", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSandboxTestingParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSandboxTesting::Msg_ShutDown", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PSandboxTestingParent::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PSandboxTestingParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PSandboxTestingParent::OnMessageReceived(const Message& msg__) -> PSandboxTestingParent::Result
{
switch (msg__.type()) {
case PSandboxTesting::Msg_ReportTestResults__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSandboxTesting", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSandboxTestingParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSandboxTesting::Msg_ReportTestResults", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__testName = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__testName) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& testName = *maybe__testName;
// Sentinel = 'testName'
if ((!(((&(reader__)))->ReadSentinel(251331394)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto maybe__passed = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__passed) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& passed = *maybe__passed;
// Sentinel = 'passed'
if ((!(((&(reader__)))->ReadSentinel(148767361)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
auto maybe__message = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__message) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& message = *maybe__message;
// Sentinel = 'message'
if ((!(((&(reader__)))->ReadSentinel(197198566)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<SandboxTestingParent*>(this))->RecvReportTestResults(std::move(testName), std::move(passed), std::move(message));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PSandboxTesting::Msg_TestCompleted__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSandboxTesting", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSandboxTestingParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSandboxTesting::Msg_TestCompleted", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<SandboxTestingParent*>(this))->RecvTestCompleted();
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 PSandboxTestingParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PSandboxTestingParent::Result
{
switch (msg__.type()) {
case PSandboxTesting::Msg_GetSpecialDirectory__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSandboxTesting", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSandboxTestingParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSandboxTesting::Msg_GetSpecialDirectory", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aSpecialDirName = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__aSpecialDirName) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& aSpecialDirName = *maybe__aSpecialDirName;
// Sentinel = 'aSpecialDirName'
if ((!(((&(reader__)))->ReadSentinel(771622339)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = MSG_ROUTING_CONTROL;
nsString aDirPath{};
mozilla::ipc::IPCResult __ok = (static_cast<SandboxTestingParent*>(this))->RecvGetSpecialDirectory(std::move(aSpecialDirName), (&(aDirPath)));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
reply__ = PSandboxTesting::Reply_GetSpecialDirectory(id__);
IPC::MessageWriter writer__{
(*(reply__)),
this};
IPC::WriteParam((&(writer__)), aDirPath);
// Sentinel = 'aDirPath'
((&(writer__)))->WriteSentinel(223281934);
if (mozilla::ipc::LoggingEnabledFor("PSandboxTesting", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSandboxTestingParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PSandboxTestingParent::DoomSubtree() -> void
{
SetDoomed();
}
auto PSandboxTestingParent::PeekManagedActor() -> IProtocol*
{
return nullptr;
}
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::PSandboxTestingParent*>::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::PSandboxTestingParent*>::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::PSandboxTestingParent*>(actor.ref());
}
return {};
}
} // namespace IPC