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


#include "mozilla/layers/PAPZCTreeManagerParent.h"
#include "ipc/nsGUIEventIPC.h"
#include "mozilla/GfxMessageUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/layers/APZCTreeManagerParent.h"
#include "mozilla/layers/KeyboardMap.h"
#include "mozilla/layers/LayersMessageUtils.h"

#include "mozilla/layers/PCompositorBridgeParent.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 layers {


auto PAPZCTreeManagerParent::Recv__delete__() -> mozilla::ipc::IPCResult
{
    return IPC_OK();
}

MOZ_IMPLICIT PAPZCTreeManagerParent::PAPZCTreeManagerParent() :
    mozilla::ipc::IProtocol(kProtocolId, mozilla::ipc::ParentSide)
{
    MOZ_COUNT_CTOR(PAPZCTreeManagerParent);
}

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

auto PAPZCTreeManagerParent::ActorAlloc() -> void
{
}

auto PAPZCTreeManagerParent::ActorDealloc() -> void
{
    if (Manager()) {
        Manager()->DeallocManagee(kProtocolId, this);
    }
}

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

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

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

auto PAPZCTreeManagerParent::Manager() const -> PCompositorBridgeParent*
{
    return static_cast<PCompositorBridgeParent*>(IProtocol::Manager());
}

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

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

auto PAPZCTreeManagerParent::SendNotifyPinchGesture(
        const PinchGestureType& aType,
        const ScrollableLayerGuid& aGuid,
        const LayoutDevicePoint& aFocusPoint,
        const LayoutDeviceCoord& aSpanChange,
        const Modifiers& aModifiers) -> bool
{
    UniquePtr<IPC::Message> msg__ = PAPZCTreeManager::Msg_NotifyPinchGesture(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), aType);
    // Sentinel = 'aType'
    ((&(writer__)))->WriteSentinel(99222020);
    IPC::WriteParam((&(writer__)), aGuid);
    // Sentinel = 'aGuid'
    ((&(writer__)))->WriteSentinel(94044651);
    IPC::WriteParam((&(writer__)), aFocusPoint);
    // Sentinel = 'aFocusPoint'
    ((&(writer__)))->WriteSentinel(430769260);
    IPC::WriteParam((&(writer__)), aSpanChange);
    // Sentinel = 'aSpanChange'
    ((&(writer__)))->WriteSentinel(420021306);
    IPC::WriteParam((&(writer__)), aModifiers);
    // Sentinel = 'aModifiers'
    ((&(writer__)))->WriteSentinel(358286340);


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

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

auto PAPZCTreeManagerParent::SendCancelAutoscroll(const ViewID& aScrollId) -> bool
{
    UniquePtr<IPC::Message> msg__ = PAPZCTreeManager::Msg_CancelAutoscroll(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

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


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

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

auto PAPZCTreeManagerParent::SendNotifyScaleGestureComplete(
        const ViewID& aScrollId,
        const float& aScale) -> bool
{
    UniquePtr<IPC::Message> msg__ = PAPZCTreeManager::Msg_NotifyScaleGestureComplete(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), aScrollId);
    // Sentinel = 'aScrollId'
    ((&(writer__)))->WriteSentinel(293602174);
    IPC::WriteParam((&(writer__)), aScale);
    // Sentinel = 'aScale'
    ((&(writer__)))->WriteSentinel(131531338);


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

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

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

auto PAPZCTreeManagerParent::OnMessageReceived(const Message& msg__) -> PAPZCTreeManagerParent::Result
{
    switch (msg__.type()) {
    case MANAGED_ENDPOINT_BOUND_MESSAGE_TYPE:
        {
            if (!mAwaitingManagedEndpointBind) {
                NS_WARNING("Unexpected managed endpoint lifecycle message after actor bound!");
                return MsgNotAllowed;
            }
            mAwaitingManagedEndpointBind = false;
            return MsgProcessed;
        }
    case MANAGED_ENDPOINT_DROPPED_MESSAGE_TYPE:
        {
            if (!mAwaitingManagedEndpointBind) {
                NS_WARNING("Unexpected managed endpoint lifecycle message after actor bound!");
                return MsgNotAllowed;
            }
            mAwaitingManagedEndpointBind = false;
            this->ActorDisconnected(ManagedEndpointDropped);
            return MsgProcessed;
        }
    case PAPZCTreeManager::Msg_ZoomToRect__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PAPZCTreeManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PAPZCTreeManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PAPZCTreeManager::Msg_ZoomToRect", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aGuid = *maybe__aGuid;
            // Sentinel = 'aGuid'
            if ((!(((&(reader__)))->ReadSentinel(94044651)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'ScrollableLayerGuid'");
                return MsgValueError;
            }
            auto maybe__aZoomTarget = IPC::ReadParam<ZoomTarget>((&(reader__)));
            if (!maybe__aZoomTarget) {
                FatalError("Error deserializing 'ZoomTarget'");
                return MsgValueError;

            }
            auto& aZoomTarget = *maybe__aZoomTarget;
            // Sentinel = 'aZoomTarget'
            if ((!(((&(reader__)))->ReadSentinel(439092334)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'ZoomTarget'");
                return MsgValueError;
            }
            auto maybe__Flags = IPC::ReadParam<uint32_t>((&(reader__)));
            if (!maybe__Flags) {
                FatalError("Error deserializing 'uint32_t'");
                return MsgValueError;

            }
            auto& Flags = *maybe__Flags;
            // Sentinel = 'Flags'
            if ((!(((&(reader__)))->ReadSentinel(91685358)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<APZCTreeManagerParent*>(this))->RecvZoomToRect(std::move(aGuid), std::move(aZoomTarget), std::move(Flags));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PAPZCTreeManager::Msg_ContentReceivedInputBlock__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PAPZCTreeManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PAPZCTreeManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PAPZCTreeManager::Msg_ContentReceivedInputBlock", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aInputBlockId = *maybe__aInputBlockId;
            // Sentinel = 'aInputBlockId'
            if ((!(((&(reader__)))->ReadSentinel(595657994)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
                return MsgValueError;
            }
            auto maybe__PreventDefault = IPC::ReadParam<bool>((&(reader__)));
            if (!maybe__PreventDefault) {
                FatalError("Error deserializing 'bool'");
                return MsgValueError;

            }
            auto& PreventDefault = *maybe__PreventDefault;
            // Sentinel = 'PreventDefault'
            if ((!(((&(reader__)))->ReadSentinel(702350762)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<APZCTreeManagerParent*>(this))->RecvContentReceivedInputBlock(std::move(aInputBlockId), std::move(PreventDefault));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PAPZCTreeManager::Msg_SetTargetAPZC__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PAPZCTreeManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PAPZCTreeManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PAPZCTreeManager::Msg_SetTargetAPZC", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aInputBlockId = *maybe__aInputBlockId;
            // Sentinel = 'aInputBlockId'
            if ((!(((&(reader__)))->ReadSentinel(595657994)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
                return MsgValueError;
            }
            auto maybe__Targets = IPC::ReadParam<nsTArray<ScrollableLayerGuid>>((&(reader__)));
            if (!maybe__Targets) {
                FatalError("Error deserializing 'ScrollableLayerGuid[]'");
                return MsgValueError;

            }
            auto& Targets = *maybe__Targets;
            // Sentinel = 'Targets'
            if ((!(((&(reader__)))->ReadSentinel(184091355)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'ScrollableLayerGuid[]'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<APZCTreeManagerParent*>(this))->RecvSetTargetAPZC(std::move(aInputBlockId), std::move(Targets));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PAPZCTreeManager::Msg_UpdateZoomConstraints__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PAPZCTreeManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PAPZCTreeManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PAPZCTreeManager::Msg_UpdateZoomConstraints", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aGuid = *maybe__aGuid;
            // Sentinel = 'aGuid'
            if ((!(((&(reader__)))->ReadSentinel(94044651)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'ScrollableLayerGuid'");
                return MsgValueError;
            }
            auto maybe__aConstraints = IPC::ReadParam<mozilla::Maybe<ZoomConstraints>>((&(reader__)));
            if (!maybe__aConstraints) {
                FatalError("Error deserializing 'ZoomConstraints?'");
                return MsgValueError;

            }
            auto& aConstraints = *maybe__aConstraints;
            // Sentinel = 'aConstraints'
            if ((!(((&(reader__)))->ReadSentinel(525010170)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'ZoomConstraints?'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<APZCTreeManagerParent*>(this))->RecvUpdateZoomConstraints(std::move(aGuid), std::move(aConstraints));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PAPZCTreeManager::Msg_SetKeyboardMap__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PAPZCTreeManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PAPZCTreeManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PAPZCTreeManager::Msg_SetKeyboardMap", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aKeyboardMap = *maybe__aKeyboardMap;
            // Sentinel = 'aKeyboardMap'
            if ((!(((&(reader__)))->ReadSentinel(507905201)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'KeyboardMap'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<APZCTreeManagerParent*>(this))->RecvSetKeyboardMap(std::move(aKeyboardMap));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PAPZCTreeManager::Msg_SetDPI__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PAPZCTreeManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PAPZCTreeManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PAPZCTreeManager::Msg_SetDPI", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aDpiValue = *maybe__aDpiValue;
            // Sentinel = 'aDpiValue'
            if ((!(((&(reader__)))->ReadSentinel(282919804)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'float'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<APZCTreeManagerParent*>(this))->RecvSetDPI(std::move(aDpiValue));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PAPZCTreeManager::Msg_SetAllowedTouchBehavior__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PAPZCTreeManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PAPZCTreeManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PAPZCTreeManager::Msg_SetAllowedTouchBehavior", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aInputBlockId = *maybe__aInputBlockId;
            // Sentinel = 'aInputBlockId'
            if ((!(((&(reader__)))->ReadSentinel(595657994)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
                return MsgValueError;
            }
            auto maybe__aValues = IPC::ReadParam<nsTArray<TouchBehaviorFlags>>((&(reader__)));
            if (!maybe__aValues) {
                FatalError("Error deserializing 'TouchBehaviorFlags[]'");
                return MsgValueError;

            }
            auto& aValues = *maybe__aValues;
            // Sentinel = 'aValues'
            if ((!(((&(reader__)))->ReadSentinel(182649554)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'TouchBehaviorFlags[]'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<APZCTreeManagerParent*>(this))->RecvSetAllowedTouchBehavior(std::move(aInputBlockId), std::move(aValues));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PAPZCTreeManager::Msg_StartScrollbarDrag__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PAPZCTreeManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PAPZCTreeManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PAPZCTreeManager::Msg_StartScrollbarDrag", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aGuid = *maybe__aGuid;
            // Sentinel = 'aGuid'
            if ((!(((&(reader__)))->ReadSentinel(94044651)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'ScrollableLayerGuid'");
                return MsgValueError;
            }
            auto maybe__aDragMetrics = IPC::ReadParam<AsyncDragMetrics>((&(reader__)));
            if (!maybe__aDragMetrics) {
                FatalError("Error deserializing 'AsyncDragMetrics'");
                return MsgValueError;

            }
            auto& aDragMetrics = *maybe__aDragMetrics;
            // Sentinel = 'aDragMetrics'
            if ((!(((&(reader__)))->ReadSentinel(496108727)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'AsyncDragMetrics'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<APZCTreeManagerParent*>(this))->RecvStartScrollbarDrag(std::move(aGuid), std::move(aDragMetrics));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PAPZCTreeManager::Msg_StartAutoscroll__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PAPZCTreeManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PAPZCTreeManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PAPZCTreeManager::Msg_StartAutoscroll", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aGuid = *maybe__aGuid;
            // Sentinel = 'aGuid'
            if ((!(((&(reader__)))->ReadSentinel(94044651)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'ScrollableLayerGuid'");
                return MsgValueError;
            }
            auto maybe__aAnchorLocation = IPC::ReadParam<ScreenPoint>((&(reader__)));
            if (!maybe__aAnchorLocation) {
                FatalError("Error deserializing 'ScreenPoint'");
                return MsgValueError;

            }
            auto& aAnchorLocation = *maybe__aAnchorLocation;
            // Sentinel = 'aAnchorLocation'
            if ((!(((&(reader__)))->ReadSentinel(776799734)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'ScreenPoint'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<APZCTreeManagerParent*>(this))->RecvStartAutoscroll(std::move(aGuid), std::move(aAnchorLocation));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PAPZCTreeManager::Msg_StopAutoscroll__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PAPZCTreeManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PAPZCTreeManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PAPZCTreeManager::Msg_StopAutoscroll", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aGuid = *maybe__aGuid;
            // Sentinel = 'aGuid'
            if ((!(((&(reader__)))->ReadSentinel(94044651)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'ScrollableLayerGuid'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<APZCTreeManagerParent*>(this))->RecvStopAutoscroll(std::move(aGuid));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PAPZCTreeManager::Msg_SetLongTapEnabled__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PAPZCTreeManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PAPZCTreeManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PAPZCTreeManager::Msg_SetLongTapEnabled", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

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

            return MsgProcessed;
        }
    case PAPZCTreeManager::Msg_SetBrowserGestureResponse__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PAPZCTreeManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PAPZCTreeManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PAPZCTreeManager::Msg_SetBrowserGestureResponse", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aInputBlockId = *maybe__aInputBlockId;
            // Sentinel = 'aInputBlockId'
            if ((!(((&(reader__)))->ReadSentinel(595657994)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
                return MsgValueError;
            }
            auto maybe__aResponse = IPC::ReadParam<BrowserGestureResponse>((&(reader__)));
            if (!maybe__aResponse) {
                FatalError("Error deserializing 'BrowserGestureResponse'");
                return MsgValueError;

            }
            auto& aResponse = *maybe__aResponse;
            // Sentinel = 'aResponse'
            if ((!(((&(reader__)))->ReadSentinel(301466545)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'BrowserGestureResponse'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<APZCTreeManagerParent*>(this))->RecvSetBrowserGestureResponse(std::move(aInputBlockId), std::move(aResponse));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PAPZCTreeManager::Msg___delete____ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PAPZCTreeManager", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PAPZCTreeManagerParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PAPZCTreeManager::Msg___delete__", OTHER);

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


            this->ActorDisconnected(Deletion);

            return MsgProcessed;
        }
    default:
        return MsgNotKnown;
    }
}

auto PAPZCTreeManagerParent::OnMessageReceived(
        const Message& msg__,
        UniquePtr<Message>& reply__) -> PAPZCTreeManagerParent::Result
{
    return MsgNotKnown;
}



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

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

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

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

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

} // namespace IPC
