Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/psm/PIPCClientCertsParent.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/psm/IPCClientCertsParent.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 psm {
auto PIPCClientCertsParent::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
auto PIPCClientCertsParent::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PIPCClientCertsParent::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PIPCClientCertsParent::PIPCClientCertsParent() :
mozilla::ipc::IToplevelProtocol("PIPCClientCertsParent", kProtocolId, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PIPCClientCertsParent);
}
PIPCClientCertsParent::~PIPCClientCertsParent()
{
MOZ_COUNT_DTOR(PIPCClientCertsParent);
}
auto PIPCClientCertsParent::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsParentProcess(), "Invalid process for `PIPCClientCertsParent'");
AddRef();
}
auto PIPCClientCertsParent::ActorDealloc() -> void
{
Release();
}
auto PIPCClientCertsParent::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PIPCClientCertsParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PIPCClientCertsParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PIPCClientCertsParent::OnMessageReceived(const Message& msg__) -> PIPCClientCertsParent::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 PIPCClientCertsParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PIPCClientCertsParent::Result
{
switch (msg__.type()) {
case PIPCClientCerts::Msg_FindObjects__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PIPCClientCerts", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PIPCClientCertsParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PIPCClientCerts::Msg_FindObjects", OTHER);
int32_t id__ = MSG_ROUTING_CONTROL;
nsTArray<IPCClientCertObject> aObjects{};
mozilla::ipc::IPCResult __ok = (static_cast<IPCClientCertsParent*>(this))->RecvFindObjects((&(aObjects)));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
reply__ = PIPCClientCerts::Reply_FindObjects(id__);
IPC::MessageWriter writer__{
(*(reply__)),
this};
IPC::WriteParam((&(writer__)), aObjects);
// Sentinel = 'aObjects'
((&(writer__)))->WriteSentinel(229573420);
if (mozilla::ipc::LoggingEnabledFor("PIPCClientCerts", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PIPCClientCertsParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
return MsgProcessed;
}
case PIPCClientCerts::Msg_Sign__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PIPCClientCerts", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PIPCClientCertsParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PIPCClientCerts::Msg_Sign", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aCert = IPC::ReadParam<ByteArray>((&(reader__)));
if (!maybe__aCert) {
FatalError("Error deserializing 'ByteArray'");
return MsgValueError;
}
auto& aCert = *maybe__aCert;
// Sentinel = 'aCert'
if ((!(((&(reader__)))->ReadSentinel(92078576)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ByteArray'");
return MsgValueError;
}
auto maybe__aData = IPC::ReadParam<ByteArray>((&(reader__)));
if (!maybe__aData) {
FatalError("Error deserializing 'ByteArray'");
return MsgValueError;
}
auto& aData = *maybe__aData;
// Sentinel = 'aData'
if ((!(((&(reader__)))->ReadSentinel(90571228)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ByteArray'");
return MsgValueError;
}
auto maybe__aParams = IPC::ReadParam<ByteArray>((&(reader__)));
if (!maybe__aParams) {
FatalError("Error deserializing 'ByteArray'");
return MsgValueError;
}
auto& aParams = *maybe__aParams;
// Sentinel = 'aParams'
if ((!(((&(reader__)))->ReadSentinel(178979526)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ByteArray'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = MSG_ROUTING_CONTROL;
ByteArray aSignature{};
mozilla::ipc::IPCResult __ok = (static_cast<IPCClientCertsParent*>(this))->RecvSign(std::move(aCert), std::move(aData), std::move(aParams), (&(aSignature)));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
reply__ = PIPCClientCerts::Reply_Sign(id__);
IPC::MessageWriter writer__{
(*(reply__)),
this};
IPC::WriteParam((&(writer__)), aSignature);
// Sentinel = 'aSignature'
((&(writer__)))->WriteSentinel(365495316);
if (mozilla::ipc::LoggingEnabledFor("PIPCClientCerts", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PIPCClientCertsParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
} // namespace psm
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::psm::PIPCClientCertsParent*>::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::psm::PIPCClientCertsParent*>::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, "PIPCClientCerts", PIPCClientCertsMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::psm::PIPCClientCertsParent*>(actor.ref());
}
return {};
}
} // namespace IPC