// // Automatically generated by ipdlc. // Edit at your own risk // #include "mozilla/dom/PSharedWorkerParent.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/dom/ClientIPCUtils.h" #include "mozilla/dom/ReferrerInfoUtils.h" #include "mozilla/dom/RemoteType.h" #include "mozilla/dom/SharedWorkerParent.h" #include "mozilla/dom/WorkerIPCUtils.h" #include "mozilla/ipc/IPCCore.h" #include "nsIPrincipal.h" #include "mozilla/ipc/PBackgroundParent.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 dom { MOZ_IMPLICIT PSharedWorkerParent::PSharedWorkerParent() : mozilla::ipc::IProtocol(kProtocolId, mozilla::ipc::ParentSide) { MOZ_COUNT_CTOR(PSharedWorkerParent); } PSharedWorkerParent::~PSharedWorkerParent() { MOZ_COUNT_DTOR(PSharedWorkerParent); } auto PSharedWorkerParent::ActorAlloc() -> void { } auto PSharedWorkerParent::ActorDealloc() -> void { if (Manager()) { Manager()->DeallocManagee(kProtocolId, this); } } auto PSharedWorkerParent::OtherPid() const -> ::base::ProcessId { ::base::ProcessId pid = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid(); MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId); return pid; } auto PSharedWorkerParent::OtherChildID() const -> ::GeckoChildID { ::GeckoChildID childID = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid(); MOZ_RELEASE_ASSERT(childID != -1); return childID; } auto PSharedWorkerParent::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo { return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()}; } auto PSharedWorkerParent::Manager() const -> PBackgroundParent* { return static_cast(IProtocol::Manager()); } auto PSharedWorkerParent::ManagedProtocolIds() const -> mozilla::Span { return {}; } auto PSharedWorkerParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer* { switch (aProtocol) { default: return nullptr; } } auto PSharedWorkerParent::SendError(const ErrorValue& value) -> bool { UniquePtr msg__ = PSharedWorker::Msg_Error(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), value); // Sentinel = 'value' ((&(writer__)))->WriteSentinel(107610654); if (mozilla::ipc::LoggingEnabledFor("PSharedWorker", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSharedWorkerParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PSharedWorker::Msg_Error", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PSharedWorkerParent::SendNotifyLock(const bool& aCreated) -> bool { UniquePtr msg__ = PSharedWorker::Msg_NotifyLock(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), aCreated); // Sentinel = 'aCreated' ((&(writer__)))->WriteSentinel(228066074); if (mozilla::ipc::LoggingEnabledFor("PSharedWorker", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSharedWorkerParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PSharedWorker::Msg_NotifyLock", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PSharedWorkerParent::SendNotifyWebTransport(const bool& aCreated) -> bool { UniquePtr msg__ = PSharedWorker::Msg_NotifyWebTransport(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), aCreated); // Sentinel = 'aCreated' ((&(writer__)))->WriteSentinel(228066074); if (mozilla::ipc::LoggingEnabledFor("PSharedWorker", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSharedWorkerParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PSharedWorker::Msg_NotifyWebTransport", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PSharedWorkerParent::SendTerminate() -> bool { UniquePtr msg__ = PSharedWorker::Msg_Terminate(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PSharedWorker", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSharedWorkerParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PSharedWorker::Msg_Terminate", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PSharedWorkerParent::Send__delete__(PSharedWorkerParent* actor) -> bool { if (!actor || !actor->CanSend()) { NS_WARNING("Attempt to __delete__ missing or closed actor"); return false; } UniquePtr msg__ = PSharedWorker::Msg___delete__((actor)->Id()); IPC::MessageWriter writer__{ (*(msg__)), actor}; if (mozilla::ipc::LoggingEnabledFor("PSharedWorker", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSharedWorkerParent", actor->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PSharedWorker::Msg___delete__", OTHER); bool sendok__ = (actor)->ChannelSend(std::move(msg__)); actor->ActorDisconnected(Deletion); return sendok__; } auto PSharedWorkerParent::DeallocManagee( mozilla::ipc::ProtocolId aProtocolId, IProtocol* aListener) -> void { FatalError("unreached"); return; } auto PSharedWorkerParent::OnMessageReceived(const Message& msg__) -> PSharedWorkerParent::Result { if (!CanSend()) { if (mozilla::ipc::LoggingEnabledFor("PSharedWorker", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSharedWorkerParent", 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 PSharedWorker::Msg_Close__ID: { if (mozilla::ipc::LoggingEnabledFor("PSharedWorker", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSharedWorkerParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSharedWorker::Msg_Close", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SharedWorkerParent*>(this))->RecvClose(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSharedWorker::Msg_Suspend__ID: { if (mozilla::ipc::LoggingEnabledFor("PSharedWorker", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSharedWorkerParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSharedWorker::Msg_Suspend", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SharedWorkerParent*>(this))->RecvSuspend(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSharedWorker::Msg_Resume__ID: { if (mozilla::ipc::LoggingEnabledFor("PSharedWorker", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSharedWorkerParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSharedWorker::Msg_Resume", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SharedWorkerParent*>(this))->RecvResume(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSharedWorker::Msg_Freeze__ID: { if (mozilla::ipc::LoggingEnabledFor("PSharedWorker", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSharedWorkerParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSharedWorker::Msg_Freeze", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SharedWorkerParent*>(this))->RecvFreeze(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSharedWorker::Msg_Thaw__ID: { if (mozilla::ipc::LoggingEnabledFor("PSharedWorker", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSharedWorkerParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSharedWorker::Msg_Thaw", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SharedWorkerParent*>(this))->RecvThaw(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSharedWorker::Msg_SetLocaleOverride__ID: { if (mozilla::ipc::LoggingEnabledFor("PSharedWorker", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSharedWorkerParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSharedWorker::Msg_SetLocaleOverride", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__languageOverride = IPC::ReadParam((&(reader__))); if (!maybe__languageOverride) { FatalError("Error deserializing 'nsCString'"); return MsgValueError; } auto& languageOverride = *maybe__languageOverride; // Sentinel = 'languageOverride' if ((!(((&(reader__)))->ReadSentinel(930219653)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'"); return MsgValueError; } auto maybe__languages = IPC::ReadParam>((&(reader__))); if (!maybe__languages) { FatalError("Error deserializing 'nsString[]'"); return MsgValueError; } auto& languages = *maybe__languages; // Sentinel = 'languages' if ((!(((&(reader__)))->ReadSentinel(310903736)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsString[]'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SharedWorkerParent*>(this))->RecvSetLocaleOverride(std::move(languageOverride), std::move(languages)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSharedWorker::Msg_UpdateTimezoneOverride__ID: { if (mozilla::ipc::LoggingEnabledFor("PSharedWorker", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PSharedWorkerParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PSharedWorker::Msg_UpdateTimezoneOverride", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aTimezoneOverride = IPC::ReadParam((&(reader__))); if (!maybe__aTimezoneOverride) { FatalError("Error deserializing 'nsString'"); return MsgValueError; } auto& aTimezoneOverride = *maybe__aTimezoneOverride; // Sentinel = 'aTimezoneOverride' if ((!(((&(reader__)))->ReadSentinel(1037043437)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::SharedWorkerParent*>(this))->RecvUpdateTimezoneOverride(std::move(aTimezoneOverride)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PSharedWorker::Reply___delete____ID: { return MsgProcessed; } default: return MsgNotKnown; } } auto PSharedWorkerParent::OnMessageReceived( const Message& msg__, UniquePtr& reply__) -> PSharedWorkerParent::Result { if (!CanSend()) { return MsgDropped; } return MsgNotKnown; } } // namespace dom } // namespace mozilla