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


#include "mozilla/extensions/PExtensionsParent.h"
#include "mozilla/GfxMessageUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/RemoteLazyInputStream.h"
#include "mozilla/URLClassifierIPCUtils.h"
#include "mozilla/dom/CSPMessageUtils.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/SessionHistoryEntry.h"
#include "mozilla/dom/TabMessageUtils.h"
#include "mozilla/dom/notification/IPCUtils.h"
#include "mozilla/extensions/ExtensionsParent.h"
#include "mozilla/ipc/BigBuffer.h"
#include "mozilla/ipc/IPCCore.h"
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/SerializedStructuredCloneBuffer.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 "mozilla/dom/PContentParent.h"
#include "mozilla/dom/PInProcessParent.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 extensions {


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

MOZ_IMPLICIT PExtensionsParent::PExtensionsParent() :
    mozilla::ipc::IRefCountedProtocol(kProtocolId, mozilla::ipc::ParentSide)
{
    MOZ_COUNT_CTOR(PExtensionsParent);
}

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

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

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

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

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

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

auto PExtensionsParent::OnMessageReceived(const Message& msg__) -> PExtensionsParent::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 PExtensions::Msg___delete____ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PExtensions", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PExtensionsParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PExtensions::Msg___delete__", OTHER);

            mozilla::ipc::IPCResult __ok = (static_cast<ExtensionsParent*>(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;
        }
    case PExtensions::Msg_DocumentChange__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PExtensions", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PExtensionsParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PExtensions::Msg_DocumentChange", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& bc = *maybe__bc;
            // Sentinel = 'bc'
            if ((!(((&(reader__)))->ReadSentinel(19464390)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'MaybeDiscardedBrowsingContext'");
                return MsgValueError;
            }
            auto maybe__transitionData = IPC::ReadParam<FrameTransitionData>((&(reader__)));
            if (!maybe__transitionData) {
                FatalError("Error deserializing 'FrameTransitionData'");
                return MsgValueError;

            }
            auto& transitionData = *maybe__transitionData;
            // Sentinel = 'transitionData'
            if ((!(((&(reader__)))->ReadSentinel(744490438)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'FrameTransitionData'");
                return MsgValueError;
            }
            auto maybe__location = IPC::ReadParam<RefPtr<nsIURI>>((&(reader__)));
            if (!maybe__location) {
                FatalError("Error deserializing 'nsIURI'");
                return MsgValueError;

            }
            auto& location = *maybe__location;
            // Sentinel = 'location'
            if ((!(((&(reader__)))->ReadSentinel(251593562)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'nsIURI'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<ExtensionsParent*>(this))->RecvDocumentChange(std::move(bc), std::move(transitionData), location);
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PExtensions::Msg_HistoryChange__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PExtensions", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PExtensionsParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PExtensions::Msg_HistoryChange", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& bc = *maybe__bc;
            // Sentinel = 'bc'
            if ((!(((&(reader__)))->ReadSentinel(19464390)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'MaybeDiscardedBrowsingContext'");
                return MsgValueError;
            }
            auto maybe__transitionData = IPC::ReadParam<FrameTransitionData>((&(reader__)));
            if (!maybe__transitionData) {
                FatalError("Error deserializing 'FrameTransitionData'");
                return MsgValueError;

            }
            auto& transitionData = *maybe__transitionData;
            // Sentinel = 'transitionData'
            if ((!(((&(reader__)))->ReadSentinel(744490438)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'FrameTransitionData'");
                return MsgValueError;
            }
            auto maybe__location = IPC::ReadParam<RefPtr<nsIURI>>((&(reader__)));
            if (!maybe__location) {
                FatalError("Error deserializing 'nsIURI'");
                return MsgValueError;

            }
            auto& location = *maybe__location;
            // Sentinel = 'location'
            if ((!(((&(reader__)))->ReadSentinel(251593562)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'nsIURI'");
                return MsgValueError;
            }
            auto maybe__isHistoryStateUpdated = IPC::ReadParam<bool>((&(reader__)));
            if (!maybe__isHistoryStateUpdated) {
                FatalError("Error deserializing 'bool'");
                return MsgValueError;

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

            }
            auto& isReferenceFragmentUpdated = *maybe__isReferenceFragmentUpdated;
            // Sentinel = 'isReferenceFragmentUpdated'
            if ((!(((&(reader__)))->ReadSentinel(2348812903)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<ExtensionsParent*>(this))->RecvHistoryChange(std::move(bc), std::move(transitionData), location, std::move(isHistoryStateUpdated), std::move(isReferenceFragmentUpdated));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PExtensions::Msg_StateChange__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PExtensions", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PExtensionsParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PExtensions::Msg_StateChange", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& bc = *maybe__bc;
            // Sentinel = 'bc'
            if ((!(((&(reader__)))->ReadSentinel(19464390)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'MaybeDiscardedBrowsingContext'");
                return MsgValueError;
            }
            auto maybe__requestURI = IPC::ReadParam<RefPtr<nsIURI>>((&(reader__)));
            if (!maybe__requestURI) {
                FatalError("Error deserializing 'nsIURI'");
                return MsgValueError;

            }
            auto& requestURI = *maybe__requestURI;
            // Sentinel = 'requestURI'
            if ((!(((&(reader__)))->ReadSentinel(387908602)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'nsIURI'");
                return MsgValueError;
            }
            auto maybe__status = IPC::ReadParam<nsresult>((&(reader__)));
            if (!maybe__status) {
                FatalError("Error deserializing 'nsresult'");
                return MsgValueError;

            }
            auto& status = *maybe__status;
            // Sentinel = 'status'
            if ((!(((&(reader__)))->ReadSentinel(154731173)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
                return MsgValueError;
            }
            auto maybe__stateFlags = IPC::ReadParam<uint32_t>((&(reader__)));
            if (!maybe__stateFlags) {
                FatalError("Error deserializing 'uint32_t'");
                return MsgValueError;

            }
            auto& stateFlags = *maybe__stateFlags;
            // Sentinel = 'stateFlags'
            if ((!(((&(reader__)))->ReadSentinel(379585551)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<ExtensionsParent*>(this))->RecvStateChange(std::move(bc), requestURI, std::move(status), std::move(stateFlags));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PExtensions::Msg_CreatedNavigationTarget__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PExtensions", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PExtensionsParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PExtensions::Msg_CreatedNavigationTarget", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& bc = *maybe__bc;
            // Sentinel = 'bc'
            if ((!(((&(reader__)))->ReadSentinel(19464390)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'MaybeDiscardedBrowsingContext'");
                return MsgValueError;
            }
            auto maybe__sourceBC = IPC::ReadParam<MaybeDiscardedBrowsingContext>((&(reader__)));
            if (!maybe__sourceBC) {
                FatalError("Error deserializing 'MaybeDiscardedBrowsingContext'");
                return MsgValueError;

            }
            auto& sourceBC = *maybe__sourceBC;
            // Sentinel = 'sourceBC'
            if ((!(((&(reader__)))->ReadSentinel(253952791)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'MaybeDiscardedBrowsingContext'");
                return MsgValueError;
            }
            auto maybe__url = IPC::ReadParam<nsCString>((&(reader__)));
            if (!maybe__url) {
                FatalError("Error deserializing 'nsCString'");
                return MsgValueError;

            }
            auto& url = *maybe__url;
            // Sentinel = 'url'
            if ((!(((&(reader__)))->ReadSentinel(45220180)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<ExtensionsParent*>(this))->RecvCreatedNavigationTarget(std::move(bc), std::move(sourceBC), std::move(url));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PExtensions::Msg_DOMContentLoaded__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PExtensions", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PExtensionsParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PExtensions::Msg_DOMContentLoaded", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& bc = *maybe__bc;
            // Sentinel = 'bc'
            if ((!(((&(reader__)))->ReadSentinel(19464390)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'MaybeDiscardedBrowsingContext'");
                return MsgValueError;
            }
            auto maybe__documentURI = IPC::ReadParam<RefPtr<nsIURI>>((&(reader__)));
            if (!maybe__documentURI) {
                FatalError("Error deserializing 'nsIURI'");
                return MsgValueError;

            }
            auto& documentURI = *maybe__documentURI;
            // Sentinel = 'documentURI'
            if ((!(((&(reader__)))->ReadSentinel(453706832)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'nsIURI'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<ExtensionsParent*>(this))->RecvDOMContentLoaded(std::move(bc), documentURI);
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    default:
        return MsgNotKnown;
    }
}

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



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

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

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

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

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

} // namespace IPC
