// // Automatically generated by ipdlc. // Edit at your own risk // #include "mozilla/net/PWebSocketConnectionParent.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/ipc/TransportSecurityInfoUtils.h" #include "mozilla/net/WebSocketConnectionParent.h" #include "nsITransportSecurityInfo.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 PWebSocketConnectionParent::ProcessingError( Result aCode, const char* aReason) -> void { } auto PWebSocketConnectionParent::ShouldContinueFromReplyTimeout() -> bool { return true; } MOZ_IMPLICIT PWebSocketConnectionParent::PWebSocketConnectionParent() : mozilla::ipc::IToplevelProtocol("PWebSocketConnectionParent", kProtocolId, mozilla::ipc::ParentSide) { MOZ_COUNT_CTOR(PWebSocketConnectionParent); } PWebSocketConnectionParent::~PWebSocketConnectionParent() { MOZ_COUNT_DTOR(PWebSocketConnectionParent); } auto PWebSocketConnectionParent::ActorAlloc() -> void { MOZ_RELEASE_ASSERT(XRE_IsParentProcess(), "Invalid process for `PWebSocketConnectionParent'"); AddRef(); } auto PWebSocketConnectionParent::ActorDealloc() -> void { Release(); } auto PWebSocketConnectionParent::ManagedProtocolIds() const -> mozilla::Span { return {}; } auto PWebSocketConnectionParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer* { switch (aProtocol) { default: return nullptr; } } auto PWebSocketConnectionParent::SendWriteOutputData(mozilla::Span aData) -> bool { UniquePtr msg__ = PWebSocketConnection::Msg_WriteOutputData(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), aData); // Sentinel = 'aData' ((&(writer__)))->WriteSentinel(90571228); if (mozilla::ipc::LoggingEnabledFor("PWebSocketConnection", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PWebSocketConnectionParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PWebSocketConnection::Msg_WriteOutputData", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PWebSocketConnectionParent::SendStartReading() -> bool { UniquePtr msg__ = PWebSocketConnection::Msg_StartReading(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PWebSocketConnection", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PWebSocketConnectionParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PWebSocketConnection::Msg_StartReading", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PWebSocketConnectionParent::SendDrainSocketData() -> bool { UniquePtr msg__ = PWebSocketConnection::Msg_DrainSocketData(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PWebSocketConnection", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PWebSocketConnectionParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PWebSocketConnection::Msg_DrainSocketData", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PWebSocketConnectionParent::DeallocManagee( mozilla::ipc::ProtocolId aProtocolId, IProtocol* aListener) -> void { FatalError("unreached"); return; } auto PWebSocketConnectionParent::OnMessageReceived(const Message& msg__) -> PWebSocketConnectionParent::Result { if (!CanSend()) { if (mozilla::ipc::LoggingEnabledFor("PWebSocketConnection", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PWebSocketConnectionParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Ignored message for dead actor", (&(msg__))->type(), mozilla::ipc::MessageDirection::eSending); } return MsgProcessed; } switch (msg__.type()) { case PWebSocketConnection::Msg_OnTransportAvailable__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebSocketConnection", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PWebSocketConnectionParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebSocketConnection::Msg_OnTransportAvailable", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aSecurityInfo = IPC::ReadParam>((&(reader__))); if (!maybe__aSecurityInfo) { FatalError("Error deserializing 'nsITransportSecurityInfo'"); return MsgValueError; } auto& aSecurityInfo = *maybe__aSecurityInfo; // Sentinel = 'aSecurityInfo' if ((!(((&(reader__)))->ReadSentinel(610075974)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsITransportSecurityInfo'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::net::WebSocketConnectionParent*>(this))->RecvOnTransportAvailable(aSecurityInfo); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PWebSocketConnection::Msg_OnError__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebSocketConnection", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PWebSocketConnectionParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebSocketConnection::Msg_OnError", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aStatus = IPC::ReadParam((&(reader__))); if (!maybe__aStatus) { FatalError("Error deserializing 'nsresult'"); return MsgValueError; } auto& aStatus = *maybe__aStatus; // Sentinel = 'aStatus' if ((!(((&(reader__)))->ReadSentinel(186712806)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::net::WebSocketConnectionParent*>(this))->RecvOnError(std::move(aStatus)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PWebSocketConnection::Msg_OnTCPClosed__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebSocketConnection", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PWebSocketConnectionParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebSocketConnection::Msg_OnTCPClosed", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::net::WebSocketConnectionParent*>(this))->RecvOnTCPClosed(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PWebSocketConnection::Msg_OnDataReceived__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebSocketConnection", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PWebSocketConnectionParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebSocketConnection::Msg_OnDataReceived", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aData = IPC::ReadParam>((&(reader__))); if (!maybe__aData) { FatalError("Error deserializing 'uint8_t[]'"); return MsgValueError; } auto& aData = *maybe__aData; // Sentinel = 'aData' if ((!(((&(reader__)))->ReadSentinel(90571228)))) { mozilla::ipc::SentinelReadError("Error deserializing 'uint8_t[]'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::net::WebSocketConnectionParent*>(this))->RecvOnDataReceived(std::move(aData)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PWebSocketConnection::Msg_OnUpgradeFailed__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebSocketConnection", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PWebSocketConnectionParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebSocketConnection::Msg_OnUpgradeFailed", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aReason = IPC::ReadParam((&(reader__))); if (!maybe__aReason) { FatalError("Error deserializing 'nsresult'"); return MsgValueError; } auto& aReason = *maybe__aReason; // Sentinel = 'aReason' if ((!(((&(reader__)))->ReadSentinel(180093642)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::net::WebSocketConnectionParent*>(this))->RecvOnUpgradeFailed(std::move(aReason)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PWebSocketConnection::Reply___delete____ID: { return MsgProcessed; } default: return MsgNotKnown; case SHMEM_CREATED_MESSAGE_TYPE: { if (!ShmemCreated(msg__)) { return MsgPayloadError; } return MsgProcessed; } case SHMEM_DESTROYED_MESSAGE_TYPE: { if (!ShmemDestroyed(msg__)) { return MsgPayloadError; } return MsgProcessed; } } } auto PWebSocketConnectionParent::OnMessageReceived( const Message& msg__, UniquePtr& reply__) -> PWebSocketConnectionParent::Result { if (!CanSend()) { return MsgDropped; } MOZ_ASSERT_UNREACHABLE("message protocol not supported"); return MsgNotKnown; } } // namespace net } // namespace mozilla