Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/psm/PIPCClientCertsChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/ProfilerMarkers.h"
#include "mozilla/psm/IPCClientCertsChild.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 PIPCClientCertsChild::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PIPCClientCertsChild::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PIPCClientCertsChild::PIPCClientCertsChild() :
mozilla::ipc::IToplevelProtocol("PIPCClientCertsChild", kProtocolId, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PIPCClientCertsChild);
}
PIPCClientCertsChild::~PIPCClientCertsChild()
{
MOZ_COUNT_DTOR(PIPCClientCertsChild);
}
auto PIPCClientCertsChild::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsSocketProcess(), "Invalid process for `PIPCClientCertsChild'");
AddRef();
}
auto PIPCClientCertsChild::ActorDealloc() -> void
{
Release();
}
auto PIPCClientCertsChild::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PIPCClientCertsChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PIPCClientCertsChild::SendFindObjects(nsTArray<IPCClientCertObject>* aObjects) -> bool
{
UniquePtr<IPC::Message> msg__ = PIPCClientCerts::Msg_FindObjects(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
UniquePtr<Message> reply__;
if (mozilla::ipc::LoggingEnabledFor("PIPCClientCerts", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PIPCClientCertsChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PIPCClientCerts::Msg_FindObjects", OTHER);
bool sendok__ = false;
{
AUTO_PROFILER_TRACING_MARKER("Sync IPC", "PIPCClientCerts::Msg_FindObjects", IPC);
sendok__ = ChannelSend(std::move(msg__), (&(reply__)));
}
if ((!(sendok__))) {
return false;
}
if (mozilla::ipc::LoggingEnabledFor("PIPCClientCerts", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PIPCClientCertsChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
IPC::MessageReader reader__{
(*(reply__)),
this};
auto maybe__aObjects__reply = IPC::ReadParam<nsTArray<IPCClientCertObject>>((&(reader__)));
if (!maybe__aObjects__reply) {
FatalError("Error deserializing 'IPCClientCertObject[]'");
return false;
}
auto& aObjects__reply = *maybe__aObjects__reply;
// Sentinel = 'aObjects'
if ((!(((&(reader__)))->ReadSentinel(229573420)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'IPCClientCertObject[]'");
return false;
}
(*(aObjects)) = std::move(aObjects__reply);
reader__.EndRead();
return true;
}
auto PIPCClientCertsChild::SendSign(
const ByteArray& aCert,
const ByteArray& aData,
const ByteArray& aParams,
ByteArray* aSignature) -> bool
{
UniquePtr<IPC::Message> msg__ = PIPCClientCerts::Msg_Sign(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aCert);
// Sentinel = 'aCert'
((&(writer__)))->WriteSentinel(92078576);
IPC::WriteParam((&(writer__)), aData);
// Sentinel = 'aData'
((&(writer__)))->WriteSentinel(90571228);
IPC::WriteParam((&(writer__)), aParams);
// Sentinel = 'aParams'
((&(writer__)))->WriteSentinel(178979526);
UniquePtr<Message> reply__;
if (mozilla::ipc::LoggingEnabledFor("PIPCClientCerts", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PIPCClientCertsChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PIPCClientCerts::Msg_Sign", OTHER);
bool sendok__ = false;
{
AUTO_PROFILER_TRACING_MARKER("Sync IPC", "PIPCClientCerts::Msg_Sign", IPC);
sendok__ = ChannelSend(std::move(msg__), (&(reply__)));
}
if ((!(sendok__))) {
return false;
}
if (mozilla::ipc::LoggingEnabledFor("PIPCClientCerts", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PIPCClientCertsChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
IPC::MessageReader reader__{
(*(reply__)),
this};
auto maybe__aSignature__reply = IPC::ReadParam<ByteArray>((&(reader__)));
if (!maybe__aSignature__reply) {
FatalError("Error deserializing 'ByteArray'");
return false;
}
auto& aSignature__reply = *maybe__aSignature__reply;
// Sentinel = 'aSignature'
if ((!(((&(reader__)))->ReadSentinel(365495316)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ByteArray'");
return false;
}
(*(aSignature)) = std::move(aSignature__reply);
reader__.EndRead();
return true;
}
auto PIPCClientCertsChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PIPCClientCertsChild::OnMessageReceived(const Message& msg__) -> PIPCClientCertsChild::Result
{
switch (msg__.type()) {
case PIPCClientCerts::Reply___delete____ID:
{
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 PIPCClientCertsChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PIPCClientCertsChild::Result
{
return MsgNotKnown;
}
} // namespace psm
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::psm::PIPCClientCertsChild*>::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::PIPCClientCertsChild*>::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::PIPCClientCertsChild*>(actor.ref());
}
return {};
}
} // namespace IPC