Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/net/PWebSocketEventListenerChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/net/WebSocketEventListenerChild.h"
#include "mozilla/net/WebSocketFrame.h"
#include "mozilla/net/PNeckoChild.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 PWebSocketEventListenerChild::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
MOZ_IMPLICIT PWebSocketEventListenerChild::PWebSocketEventListenerChild() :
mozilla::ipc::IProtocol(PWebSocketEventListenerMsgStart, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PWebSocketEventListenerChild);
}
PWebSocketEventListenerChild::~PWebSocketEventListenerChild()
{
MOZ_COUNT_DTOR(PWebSocketEventListenerChild);
}
auto PWebSocketEventListenerChild::ActorAlloc() -> void
{
}
auto PWebSocketEventListenerChild::ActorDealloc() -> void
{
if (Manager()) {
Manager()->DeallocManagee(PWebSocketEventListenerMsgStart, this);
}
}
auto PWebSocketEventListenerChild::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PWebSocketEventListenerChild::Manager() const -> PNeckoChild*
{
return static_cast<PNeckoChild*>(IProtocol::Manager());
}
auto PWebSocketEventListenerChild::AllManagedActors(nsTArray<RefPtr<mozilla::ipc::ActorLifecycleProxy>>& arr__) const -> void
{
uint32_t total = 0;
arr__.SetCapacity(total);
}
auto PWebSocketEventListenerChild::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PWebSocketEventListenerChild::SendClose() -> bool
{
UniquePtr<IPC::Message> msg__ = PWebSocketEventListener::Msg_Close(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PWebSocketEventListener", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketEventListenerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebSocketEventListener::Msg_Close", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWebSocketEventListenerChild::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PWebSocketEventListenerChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PWebSocketEventListenerChild::OnMessageReceived(const Message& msg__) -> PWebSocketEventListenerChild::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;
IProtocol* mgr = this->Manager();
this->DestroySubtree(ManagedEndpointDropped);
this->ClearSubtree();
mgr->RemoveManagee(PWebSocketEventListenerMsgStart, this);
return MsgProcessed;
}
case PWebSocketEventListener::Msg_WebSocketCreated__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebSocketEventListener", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketEventListenerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebSocketEventListener::Msg_WebSocketCreated", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__awebSocketSerialID = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__awebSocketSerialID) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& awebSocketSerialID = *maybe__awebSocketSerialID;
// Sentinel = 'awebSocketSerialID'
if ((!(((&(reader__)))->ReadSentinel(1140524790)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto maybe__aURI = IPC::ReadParam<nsString>((&(reader__)));
if (!maybe__aURI) {
FatalError("Error deserializing 'nsString'");
return MsgValueError;
}
auto& aURI = *maybe__aURI;
// Sentinel = 'aURI'
if ((!(((&(reader__)))->ReadSentinel(57934162)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
return MsgValueError;
}
auto maybe__aProtocols = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__aProtocols) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& aProtocols = *maybe__aProtocols;
// Sentinel = 'aProtocols'
if ((!(((&(reader__)))->ReadSentinel(373556263)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WebSocketEventListenerChild*>(this))->RecvWebSocketCreated(std::move(awebSocketSerialID), std::move(aURI), std::move(aProtocols));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWebSocketEventListener::Msg_WebSocketOpened__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebSocketEventListener", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketEventListenerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebSocketEventListener::Msg_WebSocketOpened", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__awebSocketSerialID = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__awebSocketSerialID) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& awebSocketSerialID = *maybe__awebSocketSerialID;
// Sentinel = 'awebSocketSerialID'
if ((!(((&(reader__)))->ReadSentinel(1140524790)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto maybe__aEffectiveURI = IPC::ReadParam<nsString>((&(reader__)));
if (!maybe__aEffectiveURI) {
FatalError("Error deserializing 'nsString'");
return MsgValueError;
}
auto& aEffectiveURI = *maybe__aEffectiveURI;
// Sentinel = 'aEffectiveURI'
if ((!(((&(reader__)))->ReadSentinel(581502179)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
return MsgValueError;
}
auto maybe__aProtocols = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__aProtocols) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& aProtocols = *maybe__aProtocols;
// Sentinel = 'aProtocols'
if ((!(((&(reader__)))->ReadSentinel(373556263)))) {
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__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<WebSocketEventListenerChild*>(this))->RecvWebSocketOpened(std::move(awebSocketSerialID), std::move(aEffectiveURI), std::move(aProtocols), std::move(aExtensions), std::move(aHttpChannelId));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWebSocketEventListener::Msg_WebSocketMessageAvailable__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebSocketEventListener", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketEventListenerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebSocketEventListener::Msg_WebSocketMessageAvailable", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__awebSocketSerialID = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__awebSocketSerialID) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& awebSocketSerialID = *maybe__awebSocketSerialID;
// Sentinel = 'awebSocketSerialID'
if ((!(((&(reader__)))->ReadSentinel(1140524790)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto maybe__aData = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__aData) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& aData = *maybe__aData;
// Sentinel = 'aData'
if ((!(((&(reader__)))->ReadSentinel(90571228)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto maybe__aMessageType = IPC::ReadParam<uint16_t>((&(reader__)));
if (!maybe__aMessageType) {
FatalError("Error deserializing 'uint16_t'");
return MsgValueError;
}
auto& aMessageType = *maybe__aMessageType;
// Sentinel = 'aMessageType'
if ((!(((&(reader__)))->ReadSentinel(512099529)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint16_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WebSocketEventListenerChild*>(this))->RecvWebSocketMessageAvailable(std::move(awebSocketSerialID), std::move(aData), std::move(aMessageType));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWebSocketEventListener::Msg_WebSocketClosed__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebSocketEventListener", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketEventListenerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebSocketEventListener::Msg_WebSocketClosed", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__awebSocketSerialID = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__awebSocketSerialID) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& awebSocketSerialID = *maybe__awebSocketSerialID;
// Sentinel = 'awebSocketSerialID'
if ((!(((&(reader__)))->ReadSentinel(1140524790)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto maybe__aWasClean = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__aWasClean) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& aWasClean = *maybe__aWasClean;
// Sentinel = 'aWasClean'
if ((!(((&(reader__)))->ReadSentinel(283181936)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
auto maybe__aCode = IPC::ReadParam<uint16_t>((&(reader__)));
if (!maybe__aCode) {
FatalError("Error deserializing 'uint16_t'");
return MsgValueError;
}
auto& aCode = *maybe__aCode;
// Sentinel = 'aCode'
if ((!(((&(reader__)))->ReadSentinel(91226589)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint16_t'");
return MsgValueError;
}
auto maybe__aReason = IPC::ReadParam<nsString>((&(reader__)));
if (!maybe__aReason) {
FatalError("Error deserializing 'nsString'");
return MsgValueError;
}
auto& aReason = *maybe__aReason;
// Sentinel = 'aReason'
if ((!(((&(reader__)))->ReadSentinel(180093642)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WebSocketEventListenerChild*>(this))->RecvWebSocketClosed(std::move(awebSocketSerialID), std::move(aWasClean), std::move(aCode), std::move(aReason));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWebSocketEventListener::Msg_FrameReceived__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebSocketEventListener", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketEventListenerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebSocketEventListener::Msg_FrameReceived", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aWebSocketSerialID = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__aWebSocketSerialID) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& aWebSocketSerialID = *maybe__aWebSocketSerialID;
// Sentinel = 'aWebSocketSerialID'
if ((!(((&(reader__)))->ReadSentinel(1104873174)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto maybe__aFrameData = IPC::ReadParam<WebSocketFrameData>((&(reader__)));
if (!maybe__aFrameData) {
FatalError("Error deserializing 'WebSocketFrameData'");
return MsgValueError;
}
auto& aFrameData = *maybe__aFrameData;
// Sentinel = 'aFrameData'
if ((!(((&(reader__)))->ReadSentinel(344196039)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'WebSocketFrameData'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WebSocketEventListenerChild*>(this))->RecvFrameReceived(std::move(aWebSocketSerialID), std::move(aFrameData));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWebSocketEventListener::Msg_FrameSent__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebSocketEventListener", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketEventListenerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebSocketEventListener::Msg_FrameSent", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aWebSocketSerialID = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__aWebSocketSerialID) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& aWebSocketSerialID = *maybe__aWebSocketSerialID;
// Sentinel = 'aWebSocketSerialID'
if ((!(((&(reader__)))->ReadSentinel(1104873174)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto maybe__aFrameData = IPC::ReadParam<WebSocketFrameData>((&(reader__)));
if (!maybe__aFrameData) {
FatalError("Error deserializing 'WebSocketFrameData'");
return MsgValueError;
}
auto& aFrameData = *maybe__aFrameData;
// Sentinel = 'aFrameData'
if ((!(((&(reader__)))->ReadSentinel(344196039)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'WebSocketFrameData'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WebSocketEventListenerChild*>(this))->RecvFrameSent(std::move(aWebSocketSerialID), std::move(aFrameData));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWebSocketEventListener::Msg___delete____ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebSocketEventListener", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebSocketEventListenerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebSocketEventListener::Msg___delete__", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<WebSocketEventListenerChild*>(this))->Recv__delete__();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
IProtocol* mgr = this->Manager();
this->DestroySubtree(Deletion);
this->ClearSubtree();
mgr->RemoveManagee(PWebSocketEventListenerMsgStart, this);
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PWebSocketEventListenerChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PWebSocketEventListenerChild::Result
{
return MsgNotKnown;
}
auto PWebSocketEventListenerChild::ClearSubtree() -> void
{
}
} // namespace net
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::net::PWebSocketEventListenerChild*>::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::PWebSocketEventListenerChild*>::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, "PWebSocketEventListener", PWebSocketEventListenerMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::net::PWebSocketEventListenerChild*>(actor.ref());
}
return {};
}
} // namespace IPC