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


#include "mozilla/gfx/PVRManagerParent.h"
#include "VRManagerChild.h"
#include "VRManagerParent.h"
#include "VRMessageUtils.h"
#include "gfxVR.h"
#include "gfxipc/ShadowLayerUtils.h"
#include "mozilla/GfxMessageUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/dom/GamepadMessageUtils.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/ipc/IPCCore.h"
#include "mozilla/layers/CompositorTypes.h"
#include "mozilla/layers/LayersMessageUtils.h"
#include "mozilla/layers/WebRenderMessageUtils.h"
#include "nsPoint.h"
#include "nsRect.h"

#include "mozilla/gfx/PVRLayerParent.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 gfx {


auto PVRManagerParent::RecvPVRLayerConstructor(
        PVRLayerParent* actor,
        const uint32_t& aDisplayID,
        const uint32_t& aGroup) -> mozilla::ipc::IPCResult
{
    return IPC_OK();
}

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

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

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

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

auto PVRManagerParent::ActorAlloc() -> void
{
    MOZ_RELEASE_ASSERT(XRE_IsParentProcess() || XRE_IsGPUProcess(), "Invalid process for `PVRManagerParent'");
    AddRef();
}

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

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

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

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

auto PVRManagerParent::ManagedPVRLayerParent(nsTArray<PVRLayerParent*>& aArr) const -> void
{
    mManagedPVRLayerParent.ToArray(aArr);
}

auto PVRManagerParent::ManagedPVRLayerParent() const -> const ManagedContainer<PVRLayerParent>&
{
    return mManagedPVRLayerParent;
}

auto PVRManagerParent::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
    static constexpr ::mozilla::ipc::ProtocolId sIds[] = {
        PVRLayerMsgStart
    };
    return sIds;
}

auto PVRManagerParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
    switch (aProtocol) {
    case PVRLayerMsgStart:
        return (&(mManagedPVRLayerParent));
    default:
        return nullptr;
    }
}

auto PVRManagerParent::OpenPVRLayerEndpoint(PVRLayerParent* aActor) -> ManagedEndpoint<PVRLayerChild>
{
    if (!aActor) {
        NS_WARNING("Cannot bind null PVRLayerParent actor");
        return ManagedEndpoint<PVRLayerChild>();
    }

    if (!aActor->SetManagerAndRegister(this)) {
        NS_WARNING("Failed to bind PVRLayerParent actor");
        return ManagedEndpoint<PVRLayerChild>();
    }

    // Mark our actor as awaiting the other side to be bound. This will
    // be cleared when a `MANAGED_ENDPOINT_{DROPPED,BOUND}` message is
    // received.
    aActor->mAwaitingManagedEndpointBind = true;
    return ManagedEndpoint<PVRLayerChild>(mozilla::ipc::PrivateIPDLInterface(), aActor);
}

auto PVRManagerParent::BindPVRLayerEndpoint(
        ManagedEndpoint<PVRLayerParent> aEndpoint,
        PVRLayerParent* aActor) -> bool
{
    return aEndpoint.Bind(mozilla::ipc::PrivateIPDLInterface(), aActor, this);
}

auto PVRManagerParent::SendUpdateDisplayInfo(const VRDisplayInfo& aDisplayInfo) -> bool
{
    UniquePtr<IPC::Message> msg__ = PVRManager::Msg_UpdateDisplayInfo(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

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


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

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

auto PVRManagerParent::SendUpdateRuntimeCapabilities(const VRDisplayCapabilityFlags& aCapabilities) -> bool
{
    UniquePtr<IPC::Message> msg__ = PVRManager::Msg_UpdateRuntimeCapabilities(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

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


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

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

auto PVRManagerParent::SendReplyGamepadVibrateHaptic(const uint32_t& aPromiseID) -> bool
{
    UniquePtr<IPC::Message> msg__ = PVRManager::Msg_ReplyGamepadVibrateHaptic(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

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


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

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

auto PVRManagerParent::SendNotifyPuppetCommandBufferCompleted(const bool& aSuccess) -> bool
{
    UniquePtr<IPC::Message> msg__ = PVRManager::Msg_NotifyPuppetCommandBufferCompleted(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

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


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

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

auto PVRManagerParent::SendNotifyPuppetResetComplete() -> bool
{
    UniquePtr<IPC::Message> msg__ = PVRManager::Msg_NotifyPuppetResetComplete(MSG_ROUTING_CONTROL);
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};



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

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

auto PVRManagerParent::DeallocManagee(
        mozilla::ipc::ProtocolId aProtocolId,
        IProtocol* aListener) -> void
{
    switch (aProtocolId) {
    case PVRLayerMsgStart:
        static_cast<VRManagerParent*>(this)->DeallocPVRLayerParent(static_cast<PVRLayerParent*>(aListener));
        return;
    default:
        FatalError("unreached");
        return;
    }
}

auto PVRManagerParent::OnMessageReceived(const Message& msg__) -> PVRManagerParent::Result
{
    IPC::Message::routeid_t route__ = msg__.routing_id();
    if (MSG_ROUTING_CONTROL != route__) {
        IProtocol* routed__ = Lookup(route__);
        if (!routed__ || !routed__->GetLifecycleProxy()) {
            if (mozilla::ipc::LoggingEnabledFor("PVRManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PVRManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Ignored message for dead actor",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eSending);
            }
            return MsgProcessed;

        }

        RefPtr<mozilla::ipc::ActorLifecycleProxy> proxy__ =
            routed__->GetLifecycleProxy();
        return proxy__->Get()->OnMessageReceived(msg__);
    }

    switch (msg__.type()) {
    case PVRManager::Msg_PVRLayerConstructor__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PVRManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PVRManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PVRManager::Msg_PVRLayerConstructor", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

            auto maybe__actorid__ = IPC::ReadParam<mozilla::ipc::ActorId>((&(reader__)));
            if (!maybe__actorid__) {
                FatalError("Error deserializing 'mozilla::ipc::ActorId'");
                return MsgValueError;

            }
            auto& actorid__ = *maybe__actorid__;
            // Sentinel = 'actorid'
            if ((!(((&(reader__)))->ReadSentinel(193725159)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'mozilla::ipc::ActorId'");
                return MsgValueError;
            }
            auto maybe__aDisplayID = IPC::ReadParam<uint32_t>((&(reader__)));
            if (!maybe__aDisplayID) {
                FatalError("Error deserializing 'uint32_t'");
                return MsgValueError;

            }
            auto& aDisplayID = *maybe__aDisplayID;
            // Sentinel = 'aDisplayID'
            if ((!(((&(reader__)))->ReadSentinel(354812869)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
                return MsgValueError;
            }
            auto maybe__aGroup = IPC::ReadParam<uint32_t>((&(reader__)));
            if (!maybe__aGroup) {
                FatalError("Error deserializing 'uint32_t'");
                return MsgValueError;

            }
            auto& aGroup = *maybe__aGroup;
            // Sentinel = 'aGroup'
            if ((!(((&(reader__)))->ReadSentinel(136184431)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
                return MsgValueError;
            }
            reader__.EndRead();
            PVRLayerParent* actor = (static_cast<VRManagerParent*>(this))->AllocPVRLayerParent(aDisplayID, aGroup);
            if (!actor) {
                NS_WARNING("Cannot bind null PVRLayerParent actor");
                return MsgValueError;
            }

            if (!actor->SetManagerAndRegister(this, actorid__)) {
                NS_WARNING("Failed to bind PVRLayerParent actor");
                return MsgValueError;
            }

            mozilla::ipc::IPCResult __ok = (static_cast<VRManagerParent*>(this))->RecvPVRLayerConstructor(std::move(actor), std::move(aDisplayID), std::move(aGroup));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PVRManager::Msg_DetectRuntimes__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PVRManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PVRManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PVRManager::Msg_DetectRuntimes", OTHER);

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

            return MsgProcessed;
        }
    case PVRManager::Msg_RefreshDisplays__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PVRManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PVRManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PVRManager::Msg_RefreshDisplays", OTHER);

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

            return MsgProcessed;
        }
    case PVRManager::Msg_SetGroupMask__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PVRManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PVRManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PVRManager::Msg_SetGroupMask", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aDisplayID = *maybe__aDisplayID;
            // Sentinel = 'aDisplayID'
            if ((!(((&(reader__)))->ReadSentinel(354812869)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
                return MsgValueError;
            }
            auto maybe__aGroupMask = IPC::ReadParam<uint32_t>((&(reader__)));
            if (!maybe__aGroupMask) {
                FatalError("Error deserializing 'uint32_t'");
                return MsgValueError;

            }
            auto& aGroupMask = *maybe__aGroupMask;
            // Sentinel = 'aGroupMask'
            if ((!(((&(reader__)))->ReadSentinel(360842235)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<VRManagerParent*>(this))->RecvSetGroupMask(std::move(aDisplayID), std::move(aGroupMask));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PVRManager::Msg_SetHaveEventListener__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PVRManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PVRManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PVRManager::Msg_SetHaveEventListener", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aHaveEventListener = *maybe__aHaveEventListener;
            // Sentinel = 'aHaveEventListener'
            if ((!(((&(reader__)))->ReadSentinel(1111164718)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<VRManagerParent*>(this))->RecvSetHaveEventListener(std::move(aHaveEventListener));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PVRManager::Msg_ControllerListenerAdded__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PVRManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PVRManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PVRManager::Msg_ControllerListenerAdded", OTHER);

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

            return MsgProcessed;
        }
    case PVRManager::Msg_ControllerListenerRemoved__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PVRManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PVRManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PVRManager::Msg_ControllerListenerRemoved", OTHER);

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

            return MsgProcessed;
        }
    case PVRManager::Msg_VibrateHaptic__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PVRManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PVRManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PVRManager::Msg_VibrateHaptic", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aGamepadHandle = *maybe__aGamepadHandle;
            // Sentinel = 'aGamepadHandle'
            if ((!(((&(reader__)))->ReadSentinel(663618909)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'GamepadHandle'");
                return MsgValueError;
            }
            auto maybe__aHapticIndex = IPC::ReadParam<uint32_t>((&(reader__)));
            if (!maybe__aHapticIndex) {
                FatalError("Error deserializing 'uint32_t'");
                return MsgValueError;

            }
            auto& aHapticIndex = *maybe__aHapticIndex;
            // Sentinel = 'aHapticIndex'
            if ((!(((&(reader__)))->ReadSentinel(500040883)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
                return MsgValueError;
            }
            auto maybe__aIntensity = IPC::ReadParam<double>((&(reader__)));
            if (!maybe__aIntensity) {
                FatalError("Error deserializing 'double'");
                return MsgValueError;

            }
            auto& aIntensity = *maybe__aIntensity;
            // Sentinel = 'aIntensity'
            if ((!(((&(reader__)))->ReadSentinel(367854633)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'double'");
                return MsgValueError;
            }
            auto maybe__aDuration = IPC::ReadParam<double>((&(reader__)));
            if (!maybe__aDuration) {
                FatalError("Error deserializing 'double'");
                return MsgValueError;

            }
            auto& aDuration = *maybe__aDuration;
            // Sentinel = 'aDuration'
            if ((!(((&(reader__)))->ReadSentinel(296551336)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'double'");
                return MsgValueError;
            }
            auto maybe__aPromiseID = IPC::ReadParam<uint32_t>((&(reader__)));
            if (!maybe__aPromiseID) {
                FatalError("Error deserializing 'uint32_t'");
                return MsgValueError;

            }
            auto& aPromiseID = *maybe__aPromiseID;
            // Sentinel = 'aPromiseID'
            if ((!(((&(reader__)))->ReadSentinel(363398094)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<VRManagerParent*>(this))->RecvVibrateHaptic(std::move(aGamepadHandle), std::move(aHapticIndex), std::move(aIntensity), std::move(aDuration), std::move(aPromiseID));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PVRManager::Msg_StopVibrateHaptic__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PVRManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PVRManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PVRManager::Msg_StopVibrateHaptic", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aGamepadHandle = *maybe__aGamepadHandle;
            // Sentinel = 'aGamepadHandle'
            if ((!(((&(reader__)))->ReadSentinel(663618909)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'GamepadHandle'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<VRManagerParent*>(this))->RecvStopVibrateHaptic(std::move(aGamepadHandle));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PVRManager::Msg_StartVRNavigation__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PVRManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PVRManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PVRManager::Msg_StartVRNavigation", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aDeviceID = *maybe__aDeviceID;
            // Sentinel = 'aDeviceID'
            if ((!(((&(reader__)))->ReadSentinel(280429375)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<VRManagerParent*>(this))->RecvStartVRNavigation(std::move(aDeviceID));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PVRManager::Msg_StopVRNavigation__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PVRManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PVRManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PVRManager::Msg_StopVRNavigation", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aDeviceID = *maybe__aDeviceID;
            // Sentinel = 'aDeviceID'
            if ((!(((&(reader__)))->ReadSentinel(280429375)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
                return MsgValueError;
            }
            auto maybe__aDuration = IPC::ReadParam<TimeDuration>((&(reader__)));
            if (!maybe__aDuration) {
                FatalError("Error deserializing 'TimeDuration'");
                return MsgValueError;

            }
            auto& aDuration = *maybe__aDuration;
            // Sentinel = 'aDuration'
            if ((!(((&(reader__)))->ReadSentinel(296551336)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'TimeDuration'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<VRManagerParent*>(this))->RecvStopVRNavigation(std::move(aDeviceID), std::move(aDuration));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PVRManager::Msg_StartActivity__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PVRManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PVRManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PVRManager::Msg_StartActivity", OTHER);

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

            return MsgProcessed;
        }
    case PVRManager::Msg_StopActivity__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PVRManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PVRManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PVRManager::Msg_StopActivity", OTHER);

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

            return MsgProcessed;
        }
    case PVRManager::Msg_RunPuppet__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PVRManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PVRManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PVRManager::Msg_RunPuppet", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& buffer = *maybe__buffer;
            // Sentinel = 'buffer'
            if ((!(((&(reader__)))->ReadSentinel(144769659)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t[]'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<VRManagerParent*>(this))->RecvRunPuppet(std::move(buffer));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PVRManager::Msg_ResetPuppet__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PVRManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PVRManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PVRManager::Msg_ResetPuppet", OTHER);

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

            return MsgProcessed;
        }
    case PVRManager::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 PVRManagerParent::OnMessageReceived(
        const Message& msg__,
        UniquePtr<Message>& reply__) -> PVRManagerParent::Result
{
    IPC::Message::routeid_t route__ = msg__.routing_id();
    if (MSG_ROUTING_CONTROL != route__) {
        IProtocol* routed__ = Lookup(route__);
        if (!routed__ || !routed__->GetLifecycleProxy()) {
            return MsgDropped;

        }

        RefPtr<mozilla::ipc::ActorLifecycleProxy> proxy__ =
            routed__->GetLifecycleProxy();
        return proxy__->Get()->OnMessageReceived(msg__, reply__);
    }

    return MsgNotKnown;
}



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

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

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

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

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

} // namespace IPC
