// // Automatically generated by ipdlc. // Edit at your own risk // #include "mozilla/gfx/PVRChild.h" #include "VRChild.h" #include "VRMessageUtils.h" #include "VRParent.h" #include "mozilla/D3DMessageUtils.h" #include "mozilla/GfxMessageUtils.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/ipc/IPCCore.h" #include "mozilla/gfx/PVRGPUChild.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 gfx { auto PVRChild::ProcessingError( Result aCode, const char* aReason) -> void { } auto PVRChild::ShouldContinueFromReplyTimeout() -> bool { return true; } MOZ_IMPLICIT PVRChild::PVRChild() : mozilla::ipc::IToplevelProtocol("PVRChild", kProtocolId, mozilla::ipc::ChildSide) { MOZ_COUNT_CTOR(PVRChild); } PVRChild::~PVRChild() { MOZ_COUNT_DTOR(PVRChild); } auto PVRChild::ActorAlloc() -> void { MOZ_RELEASE_ASSERT(XRE_IsParentProcess(), "Invalid process for `PVRChild'"); AddRef(); } auto PVRChild::ActorDealloc() -> void { Release(); } auto PVRChild::OtherPid() const -> ::base::ProcessId { ::base::ProcessId pid = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid(); MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId); return pid; } auto PVRChild::OtherChildID() const -> ::GeckoChildID { ::GeckoChildID childID = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid(); MOZ_RELEASE_ASSERT(childID != -1); return childID; } auto PVRChild::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo { return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()}; } auto PVRChild::ManagedProtocolIds() const -> mozilla::Span { return {}; } auto PVRChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer* { switch (aProtocol) { default: return nullptr; } } auto PVRChild::RejectPendingResponses(ResponseRejectReason aReason) -> void { mAsyncCallbacks.RejectPendingResponses(aReason); } auto PVRChild::SendNewGPUVRManager(Endpoint<::mozilla::gfx::PVRGPUParent>&& endpoint) -> bool { UniquePtr msg__ = PVR::Msg_NewGPUVRManager(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), std::move(endpoint)); // Sentinel = 'endpoint' ((&(writer__)))->WriteSentinel(251724642); if (mozilla::ipc::LoggingEnabledFor("PVR", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PVRChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PVR::Msg_NewGPUVRManager", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PVRChild::SendInit( mozilla::Span vars, const DevicePrefs& devicePrefs) -> bool { UniquePtr msg__ = PVR::Msg_Init(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), vars); // Sentinel = 'vars' ((&(writer__)))->WriteSentinel(72745405); IPC::WriteParam((&(writer__)), devicePrefs); // Sentinel = 'devicePrefs' ((&(writer__)))->WriteSentinel(445645937); if (mozilla::ipc::LoggingEnabledFor("PVR", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PVRChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PVR::Msg_Init", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PVRChild::SendUpdateVar(mozilla::Span var) -> bool { UniquePtr msg__ = PVR::Msg_UpdateVar(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), var); // Sentinel = 'var' ((&(writer__)))->WriteSentinel(43581770); if (mozilla::ipc::LoggingEnabledFor("PVR", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PVRChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PVR::Msg_UpdateVar", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PVRChild::SendPreferenceUpdate(const Pref& pref) -> bool { UniquePtr msg__ = PVR::Msg_PreferenceUpdate(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), pref); // Sentinel = 'pref' ((&(writer__)))->WriteSentinel(71958958); if (mozilla::ipc::LoggingEnabledFor("PVR", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PVRChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PVR::Msg_PreferenceUpdate", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PVRChild::SendOpenVRControllerActionPathToVR(const nsACString& aPath) -> bool { UniquePtr msg__ = PVR::Msg_OpenVRControllerActionPathToVR(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), aPath); // Sentinel = 'aPath' ((&(writer__)))->WriteSentinel(94175727); if (mozilla::ipc::LoggingEnabledFor("PVR", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PVRChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PVR::Msg_OpenVRControllerActionPathToVR", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PVRChild::SendOpenVRControllerManifestPathToVR( const VRControllerType& aType, const nsACString& aPath) -> bool { UniquePtr msg__ = PVR::Msg_OpenVRControllerManifestPathToVR(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), aType); // Sentinel = 'aType' ((&(writer__)))->WriteSentinel(99222020); IPC::WriteParam((&(writer__)), aPath); // Sentinel = 'aPath' ((&(writer__)))->WriteSentinel(94175727); if (mozilla::ipc::LoggingEnabledFor("PVR", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PVRChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PVR::Msg_OpenVRControllerManifestPathToVR", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PVRChild::SendRequestMemoryReport( const uint32_t& generation, const bool& anonymize, const bool& minimizeMemoryUsage, const mozilla::Maybe& DMDFile, mozilla::ipc::ResolveCallback&& aResolve, mozilla::ipc::RejectCallback&& aReject) -> void { UniquePtr msg__ = PVR::Msg_RequestMemoryReport(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), generation); // Sentinel = 'generation' ((&(writer__)))->WriteSentinel(381158445); IPC::WriteParam((&(writer__)), anonymize); // Sentinel = 'anonymize' ((&(writer__)))->WriteSentinel(321127387); IPC::WriteParam((&(writer__)), minimizeMemoryUsage); // Sentinel = 'minimizeMemoryUsage' ((&(writer__)))->WriteSentinel(1321600977); IPC::WriteParam((&(writer__)), DMDFile); // Sentinel = 'DMDFile' ((&(writer__)))->WriteSentinel(143983190); if (mozilla::ipc::LoggingEnabledFor("PVR", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PVRChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PVR::Msg_RequestMemoryReport", OTHER); IPC::Message::seqno_t seqno__ = 0; if (ChannelSend(std::move(msg__), (&(seqno__)))) { mAsyncCallbacks.AddCallback(seqno__, PVR::Reply_RequestMemoryReport__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable { auto maybe__aGeneration = IPC::ReadParam(aReader); if (!maybe__aGeneration) { (aReader)->FatalError("Error deserializing 'uint32_t'"); return MsgValueError; } auto& aGeneration = *maybe__aGeneration; // Sentinel = 'aGeneration' if ((!((aReader)->ReadSentinel(430179438)))) { mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); return MsgValueError; } aReader->EndRead(); resolve(std::move(aGeneration)); return MsgProcessed; }, std::move(aReject)); } else { aReject(::mozilla::ipc::ResponseRejectReason::SendError); } return; } auto PVRChild::SendRequestMemoryReport( const uint32_t& generation, const bool& anonymize, const bool& minimizeMemoryUsage, const mozilla::Maybe& DMDFile) -> RefPtr { RefPtr::Private> promise__ = new MozPromise::Private(__func__); promise__->UseDirectTaskDispatch(__func__); SendRequestMemoryReport(std::forward(generation), std::forward(anonymize), std::forward(minimizeMemoryUsage), std::forward&>(DMDFile), [promise__](uint32_t&& aValue) { promise__->Resolve(std::move(aValue), __func__); }, [promise__](ResponseRejectReason&& aReason) { promise__->Reject(std::move(aReason), __func__); }); return promise__; } auto PVRChild::DeallocManagee( mozilla::ipc::ProtocolId aProtocolId, IProtocol* aListener) -> void { FatalError("unreached"); return; } auto PVRChild::OnMessageReceived(const Message& msg__) -> PVRChild::Result { if (!CanSend()) { if (mozilla::ipc::LoggingEnabledFor("PVR", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PVRChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Ignored message for dead actor", (&(msg__))->type(), mozilla::ipc::MessageDirection::eSending); } return MsgProcessed; } switch (msg__.type()) { case PVR::Reply_RequestMemoryReport__ID: { if (mozilla::ipc::LoggingEnabledFor("PVR", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PVRChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PVR::Msg_RequestMemoryReport", OTHER); return mAsyncCallbacks.GotReply(this, msg__); } case PVR::Msg_InitComplete__ID: { if (mozilla::ipc::LoggingEnabledFor("PVR", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PVRChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PVR::Msg_InitComplete", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::gfx::VRChild*>(this))->RecvInitComplete(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PVR::Msg_OpenVRControllerActionPathToParent__ID: { if (mozilla::ipc::LoggingEnabledFor("PVR", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PVRChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PVR::Msg_OpenVRControllerActionPathToParent", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aPath = IPC::ReadParam((&(reader__))); if (!maybe__aPath) { FatalError("Error deserializing 'nsCString'"); return MsgValueError; } auto& aPath = *maybe__aPath; // Sentinel = 'aPath' if ((!(((&(reader__)))->ReadSentinel(94175727)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::gfx::VRChild*>(this))->RecvOpenVRControllerActionPathToParent(std::move(aPath)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PVR::Msg_OpenVRControllerManifestPathToParent__ID: { if (mozilla::ipc::LoggingEnabledFor("PVR", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PVRChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PVR::Msg_OpenVRControllerManifestPathToParent", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aType = IPC::ReadParam((&(reader__))); if (!maybe__aType) { FatalError("Error deserializing 'VRControllerType'"); return MsgValueError; } auto& aType = *maybe__aType; // Sentinel = 'aType' if ((!(((&(reader__)))->ReadSentinel(99222020)))) { mozilla::ipc::SentinelReadError("Error deserializing 'VRControllerType'"); return MsgValueError; } auto maybe__aPath = IPC::ReadParam((&(reader__))); if (!maybe__aPath) { FatalError("Error deserializing 'nsCString'"); return MsgValueError; } auto& aPath = *maybe__aPath; // Sentinel = 'aPath' if ((!(((&(reader__)))->ReadSentinel(94175727)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::gfx::VRChild*>(this))->RecvOpenVRControllerManifestPathToParent(std::move(aType), std::move(aPath)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PVR::Msg_InitCrashReporter__ID: { if (mozilla::ipc::LoggingEnabledFor("PVR", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PVRChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PVR::Msg_InitCrashReporter", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aInitArgs = IPC::ReadParam((&(reader__))); if (!maybe__aInitArgs) { FatalError("Error deserializing 'CrashReporterInitArgs'"); return MsgValueError; } auto& aInitArgs = *maybe__aInitArgs; // Sentinel = 'aInitArgs' if ((!(((&(reader__)))->ReadSentinel(286327683)))) { mozilla::ipc::SentinelReadError("Error deserializing 'CrashReporterInitArgs'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::gfx::VRChild*>(this))->RecvInitCrashReporter(std::move(aInitArgs)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PVR::Msg_AddMemoryReport__ID: { if (mozilla::ipc::LoggingEnabledFor("PVR", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PVRChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PVR::Msg_AddMemoryReport", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__aReport = IPC::ReadParam((&(reader__))); if (!maybe__aReport) { FatalError("Error deserializing 'MemoryReport'"); return MsgValueError; } auto& aReport = *maybe__aReport; // Sentinel = 'aReport' if ((!(((&(reader__)))->ReadSentinel(184025822)))) { mozilla::ipc::SentinelReadError("Error deserializing 'MemoryReport'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::gfx::VRChild*>(this))->RecvAddMemoryReport(std::move(aReport)); 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 PVRChild::OnMessageReceived( const Message& msg__, UniquePtr& reply__) -> PVRChild::Result { if (!CanSend()) { return MsgDropped; } MOZ_ASSERT_UNREACHABLE("message protocol not supported"); return MsgNotKnown; } } // namespace gfx } // namespace mozilla