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


#include "mozilla/PRDDParent.h"
#include "mozilla/D3DMessageUtils.h"
#include "mozilla/GfxMessageUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/RDDParent.h"
#include "mozilla/ipc/ByteBufUtils.h"
#include "mozilla/ipc/IPCCore.h"

#include "mozilla/PProfilerParent.h"
#include "mozilla/PRemoteMediaManagerParent.h"
#include "mozilla/layers/PVideoBridgeParent.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 PRDDParent::ProcessingError(
        Result aCode,
        const char* aReason) -> void
{
}

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

MOZ_IMPLICIT PRDDParent::PRDDParent() :
    mozilla::ipc::IToplevelProtocol("PRDDParent", kProtocolId, mozilla::ipc::ParentSide)
{
    MOZ_COUNT_CTOR(PRDDParent);
}

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

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

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

auto PRDDParent::OtherPid() const -> ::base::ProcessId
{
    ::base::ProcessId pid =
        ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
    MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
    return pid;
}

auto PRDDParent::OtherChildID() const -> ::GeckoChildID
{
    ::GeckoChildID childID =
        ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid();
    MOZ_RELEASE_ASSERT(childID != -1);
    return childID;
}

auto PRDDParent::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo
{
    return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()};
}

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

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

auto PRDDParent::RejectPendingResponses(ResponseRejectReason aReason) -> void
{
    mAsyncCallbacks.RejectPendingResponses(aReason);
}

auto PRDDParent::SendInitCrashReporter(const CrashReporterInitArgs& aInitArgs) -> bool
{
    UniquePtr<IPC::Message> msg__ = PRDD::Msg_InitCrashReporter(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), aInitArgs);
    // Sentinel = 'aInitArgs'
    ((&(writer__)))->WriteSentinel(286327683);


    if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRDDParent",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRDD::Msg_InitCrashReporter", OTHER);

    bool sendok__ = ChannelSend(std::move(msg__));
    return sendok__;
}

auto PRDDParent::SendAddMemoryReport(const MemoryReport& aReport) -> bool
{
    UniquePtr<IPC::Message> msg__ = PRDD::Msg_AddMemoryReport(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), aReport);
    // Sentinel = 'aReport'
    ((&(writer__)))->WriteSentinel(184025822);


    if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRDDParent",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRDD::Msg_AddMemoryReport", OTHER);

    bool sendok__ = ChannelSend(std::move(msg__));
    return sendok__;
}

auto PRDDParent::SendUpdateMediaCodecsSupported(const MediaCodecsSupported& aSupported) -> bool
{
    UniquePtr<IPC::Message> msg__ = PRDD::Msg_UpdateMediaCodecsSupported(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), aSupported);
    // Sentinel = 'aSupported'
    ((&(writer__)))->WriteSentinel(378799144);


    if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRDDParent",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRDD::Msg_UpdateMediaCodecsSupported", OTHER);

    bool sendok__ = ChannelSend(std::move(msg__));
    return sendok__;
}

auto PRDDParent::SendAccumulateChildHistograms(mozilla::Span<HistogramAccumulation const> accumulations) -> bool
{
    UniquePtr<IPC::Message> msg__ = PRDD::Msg_AccumulateChildHistograms(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), accumulations);
    // Sentinel = 'accumulations'
    ((&(writer__)))->WriteSentinel(632030585);


    if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRDDParent",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRDD::Msg_AccumulateChildHistograms", OTHER);

    bool sendok__ = ChannelSend(std::move(msg__));
    return sendok__;
}

auto PRDDParent::SendAccumulateChildKeyedHistograms(mozilla::Span<KeyedHistogramAccumulation const> accumulations) -> bool
{
    UniquePtr<IPC::Message> msg__ = PRDD::Msg_AccumulateChildKeyedHistograms(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), accumulations);
    // Sentinel = 'accumulations'
    ((&(writer__)))->WriteSentinel(632030585);


    if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRDDParent",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRDD::Msg_AccumulateChildKeyedHistograms", OTHER);

    bool sendok__ = ChannelSend(std::move(msg__));
    return sendok__;
}

auto PRDDParent::SendUpdateChildScalars(mozilla::Span<ScalarAction const> actions) -> bool
{
    UniquePtr<IPC::Message> msg__ = PRDD::Msg_UpdateChildScalars(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), actions);
    // Sentinel = 'actions'
    ((&(writer__)))->WriteSentinel(193200882);


    if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRDDParent",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRDD::Msg_UpdateChildScalars", OTHER);

    bool sendok__ = ChannelSend(std::move(msg__));
    return sendok__;
}

auto PRDDParent::SendUpdateChildKeyedScalars(mozilla::Span<KeyedScalarAction const> actions) -> bool
{
    UniquePtr<IPC::Message> msg__ = PRDD::Msg_UpdateChildKeyedScalars(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), actions);
    // Sentinel = 'actions'
    ((&(writer__)))->WriteSentinel(193200882);


    if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRDDParent",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRDD::Msg_UpdateChildKeyedScalars", OTHER);

    bool sendok__ = ChannelSend(std::move(msg__));
    return sendok__;
}

auto PRDDParent::SendRecordChildEvents(mozilla::Span<ChildEventData const> events) -> bool
{
    UniquePtr<IPC::Message> msg__ = PRDD::Msg_RecordChildEvents(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), events);
    // Sentinel = 'events'
    ((&(writer__)))->WriteSentinel(149619350);


    if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRDDParent",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRDD::Msg_RecordChildEvents", OTHER);

    bool sendok__ = ChannelSend(std::move(msg__));
    return sendok__;
}

auto PRDDParent::SendRecordDiscardedData(const DiscardedData& data) -> bool
{
    UniquePtr<IPC::Message> msg__ = PRDD::Msg_RecordDiscardedData(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), data);
    // Sentinel = 'data'
    ((&(writer__)))->WriteSentinel(67109275);


    if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRDDParent",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRDD::Msg_RecordDiscardedData", OTHER);

    bool sendok__ = ChannelSend(std::move(msg__));
    return sendok__;
}

auto PRDDParent::SendFOGData(ByteBuf&& buf) -> bool
{
    UniquePtr<IPC::Message> msg__ = PRDD::Msg_FOGData(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), std::move(buf));
    // Sentinel = 'buf'
    ((&(writer__)))->WriteSentinel(41484606);


    if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRDDParent",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRDD::Msg_FOGData", OTHER);

    bool sendok__ = ChannelSend(std::move(msg__));
    return sendok__;
}

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

auto PRDDParent::OnMessageReceived(const Message& msg__) -> PRDDParent::Result
{
    switch (msg__.type()) {
    case PRDD::Msg_Init__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PRDDParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PRDD::Msg_Init", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& vars = *maybe__vars;
            // Sentinel = 'vars'
            if ((!(((&(reader__)))->ReadSentinel(72745405)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'GfxVarUpdate[]'");
                return MsgValueError;
            }
            auto maybe__sandboxBroker = IPC::ReadParam<mozilla::Maybe<FileDescriptor>>((&(reader__)));
            if (!maybe__sandboxBroker) {
                FatalError("Error deserializing 'FileDescriptor?'");
                return MsgValueError;

            }
            auto& sandboxBroker = *maybe__sandboxBroker;
            // Sentinel = 'sandboxBroker'
            if ((!(((&(reader__)))->ReadSentinel(625149269)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'FileDescriptor?'");
                return MsgValueError;
            }
            auto maybe__canRecordReleaseTelemetry = IPC::ReadParam<bool>((&(reader__)));
            if (!maybe__canRecordReleaseTelemetry) {
                FatalError("Error deserializing 'bool'");
                return MsgValueError;

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

            }
            auto& aIsReadyForBackgroundProcessing = *maybe__aIsReadyForBackgroundProcessing;
            // Sentinel = 'aIsReadyForBackgroundProcessing'
            if ((!(((&(reader__)))->ReadSentinel(3228372055)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<RDDParent*>(this))->RecvInit(std::move(vars), std::move(sandboxBroker), std::move(canRecordReleaseTelemetry), std::move(aIsReadyForBackgroundProcessing));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PRDD::Msg_InitProfiler__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PRDDParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PRDD::Msg_InitProfiler", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

            auto maybe__endpoint = IPC::ReadParam<Endpoint<::mozilla::PProfilerChild>>((&(reader__)));
            if (!maybe__endpoint) {
                FatalError("Error deserializing 'Endpoint<::mozilla::PProfilerChild>'");
                return MsgValueError;

            }
            auto& endpoint = *maybe__endpoint;
            // Sentinel = 'endpoint'
            if ((!(((&(reader__)))->ReadSentinel(251724642)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'Endpoint<::mozilla::PProfilerChild>'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<RDDParent*>(this))->RecvInitProfiler(std::move(endpoint));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PRDD::Msg_NewContentRemoteMediaManager__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PRDDParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PRDD::Msg_NewContentRemoteMediaManager", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

            auto maybe__endpoint = IPC::ReadParam<Endpoint<::mozilla::PRemoteMediaManagerParent>>((&(reader__)));
            if (!maybe__endpoint) {
                FatalError("Error deserializing 'Endpoint<::mozilla::PRemoteMediaManagerParent>'");
                return MsgValueError;

            }
            auto& endpoint = *maybe__endpoint;
            // Sentinel = 'endpoint'
            if ((!(((&(reader__)))->ReadSentinel(251724642)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'Endpoint<::mozilla::PRemoteMediaManagerParent>'");
                return MsgValueError;
            }
            auto maybe__childId = IPC::ReadParam<ContentParentId>((&(reader__)));
            if (!maybe__childId) {
                FatalError("Error deserializing 'ContentParentId'");
                return MsgValueError;

            }
            auto& childId = *maybe__childId;
            // Sentinel = 'childId'
            if ((!(((&(reader__)))->ReadSentinel(185270962)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'ContentParentId'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<RDDParent*>(this))->RecvNewContentRemoteMediaManager(std::move(endpoint), std::move(childId));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PRDD::Msg_RequestMemoryReport__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PRDDParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PRDD::Msg_RequestMemoryReport", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

            auto maybe__generation = IPC::ReadParam<uint32_t>((&(reader__)));
            if (!maybe__generation) {
                FatalError("Error deserializing 'uint32_t'");
                return MsgValueError;

            }
            auto& generation = *maybe__generation;
            // Sentinel = 'generation'
            if ((!(((&(reader__)))->ReadSentinel(381158445)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
                return MsgValueError;
            }
            auto maybe__anonymize = IPC::ReadParam<bool>((&(reader__)));
            if (!maybe__anonymize) {
                FatalError("Error deserializing 'bool'");
                return MsgValueError;

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

            }
            auto& minimizeMemoryUsage = *maybe__minimizeMemoryUsage;
            // Sentinel = 'minimizeMemoryUsage'
            if ((!(((&(reader__)))->ReadSentinel(1321600977)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }
            auto maybe__DMDFile = IPC::ReadParam<mozilla::Maybe<FileDescriptor>>((&(reader__)));
            if (!maybe__DMDFile) {
                FatalError("Error deserializing 'FileDescriptor?'");
                return MsgValueError;

            }
            auto& DMDFile = *maybe__DMDFile;
            // Sentinel = 'DMDFile'
            if ((!(((&(reader__)))->ReadSentinel(143983190)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'FileDescriptor?'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::ActorId id__ = MSG_ROUTING_CONTROL;
            UniquePtr<IPC::Message> reply__(PRDD::Reply_RequestMemoryReport(id__));
            reply__->set_seqno(msg__.seqno());

            RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
                new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);

            RequestMemoryReportResolver resolver = [resolver__ = std::move(resolver__)](const uint32_t& aParam) {
                resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
                    IPC::MessageWriter writer__(*reply__, self__);
                    IPC::WriteParam((&(writer__)), aParam);
                    // Sentinel = 'aGeneration'
                    ((&(writer__)))->WriteSentinel(430179438);

                    if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
                        mozilla::ipc::LogMessageForProtocol(
                            "PRDDParent",
                            self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
                            "Sending reply ",
                            reply__->type(),
                            mozilla::ipc::MessageDirection::eSending);
                    }

                });
            };
            mozilla::ipc::IPCResult __ok = (static_cast<RDDParent*>(this))->RecvRequestMemoryReport(std::move(generation), std::move(anonymize), std::move(minimizeMemoryUsage), std::move(DMDFile), std::move(resolver));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PRDD::Msg_PreferenceUpdate__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PRDDParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PRDD::Msg_PreferenceUpdate", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

            auto maybe__pref = IPC::ReadParam<Pref>((&(reader__)));
            if (!maybe__pref) {
                FatalError("Error deserializing 'Pref'");
                return MsgValueError;

            }
            auto& pref = *maybe__pref;
            // Sentinel = 'pref'
            if ((!(((&(reader__)))->ReadSentinel(71958958)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'Pref'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<RDDParent*>(this))->RecvPreferenceUpdate(std::move(pref));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PRDD::Msg_UpdateVar__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PRDDParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PRDD::Msg_UpdateVar", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& var = *maybe__var;
            // Sentinel = 'var'
            if ((!(((&(reader__)))->ReadSentinel(43581770)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'GfxVarUpdate[]'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<RDDParent*>(this))->RecvUpdateVar(std::move(var));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PRDD::Msg_InitVideoBridge__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PRDDParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PRDD::Msg_InitVideoBridge", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

            auto maybe__endpoint = IPC::ReadParam<Endpoint<::mozilla::layers::PVideoBridgeChild>>((&(reader__)));
            if (!maybe__endpoint) {
                FatalError("Error deserializing 'Endpoint<::mozilla::layers::PVideoBridgeChild>'");
                return MsgValueError;

            }
            auto& endpoint = *maybe__endpoint;
            // Sentinel = 'endpoint'
            if ((!(((&(reader__)))->ReadSentinel(251724642)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'Endpoint<::mozilla::layers::PVideoBridgeChild>'");
                return MsgValueError;
            }
            auto maybe__createHardwareDevice = IPC::ReadParam<bool>((&(reader__)));
            if (!maybe__createHardwareDevice) {
                FatalError("Error deserializing 'bool'");
                return MsgValueError;

            }
            auto& createHardwareDevice = *maybe__createHardwareDevice;
            // Sentinel = 'createHardwareDevice'
            if ((!(((&(reader__)))->ReadSentinel(1403914227)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }
            auto maybe__contentDeviceData = IPC::ReadParam<ContentDeviceData>((&(reader__)));
            if (!maybe__contentDeviceData) {
                FatalError("Error deserializing 'ContentDeviceData'");
                return MsgValueError;

            }
            auto& contentDeviceData = *maybe__contentDeviceData;
            // Sentinel = 'contentDeviceData'
            if ((!(((&(reader__)))->ReadSentinel(1043203782)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'ContentDeviceData'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<RDDParent*>(this))->RecvInitVideoBridge(std::move(endpoint), std::move(createHardwareDevice), std::move(contentDeviceData));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PRDD::Msg_FlushFOGData__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PRDDParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PRDD::Msg_FlushFOGData", OTHER);

            mozilla::ipc::ActorId id__ = MSG_ROUTING_CONTROL;
            UniquePtr<IPC::Message> reply__(PRDD::Reply_FlushFOGData(id__));
            reply__->set_seqno(msg__.seqno());

            RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
                new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);

            FlushFOGDataResolver resolver = [resolver__ = std::move(resolver__)](ByteBuf&& aParam) {
                resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
                    IPC::MessageWriter writer__(*reply__, self__);
                    IPC::WriteParam((&(writer__)), std::move(aParam));
                    // Sentinel = 'buf'
                    ((&(writer__)))->WriteSentinel(41484606);

                    if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
                        mozilla::ipc::LogMessageForProtocol(
                            "PRDDParent",
                            self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
                            "Sending reply ",
                            reply__->type(),
                            mozilla::ipc::MessageDirection::eSending);
                    }

                });
            };
            mozilla::ipc::IPCResult __ok = (static_cast<RDDParent*>(this))->RecvFlushFOGData(std::move(resolver));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PRDD::Msg_TestTriggerMetrics__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PRDDParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PRDD::Msg_TestTriggerMetrics", OTHER);

            mozilla::ipc::ActorId id__ = MSG_ROUTING_CONTROL;
            UniquePtr<IPC::Message> reply__(PRDD::Reply_TestTriggerMetrics(id__));
            reply__->set_seqno(msg__.seqno());

            RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
                new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);

            TestTriggerMetricsResolver resolver = [resolver__ = std::move(resolver__)](const bool& aParam) {
                resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
                    IPC::MessageWriter writer__(*reply__, self__);
                    IPC::WriteParam((&(writer__)), aParam);
                    // Sentinel = 'unused'
                    ((&(writer__)))->WriteSentinel(155517589);

                    if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
                        mozilla::ipc::LogMessageForProtocol(
                            "PRDDParent",
                            self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
                            "Sending reply ",
                            reply__->type(),
                            mozilla::ipc::MessageDirection::eSending);
                    }

                });
            };
            mozilla::ipc::IPCResult __ok = (static_cast<RDDParent*>(this))->RecvTestTriggerMetrics(std::move(resolver));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PRDD::Msg_TestTelemetryProbes__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PRDD", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PRDDParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PRDD::Msg_TestTelemetryProbes", OTHER);

            mozilla::ipc::IPCResult __ok = (static_cast<RDDParent*>(this))->RecvTestTelemetryProbes();
            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 PRDDParent::OnMessageReceived(
        const Message& msg__,
        UniquePtr<Message>& reply__) -> PRDDParent::Result
{
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
    return MsgNotKnown;
}



} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::PRDDParent*>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, static_cast<mozilla::ipc::IProtocol*>(aVar));
    // Sentinel = 'PRDD'
    (aWriter)->WriteSentinel(50725163);
}

auto ParamTraits<::mozilla::PRDDParent*>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe__actor = IPC::ReadParam<mozilla::ipc::IProtocol*>(aReader);
    if (!maybe__actor) {
        aReader->FatalError("Error deserializing managed PRDD actor");
        return {};

    }
    auto& actor = *maybe__actor;
    // Sentinel = 'PRDD'
    if ((!((aReader)->ReadSentinel(50725163)))) {
        mozilla::ipc::SentinelReadError("Error deserializing managed PRDD actor");
        return {};
    }

    if (actor && actor->GetProtocolId() != PRDDMsgStart) {
        aReader->FatalError("Unexpected actor type (expected PRDD)");

        return {};
    }
    return static_cast<::mozilla::PRDDParent*>(actor);
}

} // namespace IPC
