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


#include "mozilla/dom/PServiceWorkerRegistrationChild.h"
#include "ipc/ErrorIPCUtils.h"
#include "mozilla/GfxMessageUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/RemoteLazyInputStream.h"
#include "mozilla/URLClassifierIPCUtils.h"
#include "mozilla/dom/BindingIPCUtils.h"
#include "mozilla/dom/CSPMessageUtils.h"
#include "mozilla/dom/ClientIPCUtils.h"
#include "mozilla/dom/DocShellMessageUtils.h"
#include "mozilla/dom/DomSecurityIPCUtils.h"
#include "mozilla/dom/NavigationAPIIPCUtils.h"
#include "mozilla/dom/PermissionMessageUtils.h"
#include "mozilla/dom/PolicyContainerMessageUtils.h"
#include "mozilla/dom/PropertyBagUtils.h"
#include "mozilla/dom/ReferrerInfoUtils.h"
#include "mozilla/dom/RemoteType.h"
#include "mozilla/dom/ServiceWorkerIPCUtils.h"
#include "mozilla/dom/SessionHistoryEntry.h"
#include "mozilla/dom/TabMessageUtils.h"
#include "mozilla/dom/WorkerIPCUtils.h"
#include "mozilla/dom/ipc/StructuredCloneData.h"
#include "mozilla/dom/notification/IPCUtils.h"
#include "mozilla/ipc/BigBuffer.h"
#include "mozilla/ipc/IPCCore.h"
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/URIUtils.h"
#include "mozilla/layers/LayersMessageUtils.h"
#include "mozilla/net/NeckoMessageUtils.h"
#include "nsIPolicyContainer.h"
#include "nsIPrincipal.h"
#include "nsIReferrerInfo.h"
#include "nsIURI.h"
#include "nsIVariant.h"
#include "nsStructuredCloneContainer.h"

#include "mozilla/ipc/PBackgroundChild.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 dom {


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

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

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

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

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

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

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

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

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

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

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

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

auto PServiceWorkerRegistrationChild::SendUnregister(
        mozilla::ipc::ResolveCallback<std::tuple<bool, CopyableErrorResult>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PServiceWorkerRegistration::Msg_Unregister(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};



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

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

            }
            auto& aSuccess = *maybe__aSuccess;
            // Sentinel = 'aSuccess'
            if ((!((aReader)->ReadSentinel(236323643)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }
            auto maybe__aRv = IPC::ReadParam<CopyableErrorResult>(aReader);
            if (!maybe__aRv) {
                (aReader)->FatalError("Error deserializing 'CopyableErrorResult'");
                return MsgValueError;

            }
            auto& aRv = *maybe__aRv;
            // Sentinel = 'aRv'
            if ((!((aReader)->ReadSentinel(37749034)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'CopyableErrorResult'");
                return MsgValueError;
            }


            aReader->EndRead();

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

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

auto PServiceWorkerRegistrationChild::SendUpdate(
        const nsACString& aNewestWorkerScriptUrl,
        mozilla::ipc::ResolveCallback<IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PServiceWorkerRegistration::Msg_Update(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

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


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

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

            }
            auto& aResult = *maybe__aResult;
            // Sentinel = 'aResult'
            if ((!((aReader)->ReadSentinel(185205473)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult'");
                return MsgValueError;
            }


            aReader->EndRead();

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

auto PServiceWorkerRegistrationChild::SendUpdate(const nsACString& aNewestWorkerScriptUrl) -> RefPtr<UpdatePromise>
{
    RefPtr<MozPromise<IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendUpdate(std::forward<const nsACString&>(aNewestWorkerScriptUrl), [promise__](IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PServiceWorkerRegistrationChild::SendGetNotifications(
        const nsAString& aTag,
        mozilla::ipc::ResolveCallback<IPCNotificationsOrError>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PServiceWorkerRegistration::Msg_GetNotifications(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

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


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

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

            }
            auto& aResult = *maybe__aResult;
            // Sentinel = 'aResult'
            if ((!((aReader)->ReadSentinel(185205473)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'IPCNotificationsOrError'");
                return MsgValueError;
            }


            aReader->EndRead();

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

auto PServiceWorkerRegistrationChild::SendGetNotifications(const nsAString& aTag) -> RefPtr<GetNotificationsPromise>
{
    RefPtr<MozPromise<IPCNotificationsOrError, ResponseRejectReason, true>::Private> promise__ = new MozPromise<IPCNotificationsOrError, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendGetNotifications(std::forward<const nsAString&>(aTag), [promise__](IPCNotificationsOrError&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PServiceWorkerRegistrationChild::SendSetNavigationPreloadEnabled(
        const bool& aEnabled,
        mozilla::ipc::ResolveCallback<bool>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PServiceWorkerRegistration::Msg_SetNavigationPreloadEnabled(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

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


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

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

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


            aReader->EndRead();

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

auto PServiceWorkerRegistrationChild::SendSetNavigationPreloadEnabled(const bool& aEnabled) -> RefPtr<SetNavigationPreloadEnabledPromise>
{
    RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendSetNavigationPreloadEnabled(std::forward<const bool&>(aEnabled), [promise__](bool&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PServiceWorkerRegistrationChild::SendSetNavigationPreloadHeader(
        const nsACString& aHeader,
        mozilla::ipc::ResolveCallback<bool>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PServiceWorkerRegistration::Msg_SetNavigationPreloadHeader(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

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


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

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

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


            aReader->EndRead();

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

auto PServiceWorkerRegistrationChild::SendSetNavigationPreloadHeader(const nsACString& aHeader) -> RefPtr<SetNavigationPreloadHeaderPromise>
{
    RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendSetNavigationPreloadHeader(std::forward<const nsACString&>(aHeader), [promise__](bool&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

auto PServiceWorkerRegistrationChild::SendGetNavigationPreloadState(
        mozilla::ipc::ResolveCallback<mozilla::Maybe<IPCNavigationPreloadState>>&& aResolve,
        mozilla::ipc::RejectCallback&& aReject) -> void
{
    UniquePtr<IPC::Message> msg__ = PServiceWorkerRegistration::Msg_GetNavigationPreloadState(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};



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

    IPC::Message::seqno_t seqno__ = 0;
    if (ChannelSend(std::move(msg__), (&(seqno__)))) {
        mAsyncCallbacks.AddCallback(seqno__, PServiceWorkerRegistration::Reply_GetNavigationPreloadState__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable {
            auto maybe__aState = IPC::ReadParam<mozilla::Maybe<IPCNavigationPreloadState>>(aReader);
            if (!maybe__aState) {
                (aReader)->FatalError("Error deserializing 'IPCNavigationPreloadState?'");
                return MsgValueError;

            }
            auto& aState = *maybe__aState;
            // Sentinel = 'aState'
            if ((!((aReader)->ReadSentinel(137036387)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'IPCNavigationPreloadState?'");
                return MsgValueError;
            }


            aReader->EndRead();

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

auto PServiceWorkerRegistrationChild::SendGetNavigationPreloadState() -> RefPtr<GetNavigationPreloadStatePromise>
{
    RefPtr<MozPromise<mozilla::Maybe<IPCNavigationPreloadState>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<IPCNavigationPreloadState>, ResponseRejectReason, true>::Private(__func__);
    promise__->UseDirectTaskDispatch(__func__);
    SendGetNavigationPreloadState([promise__](mozilla::Maybe<IPCNavigationPreloadState>&& aValue) {
        promise__->Resolve(std::move(aValue), __func__);
    }, [promise__](ResponseRejectReason&& aReason) {
        promise__->Reject(std::move(aReason), __func__);
    });
    return promise__;
}

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


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

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

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

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

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

    }
    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 PServiceWorkerRegistration::Reply_Unregister__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PServiceWorkerRegistrationChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }

            AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_Unregister", OTHER);


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

            AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_Update", OTHER);


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

            AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_GetNotifications", OTHER);


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

            AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_SetNavigationPreloadEnabled", OTHER);


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

            AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_SetNavigationPreloadHeader", OTHER);


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

            AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_GetNavigationPreloadState", OTHER);


            return mAsyncCallbacks.GotReply(this, msg__);
        }
    case PServiceWorkerRegistration::Msg_UpdateState__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PServiceWorkerRegistrationChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_UpdateState", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aDescriptor = *maybe__aDescriptor;
            // Sentinel = 'aDescriptor'
            if ((!(((&(reader__)))->ReadSentinel(433915009)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'IPCServiceWorkerRegistrationDescriptor'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (this)->RecvUpdateState(std::move(aDescriptor));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PServiceWorkerRegistration::Msg_FireUpdateFound__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ChildSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PServiceWorkerRegistrationChild",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_FireUpdateFound", OTHER);

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

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

            DoomSubtree();
            mozilla::ipc::IPCResult __ok = (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 PServiceWorkerRegistrationChild::OnMessageReceived(
        const Message& msg__,
        UniquePtr<Message>& reply__) -> PServiceWorkerRegistrationChild::Result
{
    if (!CanSend()) {
        return MsgDropped;

    }
    return MsgNotKnown;
}



} // namespace dom
} // namespace mozilla
