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


#include "mozilla/net/PWebSocketParent.h"
#include "SerializedLoadContext.h"
#include "mozilla/AntiTrackingIPCUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/dom/ConsoleReportIPCUtils.h"
#include "mozilla/dom/DomSecurityIPCUtils.h"
#include "mozilla/dom/FetchIPCTypes.h"
#include "mozilla/dom/NavigationAPIIPCUtils.h"
#include "mozilla/dom/PermissionsPolicyUtils.h"
#include "mozilla/dom/PropertyBagUtils.h"
#include "mozilla/dom/ReferrerInfoUtils.h"
#include "mozilla/dom/RemoteType.h"
#include "mozilla/dom/SessionHistoryEntry.h"
#include "mozilla/ipc/URIUtils.h"
#include "mozilla/net/CacheInfoIPCTypes.h"
#include "mozilla/net/ClassOfService.h"
#include "mozilla/net/WebSocketChannelChild.h"
#include "mozilla/net/WebSocketChannelParent.h"
#include "nsDOMNavigationTiming.h"
#include "nsDocShellLoadState.h"
#include "nsHttp.h"
#include "nsHttpResponseHead.h"
#include "nsIPropertyBag2.h"

#include "mozilla/net/PNeckoParent.h"
#include "mozilla/dom/PBrowserParent.h"
#include "mozilla/net/PTransportProviderParent.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 net {


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

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

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

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

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

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

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

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

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

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

auto PWebSocketParent::SendOnStart(
        const nsACString& aProtocol,
        const nsACString& aExtensions,
        const nsAString& aEffectiveURL,
        const bool& aEncrypted,
        const uint64_t& aHttpChannelId) -> bool
{
    UniquePtr<IPC::Message> msg__ = PWebSocket::Msg_OnStart(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), aProtocol);
    // Sentinel = 'aProtocol'
    ((&(writer__)))->WriteSentinel(303891380);
    IPC::WriteParam((&(writer__)), aExtensions);
    // Sentinel = 'aExtensions'
    ((&(writer__)))->WriteSentinel(446039186);
    IPC::WriteParam((&(writer__)), aEffectiveURL);
    // Sentinel = 'aEffectiveURL'
    ((&(writer__)))->WriteSentinel(581698790);
    IPC::WriteParam((&(writer__)), aEncrypted);
    // Sentinel = 'aEncrypted'
    ((&(writer__)))->WriteSentinel(364446736);
    IPC::WriteParam((&(writer__)), aHttpChannelId);
    // Sentinel = 'aHttpChannelId'
    ((&(writer__)))->WriteSentinel(681182568);


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

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

auto PWebSocketParent::SendOnStop(const nsresult& aStatusCode) -> bool
{
    UniquePtr<IPC::Message> msg__ = PWebSocket::Msg_OnStop(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

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


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

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

auto PWebSocketParent::SendOnMessageAvailable(
        const nsACString& aMsg,
        const bool& aMoreData) -> bool
{
    UniquePtr<IPC::Message> msg__ = PWebSocket::Msg_OnMessageAvailable(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), aMsg);
    // Sentinel = 'aMsg'
    ((&(writer__)))->WriteSentinel(62652809);
    IPC::WriteParam((&(writer__)), aMoreData);
    // Sentinel = 'aMoreData'
    ((&(writer__)))->WriteSentinel(285475695);


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

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

auto PWebSocketParent::SendOnBinaryMessageAvailable(
        const nsACString& aMsg,
        const bool& aMoreData) -> bool
{
    UniquePtr<IPC::Message> msg__ = PWebSocket::Msg_OnBinaryMessageAvailable(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), aMsg);
    // Sentinel = 'aMsg'
    ((&(writer__)))->WriteSentinel(62652809);
    IPC::WriteParam((&(writer__)), aMoreData);
    // Sentinel = 'aMoreData'
    ((&(writer__)))->WriteSentinel(285475695);


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

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

auto PWebSocketParent::SendOnAcknowledge(const uint32_t& aSize) -> bool
{
    UniquePtr<IPC::Message> msg__ = PWebSocket::Msg_OnAcknowledge(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

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


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

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

auto PWebSocketParent::SendOnServerClose(
        const uint16_t& code,
        const nsACString& aReason) -> bool
{
    UniquePtr<IPC::Message> msg__ = PWebSocket::Msg_OnServerClose(Id());
    IPC::MessageWriter writer__{
            (*(msg__)),
            this};

    IPC::WriteParam((&(writer__)), code);
    // Sentinel = 'code'
    ((&(writer__)))->WriteSentinel(67764636);
    IPC::WriteParam((&(writer__)), aReason);
    // Sentinel = 'aReason'
    ((&(writer__)))->WriteSentinel(180093642);


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

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

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


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

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

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

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

auto PWebSocketParent::OnMessageReceived(const Message& msg__) -> PWebSocketParent::Result
{
    if (!CanSend()) {
        if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ParentSide)) {
            mozilla::ipc::LogMessageForProtocol(
                "PWebSocketParent",
                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 PWebSocket::Msg_AsyncOpen__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PWebSocketParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PWebSocket::Msg_AsyncOpen", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aURI = *maybe__aURI;
            // Sentinel = 'aURI'
            if ((!(((&(reader__)))->ReadSentinel(57934162)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'nsIURI'");
                return MsgValueError;
            }
            auto maybe__aInnerWindowID = IPC::ReadParam<uint64_t>((&(reader__)));
            if (!maybe__aInnerWindowID) {
                FatalError("Error deserializing 'uint64_t'");
                return MsgValueError;

            }
            auto& aInnerWindowID = *maybe__aInnerWindowID;
            // Sentinel = 'aInnerWindowID'
            if ((!(((&(reader__)))->ReadSentinel(687670627)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
                return MsgValueError;
            }
            auto maybe__aProtocol = IPC::ReadParam<nsCString>((&(reader__)));
            if (!maybe__aProtocol) {
                FatalError("Error deserializing 'nsCString'");
                return MsgValueError;

            }
            auto& aProtocol = *maybe__aProtocol;
            // Sentinel = 'aProtocol'
            if ((!(((&(reader__)))->ReadSentinel(303891380)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
                return MsgValueError;
            }
            auto maybe__aSecure = IPC::ReadParam<bool>((&(reader__)));
            if (!maybe__aSecure) {
                FatalError("Error deserializing 'bool'");
                return MsgValueError;

            }
            auto& aSecure = *maybe__aSecure;
            // Sentinel = 'aSecure'
            if ((!(((&(reader__)))->ReadSentinel(181207753)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }
            auto maybe__aPingInterval = IPC::ReadParam<uint32_t>((&(reader__)));
            if (!maybe__aPingInterval) {
                FatalError("Error deserializing 'uint32_t'");
                return MsgValueError;

            }
            auto& aPingInterval = *maybe__aPingInterval;
            // Sentinel = 'aPingInterval'
            if ((!(((&(reader__)))->ReadSentinel(595264821)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
                return MsgValueError;
            }
            auto maybe__aClientSetPingInterval = IPC::ReadParam<bool>((&(reader__)));
            if (!maybe__aClientSetPingInterval) {
                FatalError("Error deserializing 'bool'");
                return MsgValueError;

            }
            auto& aClientSetPingInterval = *maybe__aClientSetPingInterval;
            // Sentinel = 'aClientSetPingInterval'
            if ((!(((&(reader__)))->ReadSentinel(1653999808)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }
            auto maybe__aPingTimeout = IPC::ReadParam<uint32_t>((&(reader__)));
            if (!maybe__aPingTimeout) {
                FatalError("Error deserializing 'uint32_t'");
                return MsgValueError;

            }
            auto& aPingTimeout = *maybe__aPingTimeout;
            // Sentinel = 'aPingTimeout'
            if ((!(((&(reader__)))->ReadSentinel(509215959)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
                return MsgValueError;
            }
            auto maybe__aClientSetPingTimeout = IPC::ReadParam<bool>((&(reader__)));
            if (!maybe__aClientSetPingTimeout) {
                FatalError("Error deserializing 'bool'");
                return MsgValueError;

            }
            auto& aClientSetPingTimeout = *maybe__aClientSetPingTimeout;
            // Sentinel = 'aClientSetPingTimeout'
            if ((!(((&(reader__)))->ReadSentinel(1508509794)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
                return MsgValueError;
            }
            auto maybe__aLoadInfoArgs = IPC::ReadParam<LoadInfoArgs>((&(reader__)));
            if (!maybe__aLoadInfoArgs) {
                FatalError("Error deserializing 'LoadInfoArgs'");
                return MsgValueError;

            }
            auto& aLoadInfoArgs = *maybe__aLoadInfoArgs;
            // Sentinel = 'aLoadInfoArgs'
            if ((!(((&(reader__)))->ReadSentinel(571540731)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'LoadInfoArgs'");
                return MsgValueError;
            }
            auto maybe__aProvider = IPC::ReadParam<mozilla::Maybe<mozilla::NotNull<PTransportProviderParent*>>>((&(reader__)));
            if (!maybe__aProvider) {
                FatalError("Error deserializing 'NotNull<PTransportProvider>?'");
                return MsgValueError;

            }
            auto& aProvider = *maybe__aProvider;
            // Sentinel = 'aProvider'
            if ((!(((&(reader__)))->ReadSentinel(302252973)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'NotNull<PTransportProvider>?'");
                return MsgValueError;
            }
            auto maybe__aNegotiatedExtensions = IPC::ReadParam<nsCString>((&(reader__)));
            if (!maybe__aNegotiatedExtensions) {
                FatalError("Error deserializing 'nsCString'");
                return MsgValueError;

            }
            auto& aNegotiatedExtensions = *maybe__aNegotiatedExtensions;
            // Sentinel = 'aNegotiatedExtensions'
            if ((!(((&(reader__)))->ReadSentinel(1547634838)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::net::WebSocketChannelParent*>(this))->RecvAsyncOpen(aURI, std::move(aInnerWindowID), std::move(aProtocol), std::move(aSecure), std::move(aPingInterval), std::move(aClientSetPingInterval), std::move(aPingTimeout), std::move(aClientSetPingTimeout), std::move(aLoadInfoArgs), std::move(aProvider), std::move(aNegotiatedExtensions));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PWebSocket::Msg_Close__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PWebSocketParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PWebSocket::Msg_Close", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& code = *maybe__code;
            // Sentinel = 'code'
            if ((!(((&(reader__)))->ReadSentinel(67764636)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint16_t'");
                return MsgValueError;
            }
            auto maybe__reason = IPC::ReadParam<nsCString>((&(reader__)));
            if (!maybe__reason) {
                FatalError("Error deserializing 'nsCString'");
                return MsgValueError;

            }
            auto& reason = *maybe__reason;
            // Sentinel = 'reason'
            if ((!(((&(reader__)))->ReadSentinel(148112009)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::net::WebSocketChannelParent*>(this))->RecvClose(std::move(code), std::move(reason));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PWebSocket::Msg_SendMsg__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PWebSocketParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PWebSocket::Msg_SendMsg", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aMsg = *maybe__aMsg;
            // Sentinel = 'aMsg'
            if ((!(((&(reader__)))->ReadSentinel(62652809)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::net::WebSocketChannelParent*>(this))->RecvSendMsg(std::move(aMsg));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PWebSocket::Msg_SendBinaryMsg__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PWebSocketParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PWebSocket::Msg_SendBinaryMsg", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aMsg = *maybe__aMsg;
            // Sentinel = 'aMsg'
            if ((!(((&(reader__)))->ReadSentinel(62652809)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::net::WebSocketChannelParent*>(this))->RecvSendBinaryMsg(std::move(aMsg));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PWebSocket::Msg_SendBinaryStream__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PWebSocketParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PWebSocket::Msg_SendBinaryStream", OTHER);

            IPC::MessageReader reader__{
                    msg__,
                    this};

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

            }
            auto& aStream = *maybe__aStream;
            // Sentinel = 'aStream'
            if ((!(((&(reader__)))->ReadSentinel(185205454)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'IPCStream'");
                return MsgValueError;
            }
            auto maybe__aLength = IPC::ReadParam<uint32_t>((&(reader__)));
            if (!maybe__aLength) {
                FatalError("Error deserializing 'uint32_t'");
                return MsgValueError;

            }
            auto& aLength = *maybe__aLength;
            // Sentinel = 'aLength'
            if ((!(((&(reader__)))->ReadSentinel(179045060)))) {
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
                return MsgValueError;
            }
            reader__.EndRead();
            mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::net::WebSocketChannelParent*>(this))->RecvSendBinaryStream(std::move(aStream), std::move(aLength));
            if ((!(__ok))) {
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
                // Error handled in mozilla::ipc::IPCResult
                return MsgProcessingError;
            }

            return MsgProcessed;
        }
    case PWebSocket::Msg_DeleteSelf__ID:
        {
            if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ParentSide)) {
                mozilla::ipc::LogMessageForProtocol(
                    "PWebSocketParent",
                    this->ToplevelProtocol()->OtherPidMaybeInvalid(),
                    "Received ",
                    (&(msg__))->type(),
                    mozilla::ipc::MessageDirection::eReceiving);
            }
            AUTO_PROFILER_LABEL("PWebSocket::Msg_DeleteSelf", OTHER);

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

            return MsgProcessed;
        }
    case PWebSocket::Reply___delete____ID:
        {
            return MsgProcessed;
        }
    default:
        return MsgNotKnown;
    }
}

auto PWebSocketParent::OnMessageReceived(
        const Message& msg__,
        UniquePtr<Message>& reply__) -> PWebSocketParent::Result
{
    if (!CanSend()) {
        return MsgDropped;

    }
    return MsgNotKnown;
}



} // namespace net
} // namespace mozilla
