Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/net/PSocketProcessBackgroundParent.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/net/SocketProcessBackgroundParent.h"
#include "mozilla/psm/PVerifySSLServerCertParent.h"
#include "mozilla/psm/PSelectTLSClientAuthCertParent.h"
#include "mozilla/psm/PIPCClientCertsParent.h"
#include "mozilla/net/PWebSocketConnectionParent.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 net {
auto PSocketProcessBackgroundParent::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PSocketProcessBackgroundParent::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PSocketProcessBackgroundParent::PSocketProcessBackgroundParent() :
mozilla::ipc::IToplevelProtocol("PSocketProcessBackgroundParent", PSocketProcessBackgroundMsgStart, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PSocketProcessBackgroundParent);
}
PSocketProcessBackgroundParent::~PSocketProcessBackgroundParent()
{
MOZ_COUNT_DTOR(PSocketProcessBackgroundParent);
}
auto PSocketProcessBackgroundParent::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsParentProcess(), "Invalid process for `PSocketProcessBackgroundParent'");
AddRef();
}
auto PSocketProcessBackgroundParent::ActorDealloc() -> void
{
Release();
}
auto PSocketProcessBackgroundParent::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PSocketProcessBackgroundParent::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PSocketProcessBackgroundParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PSocketProcessBackgroundParent::OnMessageReceived(const Message& msg__) -> PSocketProcessBackgroundParent::Result
{
switch (msg__.type()) {
case PSocketProcessBackground::Msg_InitVerifySSLServerCert__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSocketProcessBackground", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSocketProcessBackgroundParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSocketProcessBackground::Msg_InitVerifySSLServerCert", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aEndpoint = IPC::ReadParam<Endpoint<::mozilla::psm::PVerifySSLServerCertParent>>((&(reader__)));
if (!maybe__aEndpoint) {
FatalError("Error deserializing 'Endpoint<::mozilla::psm::PVerifySSLServerCertParent>'");
return MsgValueError;
}
auto& aEndpoint = *maybe__aEndpoint;
// Sentinel = 'aEndpoint'
if ((!(((&(reader__)))->ReadSentinel(292225955)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'Endpoint<::mozilla::psm::PVerifySSLServerCertParent>'");
return MsgValueError;
}
auto maybe__aPeerCertChain = IPC::ReadParam<nsTArray<ByteArray>>((&(reader__)));
if (!maybe__aPeerCertChain) {
FatalError("Error deserializing 'ByteArray[]'");
return MsgValueError;
}
auto& aPeerCertChain = *maybe__aPeerCertChain;
// Sentinel = 'aPeerCertChain'
if ((!(((&(reader__)))->ReadSentinel(664667487)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ByteArray[]'");
return MsgValueError;
}
auto maybe__aHostName = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__aHostName) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& aHostName = *maybe__aHostName;
// Sentinel = 'aHostName'
if ((!(((&(reader__)))->ReadSentinel(290128769)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto maybe__aPort = IPC::ReadParam<int32_t>((&(reader__)));
if (!maybe__aPort) {
FatalError("Error deserializing 'int32_t'");
return MsgValueError;
}
auto& aPort = *maybe__aPort;
// Sentinel = 'aPort'
if ((!(((&(reader__)))->ReadSentinel(97452551)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'int32_t'");
return MsgValueError;
}
auto maybe__aOriginAttributes = IPC::ReadParam<OriginAttributes>((&(reader__)));
if (!maybe__aOriginAttributes) {
FatalError("Error deserializing 'OriginAttributes'");
return MsgValueError;
}
auto& aOriginAttributes = *maybe__aOriginAttributes;
// Sentinel = 'aOriginAttributes'
if ((!(((&(reader__)))->ReadSentinel(1021839089)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'OriginAttributes'");
return MsgValueError;
}
auto maybe__aStapledOCSPResponse = IPC::ReadParam<mozilla::Maybe<ByteArray>>((&(reader__)));
if (!maybe__aStapledOCSPResponse) {
FatalError("Error deserializing 'ByteArray?'");
return MsgValueError;
}
auto& aStapledOCSPResponse = *maybe__aStapledOCSPResponse;
// Sentinel = 'aStapledOCSPResponse'
if ((!(((&(reader__)))->ReadSentinel(1333856179)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ByteArray?'");
return MsgValueError;
}
auto maybe__aSctsFromTLSExtension = IPC::ReadParam<mozilla::Maybe<ByteArray>>((&(reader__)));
if (!maybe__aSctsFromTLSExtension) {
FatalError("Error deserializing 'ByteArray?'");
return MsgValueError;
}
auto& aSctsFromTLSExtension = *maybe__aSctsFromTLSExtension;
// Sentinel = 'aSctsFromTLSExtension'
if ((!(((&(reader__)))->ReadSentinel(1492453443)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ByteArray?'");
return MsgValueError;
}
auto maybe__aDcInfo = IPC::ReadParam<mozilla::Maybe<DelegatedCredentialInfoArg>>((&(reader__)));
if (!maybe__aDcInfo) {
FatalError("Error deserializing 'DelegatedCredentialInfoArg?'");
return MsgValueError;
}
auto& aDcInfo = *maybe__aDcInfo;
// Sentinel = 'aDcInfo'
if ((!(((&(reader__)))->ReadSentinel(165544597)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'DelegatedCredentialInfoArg?'");
return MsgValueError;
}
auto maybe__aProviderFlags = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__aProviderFlags) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& aProviderFlags = *maybe__aProviderFlags;
// Sentinel = 'aProviderFlags'
if ((!(((&(reader__)))->ReadSentinel(701957530)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto maybe__aCertVerifierFlags = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__aCertVerifierFlags) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& aCertVerifierFlags = *maybe__aCertVerifierFlags;
// Sentinel = 'aCertVerifierFlags'
if ((!(((&(reader__)))->ReadSentinel(1116079897)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<SocketProcessBackgroundParent*>(this))->RecvInitVerifySSLServerCert(std::move(aEndpoint), std::move(aPeerCertChain), std::move(aHostName), std::move(aPort), std::move(aOriginAttributes), std::move(aStapledOCSPResponse), std::move(aSctsFromTLSExtension), std::move(aDcInfo), std::move(aProviderFlags), std::move(aCertVerifierFlags));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PSocketProcessBackground::Msg_InitSelectTLSClientAuthCert__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSocketProcessBackground", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSocketProcessBackgroundParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSocketProcessBackground::Msg_InitSelectTLSClientAuthCert", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aEndpoint = IPC::ReadParam<Endpoint<::mozilla::psm::PSelectTLSClientAuthCertParent>>((&(reader__)));
if (!maybe__aEndpoint) {
FatalError("Error deserializing 'Endpoint<::mozilla::psm::PSelectTLSClientAuthCertParent>'");
return MsgValueError;
}
auto& aEndpoint = *maybe__aEndpoint;
// Sentinel = 'aEndpoint'
if ((!(((&(reader__)))->ReadSentinel(292225955)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'Endpoint<::mozilla::psm::PSelectTLSClientAuthCertParent>'");
return MsgValueError;
}
auto maybe__aHostName = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__aHostName) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& aHostName = *maybe__aHostName;
// Sentinel = 'aHostName'
if ((!(((&(reader__)))->ReadSentinel(290128769)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto maybe__aOriginAttributes = IPC::ReadParam<OriginAttributes>((&(reader__)));
if (!maybe__aOriginAttributes) {
FatalError("Error deserializing 'OriginAttributes'");
return MsgValueError;
}
auto& aOriginAttributes = *maybe__aOriginAttributes;
// Sentinel = 'aOriginAttributes'
if ((!(((&(reader__)))->ReadSentinel(1021839089)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'OriginAttributes'");
return MsgValueError;
}
auto maybe__aPort = IPC::ReadParam<int32_t>((&(reader__)));
if (!maybe__aPort) {
FatalError("Error deserializing 'int32_t'");
return MsgValueError;
}
auto& aPort = *maybe__aPort;
// Sentinel = 'aPort'
if ((!(((&(reader__)))->ReadSentinel(97452551)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'int32_t'");
return MsgValueError;
}
auto maybe__aProviderFlags = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__aProviderFlags) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& aProviderFlags = *maybe__aProviderFlags;
// Sentinel = 'aProviderFlags'
if ((!(((&(reader__)))->ReadSentinel(701957530)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto maybe__aProviderTlsFlags = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__aProviderTlsFlags) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& aProviderTlsFlags = *maybe__aProviderTlsFlags;
// Sentinel = 'aProviderTlsFlags'
if ((!(((&(reader__)))->ReadSentinel(1025771213)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto maybe__aServerCertBytes = IPC::ReadParam<ByteArray>((&(reader__)));
if (!maybe__aServerCertBytes) {
FatalError("Error deserializing 'ByteArray'");
return MsgValueError;
}
auto& aServerCertBytes = *maybe__aServerCertBytes;
// Sentinel = 'aServerCertBytes'
if ((!(((&(reader__)))->ReadSentinel(901777006)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ByteArray'");
return MsgValueError;
}
auto maybe__aCANames = IPC::ReadParam<nsTArray<ByteArray>>((&(reader__)));
if (!maybe__aCANames) {
FatalError("Error deserializing 'ByteArray[]'");
return MsgValueError;
}
auto& aCANames = *maybe__aCANames;
// Sentinel = 'aCANames'
if ((!(((&(reader__)))->ReadSentinel(200868570)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ByteArray[]'");
return MsgValueError;
}
auto maybe__aBrowserId = IPC::ReadParam<uint64_t>((&(reader__)));
if (!maybe__aBrowserId) {
FatalError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto& aBrowserId = *maybe__aBrowserId;
// Sentinel = 'aBrowserId'
if ((!(((&(reader__)))->ReadSentinel(363332595)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<SocketProcessBackgroundParent*>(this))->RecvInitSelectTLSClientAuthCert(std::move(aEndpoint), std::move(aHostName), std::move(aOriginAttributes), std::move(aPort), std::move(aProviderFlags), std::move(aProviderTlsFlags), std::move(aServerCertBytes), std::move(aCANames), std::move(aBrowserId));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PSocketProcessBackground::Msg_InitIPCClientCerts__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSocketProcessBackground", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSocketProcessBackgroundParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSocketProcessBackground::Msg_InitIPCClientCerts", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aEndpoint = IPC::ReadParam<Endpoint<::mozilla::psm::PIPCClientCertsParent>>((&(reader__)));
if (!maybe__aEndpoint) {
FatalError("Error deserializing 'Endpoint<::mozilla::psm::PIPCClientCertsParent>'");
return MsgValueError;
}
auto& aEndpoint = *maybe__aEndpoint;
// Sentinel = 'aEndpoint'
if ((!(((&(reader__)))->ReadSentinel(292225955)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'Endpoint<::mozilla::psm::PIPCClientCertsParent>'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<SocketProcessBackgroundParent*>(this))->RecvInitIPCClientCerts(std::move(aEndpoint));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PSocketProcessBackground::Msg_InitWebSocketConnection__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSocketProcessBackground", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSocketProcessBackgroundParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSocketProcessBackground::Msg_InitWebSocketConnection", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aEndpoint = IPC::ReadParam<Endpoint<::mozilla::net::PWebSocketConnectionParent>>((&(reader__)));
if (!maybe__aEndpoint) {
FatalError("Error deserializing 'Endpoint<::mozilla::net::PWebSocketConnectionParent>'");
return MsgValueError;
}
auto& aEndpoint = *maybe__aEndpoint;
// Sentinel = 'aEndpoint'
if ((!(((&(reader__)))->ReadSentinel(292225955)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'Endpoint<::mozilla::net::PWebSocketConnectionParent>'");
return MsgValueError;
}
auto maybe__aListenerId = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__aListenerId) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& aListenerId = *maybe__aListenerId;
// Sentinel = 'aListenerId'
if ((!(((&(reader__)))->ReadSentinel(436667477)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<SocketProcessBackgroundParent*>(this))->RecvInitWebSocketConnection(std::move(aEndpoint), std::move(aListenerId));
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 PSocketProcessBackgroundParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PSocketProcessBackgroundParent::Result
{
return MsgNotKnown;
}
auto PSocketProcessBackgroundParent::DoomSubtree() -> void
{
SetDoomed();
}
auto PSocketProcessBackgroundParent::PeekManagedActor() -> IProtocol*
{
return nullptr;
}
} // namespace net
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::net::PSocketProcessBackgroundParent*>::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::net::PSocketProcessBackgroundParent*>::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, "PSocketProcessBackground", PSocketProcessBackgroundMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::net::PSocketProcessBackgroundParent*>(actor.ref());
}
return {};
}
} // namespace IPC