// // Automatically generated by ipdlc. // Edit at your own risk // #include "mozilla/net/PTCPSocketParent.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/dom/network/TCPSocketChild.h" #include "mozilla/dom/network/TCPSocketParent.h" #include "mozilla/ipc/IPCCore.h" #include "mozilla/net/NeckoMessageUtils.h" #include "mozilla/net/PNeckoParent.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 PTCPSocketParent::Recv__delete__() -> mozilla::ipc::IPCResult { return IPC_OK(); } MOZ_IMPLICIT PTCPSocketParent::PTCPSocketParent() : mozilla::ipc::IProtocol(kProtocolId, mozilla::ipc::ParentSide) { MOZ_COUNT_CTOR(PTCPSocketParent); } PTCPSocketParent::~PTCPSocketParent() { MOZ_COUNT_DTOR(PTCPSocketParent); } auto PTCPSocketParent::ActorAlloc() -> void { } auto PTCPSocketParent::ActorDealloc() -> void { if (Manager()) { Manager()->DeallocManagee(kProtocolId, this); } } auto PTCPSocketParent::OtherPid() const -> ::base::ProcessId { ::base::ProcessId pid = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid(); MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId); return pid; } auto PTCPSocketParent::OtherChildID() const -> ::GeckoChildID { ::GeckoChildID childID = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid(); MOZ_RELEASE_ASSERT(childID != -1); return childID; } auto PTCPSocketParent::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo { return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()}; } auto PTCPSocketParent::Manager() const -> PNeckoParent* { return static_cast(IProtocol::Manager()); } auto PTCPSocketParent::ManagedProtocolIds() const -> mozilla::Span { return {}; } auto PTCPSocketParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer* { switch (aProtocol) { default: return nullptr; } } auto PTCPSocketParent::SendCallback( const nsAString& type, const CallbackData& data, const uint32_t& readyState) -> bool { UniquePtr msg__ = PTCPSocket::Msg_Callback(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), type); // Sentinel = 'type' ((&(writer__)))->WriteSentinel(75760067); IPC::WriteParam((&(writer__)), data); // Sentinel = 'data' ((&(writer__)))->WriteSentinel(67109275); IPC::WriteParam((&(writer__)), readyState); // Sentinel = 'readyState' ((&(writer__)))->WriteSentinel(377750551); if (mozilla::ipc::LoggingEnabledFor("PTCPSocket", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PTCPSocketParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PTCPSocket::Msg_Callback", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PTCPSocketParent::SendUpdateBufferedAmount( const uint32_t& bufferedAmount, const uint32_t& trackingNumber) -> bool { UniquePtr msg__ = PTCPSocket::Msg_UpdateBufferedAmount(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), bufferedAmount); // Sentinel = 'bufferedAmount' ((&(writer__)))->WriteSentinel(711919032); IPC::WriteParam((&(writer__)), trackingNumber); // Sentinel = 'trackingNumber' ((&(writer__)))->WriteSentinel(726664637); if (mozilla::ipc::LoggingEnabledFor("PTCPSocket", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PTCPSocketParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PTCPSocket::Msg_UpdateBufferedAmount", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PTCPSocketParent::SendRequestDelete() -> bool { UniquePtr msg__ = PTCPSocket::Msg_RequestDelete(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PTCPSocket", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PTCPSocketParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PTCPSocket::Msg_RequestDelete", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PTCPSocketParent::Send__delete__(PTCPSocketParent* actor) -> bool { if (!actor || !actor->CanSend()) { NS_WARNING("Attempt to __delete__ missing or closed actor"); return false; } UniquePtr msg__ = PTCPSocket::Msg___delete__((actor)->Id()); IPC::MessageWriter writer__{ (*(msg__)), actor}; if (mozilla::ipc::LoggingEnabledFor("PTCPSocket", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PTCPSocketParent", actor->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PTCPSocket::Msg___delete__", OTHER); bool sendok__ = (actor)->ChannelSend(std::move(msg__)); actor->ActorDisconnected(Deletion); return sendok__; } auto PTCPSocketParent::DeallocManagee( mozilla::ipc::ProtocolId aProtocolId, IProtocol* aListener) -> void { FatalError("unreached"); return; } auto PTCPSocketParent::OnMessageReceived(const Message& msg__) -> PTCPSocketParent::Result { if (!CanSend()) { if (mozilla::ipc::LoggingEnabledFor("PTCPSocket", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PTCPSocketParent", 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 PTCPSocket::Msg_Open__ID: { if (mozilla::ipc::LoggingEnabledFor("PTCPSocket", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PTCPSocketParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PTCPSocket::Msg_Open", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__host = IPC::ReadParam((&(reader__))); if (!maybe__host) { FatalError("Error deserializing 'nsString'"); return MsgValueError; } auto& host = *maybe__host; // Sentinel = 'host' if ((!(((&(reader__)))->ReadSentinel(72024511)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); return MsgValueError; } auto maybe__port = IPC::ReadParam((&(reader__))); if (!maybe__port) { FatalError("Error deserializing 'uint16_t'"); return MsgValueError; } auto& port = *maybe__port; // Sentinel = 'port' if ((!(((&(reader__)))->ReadSentinel(73990598)))) { mozilla::ipc::SentinelReadError("Error deserializing 'uint16_t'"); return MsgValueError; } auto maybe__useSSL = IPC::ReadParam((&(reader__))); if (!maybe__useSSL) { FatalError("Error deserializing 'bool'"); return MsgValueError; } auto& useSSL = *maybe__useSSL; // Sentinel = 'useSSL' if ((!(((&(reader__)))->ReadSentinel(142737984)))) { mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); return MsgValueError; } auto maybe__useArrayBuffers = IPC::ReadParam((&(reader__))); if (!maybe__useArrayBuffers) { FatalError("Error deserializing 'bool'"); return MsgValueError; } auto& useArrayBuffers = *maybe__useArrayBuffers; // Sentinel = 'useArrayBuffers' if ((!(((&(reader__)))->ReadSentinel(815007258)))) { mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::TCPSocketParent*>(this))->RecvOpen(std::move(host), std::move(port), std::move(useSSL), std::move(useArrayBuffers)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PTCPSocket::Msg_Data__ID: { if (mozilla::ipc::LoggingEnabledFor("PTCPSocket", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PTCPSocketParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PTCPSocket::Msg_Data", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__data = IPC::ReadParam((&(reader__))); if (!maybe__data) { FatalError("Error deserializing 'SendableData'"); return MsgValueError; } auto& data = *maybe__data; // Sentinel = 'data' if ((!(((&(reader__)))->ReadSentinel(67109275)))) { mozilla::ipc::SentinelReadError("Error deserializing 'SendableData'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::TCPSocketParent*>(this))->RecvData(std::move(data)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PTCPSocket::Msg_StartTLS__ID: { if (mozilla::ipc::LoggingEnabledFor("PTCPSocket", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PTCPSocketParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PTCPSocket::Msg_StartTLS", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::TCPSocketParent*>(this))->RecvStartTLS(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PTCPSocket::Msg_Suspend__ID: { if (mozilla::ipc::LoggingEnabledFor("PTCPSocket", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PTCPSocketParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PTCPSocket::Msg_Suspend", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::TCPSocketParent*>(this))->RecvSuspend(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PTCPSocket::Msg_Resume__ID: { if (mozilla::ipc::LoggingEnabledFor("PTCPSocket", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PTCPSocketParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PTCPSocket::Msg_Resume", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::TCPSocketParent*>(this))->RecvResume(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PTCPSocket::Msg_Close__ID: { if (mozilla::ipc::LoggingEnabledFor("PTCPSocket", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PTCPSocketParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PTCPSocket::Msg_Close", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::TCPSocketParent*>(this))->RecvClose(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PTCPSocket::Msg_RequestDelete__ID: { if (mozilla::ipc::LoggingEnabledFor("PTCPSocket", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PTCPSocketParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PTCPSocket::Msg_RequestDelete", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::TCPSocketParent*>(this))->RecvRequestDelete(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PTCPSocket::Reply___delete____ID: { return MsgProcessed; } case PTCPSocket::Msg___delete____ID: { if (mozilla::ipc::LoggingEnabledFor("PTCPSocket", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PTCPSocketParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PTCPSocket::Msg___delete__", OTHER); DoomSubtree(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::TCPSocketParent*>(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 PTCPSocketParent::OnMessageReceived( const Message& msg__, UniquePtr& reply__) -> PTCPSocketParent::Result { if (!CanSend()) { return MsgDropped; } return MsgNotKnown; } } // namespace net } // namespace mozilla