Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/gmp/PGMPVideoDecoderParent.h"
#include "GMPMessageUtils.h"
#include "GMPVideoDecoderChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/gmp/PGMPContentParent.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 gmp {
auto PGMPVideoDecoderParent::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
MOZ_IMPLICIT PGMPVideoDecoderParent::PGMPVideoDecoderParent() :
mozilla::ipc::IRefCountedProtocol(PGMPVideoDecoderMsgStart, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PGMPVideoDecoderParent);
}
PGMPVideoDecoderParent::~PGMPVideoDecoderParent()
{
MOZ_COUNT_DTOR(PGMPVideoDecoderParent);
}
auto PGMPVideoDecoderParent::ActorAlloc() -> void
{
AddRef();
}
auto PGMPVideoDecoderParent::ActorDealloc() -> void
{
Release();
}
auto PGMPVideoDecoderParent::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PGMPVideoDecoderParent::Manager() const -> PGMPContentParent*
{
return static_cast<PGMPContentParent*>(IProtocol::Manager());
}
auto PGMPVideoDecoderParent::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PGMPVideoDecoderParent::SendInitDecode(
const GMPVideoCodec& aCodecSettings,
mozilla::Span<uint8_t const> aCodecSpecific,
const int32_t& aCoreCount) -> bool
{
UniquePtr<IPC::Message> msg__ = PGMPVideoDecoder::Msg_InitDecode(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aCodecSettings);
// Sentinel = 'aCodecSettings'
((&(writer__)))->WriteSentinel(674629009);
IPC::WriteParam((&(writer__)), aCodecSpecific);
// Sentinel = 'aCodecSpecific'
((&(writer__)))->WriteSentinel(665847142);
IPC::WriteParam((&(writer__)), aCoreCount);
// Sentinel = 'aCoreCount'
((&(writer__)))->WriteSentinel(350028788);
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_InitDecode", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PGMPVideoDecoderParent::SendDecode(
const GMPVideoEncodedFrameData& aInputFrame,
const bool& aMissingFrames,
mozilla::Span<uint8_t const> aCodecSpecificInfo,
const int64_t& aRenderTimeMs) -> bool
{
UniquePtr<IPC::Message> msg__ = PGMPVideoDecoder::Msg_Decode(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aInputFrame);
// Sentinel = 'aInputFrame'
((&(writer__)))->WriteSentinel(434177117);
IPC::WriteParam((&(writer__)), aMissingFrames);
// Sentinel = 'aMissingFrames'
((&(writer__)))->WriteSentinel(695731610);
IPC::WriteParam((&(writer__)), aCodecSpecificInfo);
// Sentinel = 'aCodecSpecificInfo'
((&(writer__)))->WriteSentinel(1089537778);
IPC::WriteParam((&(writer__)), aRenderTimeMs);
// Sentinel = 'aRenderTimeMs'
((&(writer__)))->WriteSentinel(590611729);
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_Decode", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PGMPVideoDecoderParent::SendReset() -> bool
{
UniquePtr<IPC::Message> msg__ = PGMPVideoDecoder::Msg_Reset(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_Reset", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PGMPVideoDecoderParent::SendDrain() -> bool
{
UniquePtr<IPC::Message> msg__ = PGMPVideoDecoder::Msg_Drain(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_Drain", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PGMPVideoDecoderParent::SendDecodingComplete() -> bool
{
UniquePtr<IPC::Message> msg__ = PGMPVideoDecoder::Msg_DecodingComplete(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_DecodingComplete", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PGMPVideoDecoderParent::SendChildShmemForPool(Shmem&& aFrameBuffer) -> bool
{
UniquePtr<IPC::Message> msg__ = PGMPVideoDecoder::Msg_ChildShmemForPool(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), std::move(aFrameBuffer));
// Sentinel = 'aFrameBuffer'
((&(writer__)))->WriteSentinel(494732455);
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_ChildShmemForPool", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PGMPVideoDecoderParent::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PGMPVideoDecoderParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PGMPVideoDecoderParent::OnMessageReceived(const Message& msg__) -> PGMPVideoDecoderParent::Result
{
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 PGMPVideoDecoder::Msg___delete____ID:
{
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg___delete__", OTHER);
mozilla::ipc::IPCResult __ok = (this)->Recv__delete__();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
this->ActorDisconnected(Deletion);
return MsgProcessed;
}
case PGMPVideoDecoder::Msg_Decoded__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_Decoded", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aDecodedFrame = IPC::ReadParam<GMPVideoi420FrameData>((&(reader__)));
if (!maybe__aDecodedFrame) {
FatalError("Error deserializing 'GMPVideoi420FrameData'");
return MsgValueError;
}
auto& aDecodedFrame = *maybe__aDecodedFrame;
// Sentinel = 'aDecodedFrame'
if ((!(((&(reader__)))->ReadSentinel(571016437)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'GMPVideoi420FrameData'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (this)->RecvDecoded(std::move(aDecodedFrame));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PGMPVideoDecoder::Msg_ReceivedDecodedReferenceFrame__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_ReceivedDecodedReferenceFrame", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aPictureId = IPC::ReadParam<uint64_t>((&(reader__)));
if (!maybe__aPictureId) {
FatalError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto& aPictureId = *maybe__aPictureId;
// Sentinel = 'aPictureId'
if ((!(((&(reader__)))->ReadSentinel(361694187)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (this)->RecvReceivedDecodedReferenceFrame(std::move(aPictureId));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PGMPVideoDecoder::Msg_ReceivedDecodedFrame__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_ReceivedDecodedFrame", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aPictureId = IPC::ReadParam<uint64_t>((&(reader__)));
if (!maybe__aPictureId) {
FatalError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto& aPictureId = *maybe__aPictureId;
// Sentinel = 'aPictureId'
if ((!(((&(reader__)))->ReadSentinel(361694187)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (this)->RecvReceivedDecodedFrame(std::move(aPictureId));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PGMPVideoDecoder::Msg_InputDataExhausted__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_InputDataExhausted", OTHER);
mozilla::ipc::IPCResult __ok = (this)->RecvInputDataExhausted();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PGMPVideoDecoder::Msg_DrainComplete__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_DrainComplete", OTHER);
mozilla::ipc::IPCResult __ok = (this)->RecvDrainComplete();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PGMPVideoDecoder::Msg_ResetComplete__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_ResetComplete", OTHER);
mozilla::ipc::IPCResult __ok = (this)->RecvResetComplete();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PGMPVideoDecoder::Msg_Error__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_Error", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aErr = IPC::ReadParam<GMPErr>((&(reader__)));
if (!maybe__aErr) {
FatalError("Error deserializing 'GMPErr'");
return MsgValueError;
}
auto& aErr = *maybe__aErr;
// Sentinel = 'aErr'
if ((!(((&(reader__)))->ReadSentinel(61669771)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'GMPErr'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (this)->RecvError(std::move(aErr));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PGMPVideoDecoder::Msg_Shutdown__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_Shutdown", OTHER);
mozilla::ipc::IPCResult __ok = (this)->RecvShutdown();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PGMPVideoDecoder::Msg_ParentShmemForPool__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_ParentShmemForPool", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aEncodedBuffer = IPC::ReadParam<Shmem>((&(reader__)));
if (!maybe__aEncodedBuffer) {
FatalError("Error deserializing 'Shmem'");
return MsgValueError;
}
auto& aEncodedBuffer = *maybe__aEncodedBuffer;
// Sentinel = 'aEncodedBuffer'
if ((!(((&(reader__)))->ReadSentinel(668927342)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'Shmem'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (this)->RecvParentShmemForPool(std::move(aEncodedBuffer));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PGMPVideoDecoderParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PGMPVideoDecoderParent::Result
{
switch (msg__.type()) {
case PGMPVideoDecoder::Msg_NeedShmem__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PGMPVideoDecoder::Msg_NeedShmem", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aFrameBufferSize = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__aFrameBufferSize) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& aFrameBufferSize = *maybe__aFrameBufferSize;
// Sentinel = 'aFrameBufferSize'
if ((!(((&(reader__)))->ReadSentinel(871958082)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = Id();
Shmem aMem{};
mozilla::ipc::IPCResult __ok = (this)->RecvNeedShmem(std::move(aFrameBufferSize), (&(aMem)));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
reply__ = PGMPVideoDecoder::Reply_NeedShmem(id__);
IPC::MessageWriter writer__{
(*(reply__)),
this};
IPC::WriteParam((&(writer__)), std::move(aMem));
// Sentinel = 'aMem'
((&(writer__)))->WriteSentinel(61211009);
if (mozilla::ipc::LoggingEnabledFor("PGMPVideoDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PGMPVideoDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PGMPVideoDecoderParent::DoomSubtree() -> void
{
SetDoomed();
}
auto PGMPVideoDecoderParent::PeekManagedActor() -> IProtocol*
{
return nullptr;
}
} // namespace gmp
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::gmp::PGMPVideoDecoderParent*>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
MOZ_RELEASE_ASSERT(
aWriter->GetActor(),
"Cannot serialize managed actors without an actor");
int32_t id;
if (!aVar) {
id = 0; // kNullActorId
} else {
id = aVar->Id();
if (id == 1) { // kFreedActorId
aVar->FatalError("Actor has been |delete|d");
}
MOZ_RELEASE_ASSERT(
aWriter->GetActor()->GetIPCChannel() == aVar->GetIPCChannel(),
"Actor must be from the same channel as the"
" actor it's being sent over");
MOZ_RELEASE_ASSERT(
aVar->CanSend(),
"Actor must still be open when sending");
}
IPC::WriteParam(aWriter, id);
}
auto ParamTraits<::mozilla::gmp::PGMPVideoDecoderParent*>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
MOZ_RELEASE_ASSERT(
aReader->GetActor(),
"Cannot deserialize managed actors without an actor");
mozilla::Maybe<mozilla::ipc::IProtocol*> actor = aReader->GetActor()
->ReadActor(aReader, true, "PGMPVideoDecoder", PGMPVideoDecoderMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::gmp::PGMPVideoDecoderParent*>(actor.ref());
}
return {};
}
} // namespace IPC