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


#include "mozilla/PRemoteEncoderChild.h"
#include "PlatformEncoderModule.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/RemoteMediaData.h"
#include "mozilla/RemoteMediaDataEncoderChild.h"
#include "mozilla/RemoteMediaDataEncoderParent.h"
#include "mozilla/dom/MediaIPCUtils.h"

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


MOZ_IMPLICIT PRemoteEncoderChild::PRemoteEncoderChild() :
    mozilla::ipc::IRefCountedProtocol(kProtocolId, mozilla::ipc::ChildSide)
{
    MOZ_COUNT_CTOR(PRemoteEncoderChild);
}

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

auto PRemoteEncoderChild::ActorAlloc() -> void
{
    AddRef();
}

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

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

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

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

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

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

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

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

auto PRemoteEncoderChild::SendConstruct(
        mozilla::ipc::ResolveCallback<MediaResult>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PRemoteEncoder::Msg_Construct(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};



    if (mozilla::ipc::LoggingEnabledFor("PRemoteEncoder", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRemoteEncoderChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRemoteEncoder::Msg_Construct", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PRemoteEncoder::Reply_Construct__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<MediaResult>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'MediaResult'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'MediaResult'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PRemoteEncoderChild::SendConstruct() -> RefPtr<ConstructPromise>
{
    RefPtr<MozPromise<MediaResult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<MediaResult, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendConstruct([promise__](MediaResult&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PRemoteEncoderChild::SendInit(
        mozilla::ipc::ResolveCallback<EncodeInitResultIPDL>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PRemoteEncoder::Msg_Init(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};



    if (mozilla::ipc::LoggingEnabledFor("PRemoteEncoder", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRemoteEncoderChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRemoteEncoder::Msg_Init", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PRemoteEncoder::Reply_Init__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<EncodeInitResultIPDL>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'EncodeInitResultIPDL'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'EncodeInitResultIPDL'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PRemoteEncoderChild::SendInit() -> RefPtr<InitPromise>
{
    RefPtr<MozPromise<EncodeInitResultIPDL, ResponseRejectReason, true>::Private> promise__ = new MozPromise<EncodeInitResultIPDL, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendInit([promise__](EncodeInitResultIPDL&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PRemoteEncoderChild::SendEncode(
        const EncodedInputIPDL& data,
        mozilla::ipc::ResolveCallback<EncodeResultIPDL>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PRemoteEncoder::Msg_Encode(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

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


    if (mozilla::ipc::LoggingEnabledFor("PRemoteEncoder", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRemoteEncoderChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRemoteEncoder::Msg_Encode", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PRemoteEncoder::Reply_Encode__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<EncodeResultIPDL>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'EncodeResultIPDL'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'EncodeResultIPDL'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PRemoteEncoderChild::SendEncode(const EncodedInputIPDL& data) -> RefPtr<EncodePromise>
{
    RefPtr<MozPromise<EncodeResultIPDL, ResponseRejectReason, true>::Private> promise__ = new MozPromise<EncodeResultIPDL, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendEncode(std::move(data), [promise__](EncodeResultIPDL&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PRemoteEncoderChild::SendReconfigure(
        EncoderConfigurationChangeList* configurationChanges,
        mozilla::ipc::ResolveCallback<MediaResult>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PRemoteEncoder::Msg_Reconfigure(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

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


    if (mozilla::ipc::LoggingEnabledFor("PRemoteEncoder", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRemoteEncoderChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRemoteEncoder::Msg_Reconfigure", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PRemoteEncoder::Reply_Reconfigure__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__error = IPC::ReadParam<MediaResult>(aReader);
            if (!maybe__error) {
                (aReader)->FatalError("Error deserializing 'MediaResult'");
                return MsgValueError;

            }
            auto& error = *maybe__error;
            // Sentinel = 'error'
            if ((!((aReader)->ReadSentinel(107741739)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'MediaResult'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(error));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PRemoteEncoderChild::SendReconfigure(EncoderConfigurationChangeList* configurationChanges) -> RefPtr<ReconfigurePromise>
{
    RefPtr<MozPromise<MediaResult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<MediaResult, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendReconfigure(std::move(configurationChanges), [promise__](MediaResult&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PRemoteEncoderChild::SendDrain(
        mozilla::ipc::ResolveCallback<EncodeResultIPDL>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PRemoteEncoder::Msg_Drain(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};



    if (mozilla::ipc::LoggingEnabledFor("PRemoteEncoder", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRemoteEncoderChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRemoteEncoder::Msg_Drain", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PRemoteEncoder::Reply_Drain__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__result = IPC::ReadParam<EncodeResultIPDL>(aReader);
            if (!maybe__result) {
                (aReader)->FatalError("Error deserializing 'EncodeResultIPDL'");
                return MsgValueError;

            }
            auto& result = *maybe__result;
            // Sentinel = 'result'
            if ((!((aReader)->ReadSentinel(153223840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'EncodeResultIPDL'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(result));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PRemoteEncoderChild::SendDrain() -> RefPtr<DrainPromise>
{
    RefPtr<MozPromise<EncodeResultIPDL, ResponseRejectReason, true>::Private> promise__ = new MozPromise<EncodeResultIPDL, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendDrain([promise__](EncodeResultIPDL&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PRemoteEncoderChild::SendReleaseTicket(const uint32_t& ticketId) -> bool
{
    UniquePtr<IPC::Message> msg__ = PRemoteEncoder::Msg_ReleaseTicket(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

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


    if (mozilla::ipc::LoggingEnabledFor("PRemoteEncoder", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRemoteEncoderChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRemoteEncoder::Msg_ReleaseTicket", OTHER);

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

auto PRemoteEncoderChild::SendShutdown(
        mozilla::ipc::ResolveCallback<bool>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PRemoteEncoder::Msg_Shutdown(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};



    if (mozilla::ipc::LoggingEnabledFor("PRemoteEncoder", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRemoteEncoderChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRemoteEncoder::Msg_Shutdown", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PRemoteEncoder::Reply_Shutdown__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__unused = IPC::ReadParam<bool>(aReader);
            if (!maybe__unused) {
                (aReader)->FatalError("Error deserializing 'bool'");
                return MsgValueError;

            }
            auto& unused = *maybe__unused;
            // Sentinel = 'unused'
            if ((!((aReader)->ReadSentinel(155517589)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(unused));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PRemoteEncoderChild::SendShutdown() -> RefPtr<ShutdownPromise>
{
    RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendShutdown([promise__](bool&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PRemoteEncoderChild::SendSetBitrate(
        const uint32_t& aBitsPerSec,
        mozilla::ipc::ResolveCallback<nsresult>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PRemoteEncoder::Msg_SetBitrate(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

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


    if (mozilla::ipc::LoggingEnabledFor("PRemoteEncoder", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRemoteEncoderChild",
            this->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRemoteEncoder::Msg_SetBitrate", OTHER);

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PRemoteEncoder::Reply_SetBitrate__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__rv = IPC::ReadParam<nsresult>(aReader);
            if (!maybe__rv) {
                (aReader)->FatalError("Error deserializing 'nsresult'");
                return MsgValueError;

            }
            auto& rv = *maybe__rv;
            // Sentinel = 'rv'
            if ((!((aReader)->ReadSentinel(22806761)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
                return MsgValueError;
            }


            aReader->EndRead();

            resolve(std::move(rv));
            return MsgProcessed;
        }, std::move(aReject));
    }
    else {
        aReject(::mozilla::ipc::ResponseRejectReason::SendError);
    }
    return;
}

auto PRemoteEncoderChild::SendSetBitrate(const uint32_t& aBitsPerSec) -> RefPtr<SetBitratePromise>
{
    RefPtr<MozPromise<nsresult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<nsresult, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendSetBitrate(std::move(aBitsPerSec), [promise__](nsresult&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PRemoteEncoderChild::Send__delete__(PRemoteEncoderChild* actor) -> bool
{
    if (!actor || !actor->CanSend()) {
        NS_WARNING("Attempt to __delete__ missing or closed actor");
        return false;
    }
    UniquePtr<IPC::Message> msg__ = PRemoteEncoder::Msg___delete__((actor)->Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            actor};


    if (mozilla::ipc::LoggingEnabledFor("PRemoteEncoder", mozilla::ipc::ChildSide)) {
        mozilla::ipc::LogMessageForProtocol(
            "PRemoteEncoderChild",
            actor->ToplevelProtocol()->OtherPidMaybeInvalid(),
            "Sending ",
            msg__->type(),
            mozilla::ipc::MessageDirection::eSending);
    }
    AUTO_PROFILER_LABEL("PRemoteEncoder::Msg___delete__", OTHER);

    bool sendok__ = (actor)->ChannelSend(std::move(msg__));

    actor->ActorDisconnected(Deletion);
    return sendok__;
}

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

auto PRemoteEncoderChild::OnMessageReceived(const Message& msg__) -> PRemoteEncoderChild::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 PRemoteEncoder::Reply_Construct__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PRemoteEncoder", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PRemoteEncoderChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PRemoteEncoder::Msg_Construct", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PRemoteEncoder::Reply_Init__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PRemoteEncoder", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PRemoteEncoderChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PRemoteEncoder::Msg_Init", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PRemoteEncoder::Reply_Encode__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PRemoteEncoder", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PRemoteEncoderChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PRemoteEncoder::Msg_Encode", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PRemoteEncoder::Reply_Reconfigure__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PRemoteEncoder", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PRemoteEncoderChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PRemoteEncoder::Msg_Reconfigure", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PRemoteEncoder::Reply_Drain__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PRemoteEncoder", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PRemoteEncoderChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PRemoteEncoder::Msg_Drain", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PRemoteEncoder::Reply_Shutdown__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PRemoteEncoder", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PRemoteEncoderChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PRemoteEncoder::Msg_Shutdown", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PRemoteEncoder::Reply_SetBitrate__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PRemoteEncoder", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PRemoteEncoderChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PRemoteEncoder::Msg_SetBitrate", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PRemoteEncoder::Reply___delete____ID:
        {
            return MsgProcessed;
        }
    default:
        return MsgNotKnown;
    }
}

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



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

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

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

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

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

} // namespace IPC
