// // Automatically generated by ipdlc. // Edit at your own risk // #include "mozilla/media/PMediaSystemResourceManagerChild.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/media/MediaSystemResourceManagerChild.h" #include "mozilla/media/MediaSystemResourceMessageUtils.h" #include "mozilla/layers/PImageBridgeChild.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 media { MOZ_IMPLICIT PMediaSystemResourceManagerChild::PMediaSystemResourceManagerChild() : mozilla::ipc::IProtocol(kProtocolId, mozilla::ipc::ChildSide) { MOZ_COUNT_CTOR(PMediaSystemResourceManagerChild); } PMediaSystemResourceManagerChild::~PMediaSystemResourceManagerChild() { MOZ_COUNT_DTOR(PMediaSystemResourceManagerChild); } auto PMediaSystemResourceManagerChild::ActorAlloc() -> void { } auto PMediaSystemResourceManagerChild::ActorDealloc() -> void { if (Manager()) { Manager()->DeallocManagee(kProtocolId, this); } } auto PMediaSystemResourceManagerChild::OtherPid() const -> ::base::ProcessId { ::base::ProcessId pid = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid(); MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId); return pid; } auto PMediaSystemResourceManagerChild::OtherChildID() const -> ::GeckoChildID { ::GeckoChildID childID = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid(); MOZ_RELEASE_ASSERT(childID != -1); return childID; } auto PMediaSystemResourceManagerChild::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo { return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()}; } auto PMediaSystemResourceManagerChild::Manager() const -> PImageBridgeChild* { return static_cast(IProtocol::Manager()); } auto PMediaSystemResourceManagerChild::ManagedProtocolIds() const -> mozilla::Span { return {}; } auto PMediaSystemResourceManagerChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer* { switch (aProtocol) { default: return nullptr; } } auto PMediaSystemResourceManagerChild::SendAcquire( const uint32_t& aId, const MediaSystemResourceType& aResourceType, const bool& aWillWait) -> bool { UniquePtr msg__ = PMediaSystemResourceManager::Msg_Acquire(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), aId); // Sentinel = 'aId' ((&(writer__)))->WriteSentinel(35389711); IPC::WriteParam((&(writer__)), aResourceType); // Sentinel = 'aResourceType' ((&(writer__)))->WriteSentinel(614401356); IPC::WriteParam((&(writer__)), aWillWait); // Sentinel = 'aWillWait' ((&(writer__)))->WriteSentinel(292684687); if (mozilla::ipc::LoggingEnabledFor("PMediaSystemResourceManager", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PMediaSystemResourceManagerChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PMediaSystemResourceManager::Msg_Acquire", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PMediaSystemResourceManagerChild::SendRelease(const uint32_t& aId) -> bool { UniquePtr msg__ = PMediaSystemResourceManager::Msg_Release(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), aId); // Sentinel = 'aId' ((&(writer__)))->WriteSentinel(35389711); if (mozilla::ipc::LoggingEnabledFor("PMediaSystemResourceManager", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PMediaSystemResourceManagerChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PMediaSystemResourceManager::Msg_Release", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PMediaSystemResourceManagerChild::Send__delete__(PMediaSystemResourceManagerChild* actor) -> bool { if (!actor || !actor->CanSend()) { NS_WARNING("Attempt to __delete__ missing or closed actor"); return false; } UniquePtr msg__ = PMediaSystemResourceManager::Msg___delete__((actor)->Id()); IPC::MessageWriter writer__{ (*(msg__)), actor}; if (mozilla::ipc::LoggingEnabledFor("PMediaSystemResourceManager", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PMediaSystemResourceManagerChild", actor->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PMediaSystemResourceManager::Msg___delete__", OTHER); bool sendok__ = (actor)->ChannelSend(std::move(msg__)); actor->ActorDisconnected(Deletion); return sendok__; } auto PMediaSystemResourceManagerChild::DeallocManagee( mozilla::ipc::ProtocolId aProtocolId, IProtocol* aListener) -> void { FatalError("unreached"); return; } auto PMediaSystemResourceManagerChild::OnMessageReceived(const Message& msg__) -> PMediaSystemResourceManagerChild::Result { if (!CanSend()) { if (mozilla::ipc::LoggingEnabledFor("PMediaSystemResourceManager", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PMediaSystemResourceManagerChild", 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 PMediaSystemResourceManager::Msg_Response__ID: { if (mozilla::ipc::LoggingEnabledFor("PMediaSystemResourceManager", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PMediaSystemResourceManagerChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PMediaSystemResourceManager::Msg_Response", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aId = IPC::ReadParam((&(reader__))); if (!maybe__aId) { FatalError("Error deserializing 'uint32_t'"); return MsgValueError; } auto& aId = *maybe__aId; // Sentinel = 'aId' if ((!(((&(reader__)))->ReadSentinel(35389711)))) { mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); return MsgValueError; } auto maybe__aSuccess = IPC::ReadParam((&(reader__))); if (!maybe__aSuccess) { FatalError("Error deserializing 'bool'"); return MsgValueError; } auto& aSuccess = *maybe__aSuccess; // Sentinel = 'aSuccess' if ((!(((&(reader__)))->ReadSentinel(236323643)))) { mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::media::MediaSystemResourceManagerChild*>(this))->RecvResponse(std::move(aId), std::move(aSuccess)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PMediaSystemResourceManager::Reply___delete____ID: { return MsgProcessed; } default: return MsgNotKnown; } } auto PMediaSystemResourceManagerChild::OnMessageReceived( const Message& msg__, UniquePtr& reply__) -> PMediaSystemResourceManagerChild::Result { if (!CanSend()) { return MsgDropped; } return MsgNotKnown; } } // namespace media } // namespace mozilla