// // Automatically generated by ipdlc. // Edit at your own risk // #include "mozilla/layers/PNativeLayerRemoteParent.h" #include "mozilla/GfxMessageUtils.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/gfx/2D.h" #include "mozilla/layers/NativeLayerRemoteParent.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 layers { auto PNativeLayerRemoteParent::ProcessingError( Result aCode, const char* aReason) -> void { } auto PNativeLayerRemoteParent::ShouldContinueFromReplyTimeout() -> bool { return true; } MOZ_IMPLICIT PNativeLayerRemoteParent::PNativeLayerRemoteParent() : mozilla::ipc::IToplevelProtocol("PNativeLayerRemoteParent", kProtocolId, mozilla::ipc::ParentSide) { MOZ_COUNT_CTOR(PNativeLayerRemoteParent); } PNativeLayerRemoteParent::~PNativeLayerRemoteParent() { MOZ_COUNT_DTOR(PNativeLayerRemoteParent); } auto PNativeLayerRemoteParent::ActorAlloc() -> void { MOZ_RELEASE_ASSERT(XRE_IsParentProcess(), "Invalid process for `PNativeLayerRemoteParent'"); AddRef(); } auto PNativeLayerRemoteParent::ActorDealloc() -> void { Release(); } auto PNativeLayerRemoteParent::OtherPid() const -> ::base::ProcessId { ::base::ProcessId pid = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid(); MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId); return pid; } auto PNativeLayerRemoteParent::OtherChildID() const -> ::GeckoChildID { ::GeckoChildID childID = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid(); MOZ_RELEASE_ASSERT(childID != -1); return childID; } auto PNativeLayerRemoteParent::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo { return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()}; } auto PNativeLayerRemoteParent::ManagedProtocolIds() const -> mozilla::Span { return {}; } auto PNativeLayerRemoteParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer* { switch (aProtocol) { default: return nullptr; } } auto PNativeLayerRemoteParent::DeallocManagee( mozilla::ipc::ProtocolId aProtocolId, IProtocol* aListener) -> void { FatalError("unreached"); return; } auto PNativeLayerRemoteParent::OnMessageReceived(const Message& msg__) -> PNativeLayerRemoteParent::Result { if (!CanSend()) { if (mozilla::ipc::LoggingEnabledFor("PNativeLayerRemote", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PNativeLayerRemoteParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Ignored message for dead actor", (&(msg__))->type(), mozilla::ipc::MessageDirection::eSending); } return MsgProcessed; } switch (msg__.type()) { case PNativeLayerRemote::Msg_CommitNativeLayerCommands__ID: { if (mozilla::ipc::LoggingEnabledFor("PNativeLayerRemote", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PNativeLayerRemoteParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PNativeLayerRemote::Msg_CommitNativeLayerCommands", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__commands = IPC::ReadParam>((&(reader__))); if (!maybe__commands) { FatalError("Error deserializing 'NativeLayerCommand[]'"); return MsgValueError; } auto& commands = *maybe__commands; // Sentinel = 'commands' if ((!(((&(reader__)))->ReadSentinel(249627475)))) { mozilla::ipc::SentinelReadError("Error deserializing 'NativeLayerCommand[]'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::layers::NativeLayerRemoteParent*>(this))->RecvCommitNativeLayerCommands(std::move(commands)); 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 PNativeLayerRemoteParent::OnMessageReceived( const Message& msg__, UniquePtr& reply__) -> PNativeLayerRemoteParent::Result { if (!CanSend()) { return MsgDropped; } switch (msg__.type()) { case PNativeLayerRemote::Msg_RequestReadback__ID: { if (mozilla::ipc::LoggingEnabledFor("PNativeLayerRemote", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PNativeLayerRemoteParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PNativeLayerRemote::Msg_RequestReadback", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__size = IPC::ReadParam((&(reader__))); if (!maybe__size) { FatalError("Error deserializing 'IntSize'"); return MsgValueError; } auto& size = *maybe__size; // Sentinel = 'size' if ((!(((&(reader__)))->ReadSentinel(73662908)))) { mozilla::ipc::SentinelReadError("Error deserializing 'IntSize'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::ActorId id__ = MSG_ROUTING_CONTROL; Shmem pixels{}; mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::layers::NativeLayerRemoteParent*>(this))->RecvRequestReadback(std::move(size), (&(pixels))); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } reply__ = PNativeLayerRemote::Reply_RequestReadback(id__); IPC::MessageWriter writer__{ (*(reply__)), this}; IPC::WriteParam((&(writer__)), std::move(pixels)); // Sentinel = 'pixels' ((&(writer__)))->WriteSentinel(151847574); if (mozilla::ipc::LoggingEnabledFor("PNativeLayerRemote", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PNativeLayerRemoteParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending reply ", reply__->type(), mozilla::ipc::MessageDirection::eSending); } return MsgProcessed; } case PNativeLayerRemote::Msg_Flush__ID: { if (mozilla::ipc::LoggingEnabledFor("PNativeLayerRemote", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PNativeLayerRemoteParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PNativeLayerRemote::Msg_Flush", OTHER); mozilla::ipc::ActorId id__ = MSG_ROUTING_CONTROL; mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::layers::NativeLayerRemoteParent*>(this))->RecvFlush(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } reply__ = PNativeLayerRemote::Reply_Flush(id__); IPC::MessageWriter writer__{ (*(reply__)), this}; if (mozilla::ipc::LoggingEnabledFor("PNativeLayerRemote", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PNativeLayerRemoteParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending reply ", reply__->type(), mozilla::ipc::MessageDirection::eSending); } return MsgProcessed; } default: return MsgNotKnown; } } } // namespace layers } // namespace mozilla