//
// Automatically generated by ipdlc.
// Edit at your own risk
//


#include "mozilla/psm/PVerifySSLServerCertChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/psm/VerifySSLServerCertChild.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 PVerifySSLServerCertChild::Recv__delete__() -> mozilla::ipc::IPCResult
{
    return IPC_OK();
}

auto PVerifySSLServerCertChild::ProcessingError(
        Result aCode,
        const char* aReason) -> void
{
}

auto PVerifySSLServerCertChild::ShouldContinueFromReplyTimeout() -> bool
{
    return true;
}

MOZ_IMPLICIT PVerifySSLServerCertChild::PVerifySSLServerCertChild() :
    mozilla::ipc::IToplevelProtocol("PVerifySSLServerCertChild", kProtocolId, mozilla::ipc::ChildSide)
{
    MOZ_COUNT_CTOR(PVerifySSLServerCertChild);
}

PVerifySSLServerCertChild::~PVerifySSLServerCertChild()
{
    MOZ_COUNT_DTOR(PVerifySSLServerCertChild);
}

auto PVerifySSLServerCertChild::ActorAlloc() -> void
{
    MOZ_RELEASE_ASSERT(XRE_IsSocketProcess(), "Invalid process for `PVerifySSLServerCertChild'");
    AddRef();
}

auto PVerifySSLServerCertChild::ActorDealloc() -> void
{
    Release();
}

auto PVerifySSLServerCertChild::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
    return {};
}

auto PVerifySSLServerCertChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
    switch (aProtocol) {
    default:
        return nullptr;
    }
}

auto PVerifySSLServerCertChild::DeallocManagee(
        mozilla::ipc::ProtocolId aProtocolId,
        IProtocol* aListener) -> void
{
    FatalError("unreached");
    return;
}

auto PVerifySSLServerCertChild::OnMessageReceived(const Message& msg__) -> PVerifySSLServerCertChild::Result
{
    if (!CanSend()) {
        if (mozilla::ipc::LoggingEnabledFor("PVerifySSLServerCert", mozilla::ipc::ChildSide)) {
            mozilla::ipc::LogMessageForProtocol(
                "PVerifySSLServerCertChild",
                this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                "Ignored message for dead actor",
                (&(msg__))->type(),
                mozilla::ipc::MessageDirection::eSending);
        }
        return MsgProcessed;

    }
    switch (msg__.type()) {
    case PVerifySSLServerCert::Msg_OnVerifySSLServerCertFinished__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PVerifySSLServerCert", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PVerifySSLServerCertChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PVerifySSLServerCert::Msg_OnVerifySSLServerCertFinished", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

            auto maybe__aBuiltCertChain = IPC::ReadParam<nsTArray<ByteArray>>((&(reader__)));
            if (!maybe__aBuiltCertChain) {
                FatalError("Error deserializing 'ByteArray[]'");
                return MsgValueError;

            }
            auto& aBuiltCertChain = *maybe__aBuiltCertChain;
            // Sentinel = 'aBuiltCertChain'
            if ((!(((&(reader__)))->ReadSentinel(772670931)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'ByteArray[]'");
                return MsgValueError;
            }
            auto maybe__aCertTransparencyStatus = IPC::ReadParam<uint16_t>((&(reader__)));
            if (!maybe__aCertTransparencyStatus) {
                FatalError("Error deserializing 'uint16_t'");
                return MsgValueError;

            }
            auto& aCertTransparencyStatus = *maybe__aCertTransparencyStatus;
            // Sentinel = 'aCertTransparencyStatus'
            if ((!(((&(reader__)))->ReadSentinel(1852770670)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint16_t'");
                return MsgValueError;
            }
            auto maybe__aEVStatus = IPC::ReadParam<EVStatus>((&(reader__)));
            if (!maybe__aEVStatus) {
                FatalError("Error deserializing 'EVStatus'");
                return MsgValueError;

            }
            auto& aEVStatus = *maybe__aEVStatus;
            // Sentinel = 'aEVStatus'
            if ((!(((&(reader__)))->ReadSentinel(275186561)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'EVStatus'");
                return MsgValueError;
            }
            auto maybe__aSucceeded = IPC::ReadParam<bool>((&(reader__)));
            if (!maybe__aSucceeded) {
                FatalError("Error deserializing 'bool'");
                return MsgValueError;

            }
            auto& aSucceeded = *maybe__aSucceeded;
            // Sentinel = 'aSucceeded'
            if ((!(((&(reader__)))->ReadSentinel(357893095)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }
            auto maybe__aFinalError = IPC::ReadParam<int32_t>((&(reader__)));
            if (!maybe__aFinalError) {
                FatalError("Error deserializing 'int32_t'");
                return MsgValueError;

            }
            auto& aFinalError = *maybe__aFinalError;
            // Sentinel = 'aFinalError'
            if ((!(((&(reader__)))->ReadSentinel(420021334)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'int32_t'");
                return MsgValueError;
            }
            auto maybe__aOverridableErrorCategory = IPC::ReadParam<OverridableErrorCategory>((&(reader__)));
            if (!maybe__aOverridableErrorCategory) {
                FatalError("Error deserializing 'OverridableErrorCategory'");
                return MsgValueError;

            }
            auto& aOverridableErrorCategory = *maybe__aOverridableErrorCategory;
            // Sentinel = 'aOverridableErrorCategory'
            if ((!(((&(reader__)))->ReadSentinel(2173635097)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'OverridableErrorCategory'");
                return MsgValueError;
            }
            auto maybe__aIsBuiltCertChainRootBuiltInRoot = IPC::ReadParam<bool>((&(reader__)));
            if (!maybe__aIsBuiltCertChainRootBuiltInRoot) {
                FatalError("Error deserializing 'bool'");
                return MsgValueError;

            }
            auto& aIsBuiltCertChainRootBuiltInRoot = *maybe__aIsBuiltCertChainRootBuiltInRoot;
            // Sentinel = 'aIsBuiltCertChainRootBuiltInRoot'
            if ((!(((&(reader__)))->ReadSentinel(3420130446)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }
            auto maybe__aMadeOCSPRequests = IPC::ReadParam<bool>((&(reader__)));
            if (!maybe__aMadeOCSPRequests) {
                FatalError("Error deserializing 'bool'");
                return MsgValueError;

            }
            auto& aMadeOCSPRequests = *maybe__aMadeOCSPRequests;
            // Sentinel = 'aMadeOCSPRequests'
            if ((!(((&(reader__)))->ReadSentinel(919012970)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::psm::VerifySSLServerCertChild*>(this))->RecvOnVerifySSLServerCertFinished(std::move(aBuiltCertChain), std::move(aCertTransparencyStatus), std::move(aEVStatus), std::move(aSucceeded), std::move(aFinalError), std::move(aOverridableErrorCategory), std::move(aIsBuiltCertChainRootBuiltInRoot), std::move(aMadeOCSPRequests));
            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 PVerifySSLServerCertChild::OnMessageReceived(
        const Message& msg__,
        UniquePtr<Message>& reply__) -> PVerifySSLServerCertChild::Result
{
    if (!CanSend()) {
        return MsgDropped;

    }
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
    return MsgNotKnown;
}



} // namespace psm
} // namespace mozilla
