Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/net/PWebSocketChild.h"
#include "SerializedLoadContext.h"
#include "mozilla/AntiTrackingIPCUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/dom/FetchIPCTypes.h"
#include "mozilla/dom/PropertyBagUtils.h"
#include "mozilla/dom/ReferrerInfoUtils.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/PNeckoChild.h"
#include "mozilla/dom/PBrowserChild.h"
#include "mozilla/net/PTransportProviderChild.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 {
auto PWebSocketChild::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
MOZ_IMPLICIT PWebSocketChild::PWebSocketChild() :
mozilla::ipc::IProtocol(PWebSocketMsgStart, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PWebSocketChild);
}
PWebSocketChild::~PWebSocketChild()
{
MOZ_COUNT_DTOR(PWebSocketChild);
}
auto PWebSocketChild::ActorAlloc() -> void
{
}
auto PWebSocketChild::ActorDealloc() -> void
{
if (Manager()) {
Manager()->DeallocManagee(PWebSocketMsgStart, this);
}
}
auto PWebSocketChild::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PWebSocketChild::Manager() const -> PNeckoChild*
{
return static_cast<PNeckoChild*>(IProtocol::Manager());
}
auto PWebSocketChild::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PWebSocketChild::SendAsyncOpen(
nsIURI* aURI,
const nsACString& aOrigin,
const OriginAttributes& aOriginAttributes,
const uint64_t& aInnerWindowID,
const nsACString& aProtocol,
const bool& aSecure,
const uint32_t& aPingInterval,
const bool& aClientSetPingInterval,
const uint32_t& aPingTimeout,
const bool& aClientSetPingTimeout,
const LoadInfoArgs& aLoadInfoArgs,
const mozilla::Maybe<mozilla::NotNull<PTransportProviderChild*>>& aProvider,
const nsACString& aNegotiatedExtensions) -> bool
{
UniquePtr<IPC::Message> msg__ = PWebSocket::Msg_AsyncOpen(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aURI);
// Sentinel = 'aURI'
((&(writer__)))->WriteSentinel(57934162);
IPC::WriteParam((&(writer__)), aOrigin);
// Sentinel = 'aOrigin'
((&(writer__)))->WriteSentinel(182125258);
IPC::WriteParam((&(writer__)), aOriginAttributes);
// Sentinel = 'aOriginAttributes'
((&(writer__)))->WriteSentinel(1021839089);
IPC::WriteParam((&(writer__)), aInnerWindowID);
// Sentinel = 'aInnerWindowID'
((&(writer__)))->WriteSentinel(687670627);
IPC::WriteParam((&(writer__)), aProtocol);
// Sentinel = 'aProtocol'
((&(writer__)))->WriteSentinel(303891380);
IPC::WriteParam((&(writer__)), aSecure);
// Sentinel = 'aSecure'
((&(writer__)))->WriteSentinel(181207753);
IPC::WriteParam((&(writer__)), aPingInterval);
// Sentinel = 'aPingInterval'
((&(writer__)))->WriteSentinel(595264821);
IPC::WriteParam((&(writer__)), aClientSetPingInterval);
// Sentinel = 'aClientSetPingInterval'
((&(writer__)))->WriteSentinel(1653999808);
IPC::WriteParam((&(writer__)), aPingTimeout);
// Sentinel = 'aPingTimeout'
((&(writer__)))->WriteSentinel(509215959);
IPC::WriteParam((&(writer__)), aClientSetPingTimeout);
// Sentinel = 'aClientSetPingTimeout'
((&(writer__)))->WriteSentinel(1508509794);
IPC::WriteParam((&(writer__)), aLoadInfoArgs);
// Sentinel = 'aLoadInfoArgs'
((&(writer__)))->WriteSentinel(571540731);
IPC::WriteParam((&(writer__)), aProvider);
// Sentinel = 'aProvider'
((&(writer__)))->WriteSentinel(302252973);
IPC::WriteParam((&(writer__)), aNegotiatedExtensions);
// Sentinel = 'aNegotiatedExtensions'
((&(writer__)))->WriteSentinel(1547634838);
if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebSocket::Msg_AsyncOpen", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWebSocketChild::SendClose(
const uint16_t& code,
const nsACString& reason) -> bool
{
UniquePtr<IPC::Message> msg__ = PWebSocket::Msg_Close(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), code);
// Sentinel = 'code'
((&(writer__)))->WriteSentinel(67764636);
IPC::WriteParam((&(writer__)), reason);
// Sentinel = 'reason'
((&(writer__)))->WriteSentinel(148112009);
if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebSocket::Msg_Close", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWebSocketChild::SendSendMsg(const nsACString& aMsg) -> bool
{
UniquePtr<IPC::Message> msg__ = PWebSocket::Msg_SendMsg(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aMsg);
// Sentinel = 'aMsg'
((&(writer__)))->WriteSentinel(62652809);
if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebSocket::Msg_SendMsg", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWebSocketChild::SendSendBinaryMsg(const nsACString& aMsg) -> bool
{
UniquePtr<IPC::Message> msg__ = PWebSocket::Msg_SendBinaryMsg(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aMsg);
// Sentinel = 'aMsg'
((&(writer__)))->WriteSentinel(62652809);
if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebSocket::Msg_SendBinaryMsg", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWebSocketChild::SendSendBinaryStream(
const IPCStream& aStream,
const uint32_t& aLength) -> bool
{
UniquePtr<IPC::Message> msg__ = PWebSocket::Msg_SendBinaryStream(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aStream);
// Sentinel = 'aStream'
((&(writer__)))->WriteSentinel(185205454);
IPC::WriteParam((&(writer__)), aLength);
// Sentinel = 'aLength'
((&(writer__)))->WriteSentinel(179045060);
if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebSocket::Msg_SendBinaryStream", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWebSocketChild::SendDeleteSelf() -> bool
{
UniquePtr<IPC::Message> msg__ = PWebSocket::Msg_DeleteSelf(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebSocket::Msg_DeleteSelf", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWebSocketChild::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PWebSocketChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PWebSocketChild::OnMessageReceived(const Message& msg__) -> PWebSocketChild::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 PWebSocket::Msg_OnStart__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebSocket::Msg_OnStart", OTHER);
IPC::MessageReader reader__{
msg__,
this};
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__aExtensions = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__aExtensions) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& aExtensions = *maybe__aExtensions;
// Sentinel = 'aExtensions'
if ((!(((&(reader__)))->ReadSentinel(446039186)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto maybe__aEffectiveURL = IPC::ReadParam<nsString>((&(reader__)));
if (!maybe__aEffectiveURL) {
FatalError("Error deserializing 'nsString'");
return MsgValueError;
}
auto& aEffectiveURL = *maybe__aEffectiveURL;
// Sentinel = 'aEffectiveURL'
if ((!(((&(reader__)))->ReadSentinel(581698790)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
return MsgValueError;
}
auto maybe__aEncrypted = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__aEncrypted) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& aEncrypted = *maybe__aEncrypted;
// Sentinel = 'aEncrypted'
if ((!(((&(reader__)))->ReadSentinel(364446736)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
auto maybe__aHttpChannelId = IPC::ReadParam<uint64_t>((&(reader__)));
if (!maybe__aHttpChannelId) {
FatalError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto& aHttpChannelId = *maybe__aHttpChannelId;
// Sentinel = 'aHttpChannelId'
if ((!(((&(reader__)))->ReadSentinel(681182568)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WebSocketChannelChild*>(this))->RecvOnStart(std::move(aProtocol), std::move(aExtensions), std::move(aEffectiveURL), std::move(aEncrypted), std::move(aHttpChannelId));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWebSocket::Msg_OnStop__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebSocket::Msg_OnStop", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aStatusCode = IPC::ReadParam<nsresult>((&(reader__)));
if (!maybe__aStatusCode) {
FatalError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto& aStatusCode = *maybe__aStatusCode;
// Sentinel = 'aStatusCode'
if ((!(((&(reader__)))->ReadSentinel(440337505)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WebSocketChannelChild*>(this))->RecvOnStop(std::move(aStatusCode));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWebSocket::Msg_OnMessageAvailable__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebSocket::Msg_OnMessageAvailable", 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;
}
auto maybe__aMoreData = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__aMoreData) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& aMoreData = *maybe__aMoreData;
// Sentinel = 'aMoreData'
if ((!(((&(reader__)))->ReadSentinel(285475695)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WebSocketChannelChild*>(this))->RecvOnMessageAvailable(std::move(aMsg), std::move(aMoreData));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWebSocket::Msg_OnBinaryMessageAvailable__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebSocket::Msg_OnBinaryMessageAvailable", 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;
}
auto maybe__aMoreData = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__aMoreData) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& aMoreData = *maybe__aMoreData;
// Sentinel = 'aMoreData'
if ((!(((&(reader__)))->ReadSentinel(285475695)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WebSocketChannelChild*>(this))->RecvOnBinaryMessageAvailable(std::move(aMsg), std::move(aMoreData));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWebSocket::Msg_OnAcknowledge__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebSocket::Msg_OnAcknowledge", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aSize = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__aSize) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& aSize = *maybe__aSize;
// Sentinel = 'aSize'
if ((!(((&(reader__)))->ReadSentinel(97124861)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WebSocketChannelChild*>(this))->RecvOnAcknowledge(std::move(aSize));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWebSocket::Msg_OnServerClose__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebSocket::Msg_OnServerClose", 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__aReason = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__aReason) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& aReason = *maybe__aReason;
// Sentinel = 'aReason'
if ((!(((&(reader__)))->ReadSentinel(180093642)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WebSocketChannelChild*>(this))->RecvOnServerClose(std::move(code), std::move(aReason));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWebSocket::Msg___delete____ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebSocket", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebSocket::Msg___delete__", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<WebSocketChannelChild*>(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 PWebSocketChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PWebSocketChild::Result
{
return MsgNotKnown;
}
auto PWebSocketChild::DoomSubtree() -> void
{
SetDoomed();
}
auto PWebSocketChild::PeekManagedActor() -> IProtocol*
{
return nullptr;
}
} // namespace net
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::net::PWebSocketChild*>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
MOZ_RELEASE_ASSERT(
aWriter->GetActor(),
"Cannot serialize managed actors without an actor");
int32_t id;
if (!aVar) {
id = 0; // kNullActorId
} else {
id = aVar->Id();
if (id == 1) { // kFreedActorId
aVar->FatalError("Actor has been |delete|d");
}
MOZ_RELEASE_ASSERT(
aWriter->GetActor()->GetIPCChannel() == aVar->GetIPCChannel(),
"Actor must be from the same channel as the"
" actor it's being sent over");
MOZ_RELEASE_ASSERT(
aVar->CanSend(),
"Actor must still be open when sending");
}
IPC::WriteParam(aWriter, id);
}
auto ParamTraits<::mozilla::net::PWebSocketChild*>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
MOZ_RELEASE_ASSERT(
aReader->GetActor(),
"Cannot deserialize managed actors without an actor");
mozilla::Maybe<mozilla::ipc::IProtocol*> actor = aReader->GetActor()
->ReadActor(aReader, true, "PWebSocket", PWebSocketMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::net::PWebSocketChild*>(actor.ref());
}
return {};
}
} // namespace IPC