// // Automatically generated by ipdlc. // Edit at your own risk // #include "mozilla/net/PSocketProcessBridgeParent.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/net/SocketProcessBridgeParent.h" #include "mozilla/net/PBackgroundDataBridgeParent.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 PSocketProcessBridgeParent::ProcessingError( Result aCode, const char* aReason) -> void { } auto PSocketProcessBridgeParent::ShouldContinueFromReplyTimeout() -> bool { return true; } MOZ_IMPLICIT PSocketProcessBridgeParent::PSocketProcessBridgeParent() : mozilla::ipc::IToplevelProtocol("PSocketProcessBridgeParent", kProtocolId, mozilla::ipc::ParentSide) { MOZ_COUNT_CTOR(PSocketProcessBridgeParent); } PSocketProcessBridgeParent::~PSocketProcessBridgeParent() { MOZ_COUNT_DTOR(PSocketProcessBridgeParent); } auto PSocketProcessBridgeParent::ActorAlloc() -> void { MOZ_RELEASE_ASSERT(XRE_IsSocketProcess(), "Invalid process for `PSocketProcessBridgeParent'"); AddRef(); } auto PSocketProcessBridgeParent::ActorDealloc() -> void { Release(); } auto PSocketProcessBridgeParent::OtherPid() const -> ::base::ProcessId { ::base::ProcessId pid = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid(); MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId); return pid; } auto PSocketProcessBridgeParent::OtherChildID() const -> ::GeckoChildID { ::GeckoChildID childID = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid(); MOZ_RELEASE_ASSERT(childID != -1); return childID; } auto PSocketProcessBridgeParent::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo { return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()}; } auto PSocketProcessBridgeParent::ManagedProtocolIds() const -> mozilla::Span { return {}; } auto PSocketProcessBridgeParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer* { switch (aProtocol) { default: return nullptr; } } auto PSocketProcessBridgeParent::DeallocManagee( mozilla::ipc::ProtocolId aProtocolId, IProtocol* aListener) -> void { FatalError("unreached"); return; } auto PSocketProcessBridgeParent::OnMessageReceived(const Message& msg__) -> PSocketProcessBridgeParent::Result { if (!CanSend()) { if (mozilla::ipc::LoggingEnabledFor("PSocketProcessBridge", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSocketProcessBridgeParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Ignored message for dead actor", (&(msg__))->type(), mozilla::ipc::MessageDirection::eSending); } return MsgProcessed; } switch (msg__.type()) { case PSocketProcessBridge::Msg_InitBackgroundDataBridge__ID: { if (mozilla::ipc::LoggingEnabledFor("PSocketProcessBridge", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSocketProcessBridgeParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSocketProcessBridge::Msg_InitBackgroundDataBridge", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aEndpoint = IPC::ReadParam>((&(reader__))); if (!maybe__aEndpoint) { FatalError("Error deserializing 'Endpoint<::mozilla::net::PBackgroundDataBridgeParent>'"); return MsgValueError; } auto& aEndpoint = *maybe__aEndpoint; // Sentinel = 'aEndpoint' if ((!(((&(reader__)))->ReadSentinel(292225955)))) { mozilla::ipc::SentinelReadError("Error deserializing 'Endpoint<::mozilla::net::PBackgroundDataBridgeParent>'"); return MsgValueError; } auto maybe__aChannelID = IPC::ReadParam((&(reader__))); if (!maybe__aChannelID) { FatalError("Error deserializing 'uint64_t'"); return MsgValueError; } auto& aChannelID = *maybe__aChannelID; // Sentinel = 'aChannelID' if ((!(((&(reader__)))->ReadSentinel(343802792)))) { mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::net::SocketProcessBridgeParent*>(this))->RecvInitBackgroundDataBridge(std::move(aEndpoint), std::move(aChannelID)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } 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 PSocketProcessBridgeParent::OnMessageReceived( const Message& msg__, UniquePtr& reply__) -> PSocketProcessBridgeParent::Result { if (!CanSend()) { return MsgDropped; } return MsgNotKnown; } } // namespace net } // namespace mozilla