Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/PMFMediaEngineParent.h"
#include "mozilla/MFMediaEngineParent.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/dom/MediaIPCUtils.h"
#include "mozilla/PRemoteDecoderManagerParent.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 {
auto PMFMediaEngineParent::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
MOZ_IMPLICIT PMFMediaEngineParent::PMFMediaEngineParent() :
mozilla::ipc::IProtocol(PMFMediaEngineMsgStart, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PMFMediaEngineParent);
}
PMFMediaEngineParent::~PMFMediaEngineParent()
{
MOZ_COUNT_DTOR(PMFMediaEngineParent);
}
auto PMFMediaEngineParent::ActorAlloc() -> void
{
}
auto PMFMediaEngineParent::ActorDealloc() -> void
{
if (Manager()) {
Manager()->DeallocManagee(PMFMediaEngineMsgStart, this);
}
}
auto PMFMediaEngineParent::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PMFMediaEngineParent::Manager() const -> PRemoteDecoderManagerParent*
{
return static_cast<PRemoteDecoderManagerParent*>(IProtocol::Manager());
}
auto PMFMediaEngineParent::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PMFMediaEngineParent::SendNotifyEvent(const MFMediaEngineEvent& event) -> bool
{
UniquePtr<IPC::Message> msg__ = PMFMediaEngine::Msg_NotifyEvent(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), event);
// Sentinel = 'event'
((&(writer__)))->WriteSentinel(106234403);
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PMFMediaEngine::Msg_NotifyEvent", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PMFMediaEngineParent::SendNotifyError(const MediaResult& error) -> bool
{
UniquePtr<IPC::Message> msg__ = PMFMediaEngine::Msg_NotifyError(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), error);
// Sentinel = 'error'
((&(writer__)))->WriteSentinel(107741739);
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PMFMediaEngine::Msg_NotifyError", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PMFMediaEngineParent::SendUpdateCurrentTime(const double& currentTimeInSecond) -> bool
{
UniquePtr<IPC::Message> msg__ = PMFMediaEngine::Msg_UpdateCurrentTime(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), currentTimeInSecond);
// Sentinel = 'currentTimeInSecond'
((&(writer__)))->WriteSentinel(1304102822);
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PMFMediaEngine::Msg_UpdateCurrentTime", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PMFMediaEngineParent::SendRequestSample(
const TrackType& type,
const bool& isEnough) -> bool
{
UniquePtr<IPC::Message> msg__ = PMFMediaEngine::Msg_RequestSample(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), type);
// Sentinel = 'type'
((&(writer__)))->WriteSentinel(75760067);
IPC::WriteParam((&(writer__)), isEnough);
// Sentinel = 'isEnough'
((&(writer__)))->WriteSentinel(243925827);
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PMFMediaEngine::Msg_RequestSample", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PMFMediaEngineParent::SendUpdateStatisticData(const StatisticData& data) -> bool
{
UniquePtr<IPC::Message> msg__ = PMFMediaEngine::Msg_UpdateStatisticData(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), data);
// Sentinel = 'data'
((&(writer__)))->WriteSentinel(67109275);
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PMFMediaEngine::Msg_UpdateStatisticData", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PMFMediaEngineParent::SendNotifyResizing(
const uint32_t& width,
const uint32_t& height) -> bool
{
UniquePtr<IPC::Message> msg__ = PMFMediaEngine::Msg_NotifyResizing(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), width);
// Sentinel = 'width'
((&(writer__)))->WriteSentinel(108528161);
IPC::WriteParam((&(writer__)), height);
// Sentinel = 'height'
((&(writer__)))->WriteSentinel(143393402);
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PMFMediaEngine::Msg_NotifyResizing", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PMFMediaEngineParent::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PMFMediaEngineParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PMFMediaEngineParent::OnMessageReceived(const Message& msg__) -> PMFMediaEngineParent::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 PMFMediaEngine::Msg_InitMediaEngine__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFMediaEngine::Msg_InitMediaEngine", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__info = IPC::ReadParam<MediaEngineInfoIPDL>((&(reader__)));
if (!maybe__info) {
FatalError("Error deserializing 'MediaEngineInfoIPDL'");
return MsgValueError;
}
auto& info = *maybe__info;
// Sentinel = 'info'
if ((!(((&(reader__)))->ReadSentinel(70058413)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'MediaEngineInfoIPDL'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = Id();
UniquePtr<IPC::Message> reply__(PMFMediaEngine::Reply_InitMediaEngine(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
InitMediaEngineResolver resolver = [resolver__ = std::move(resolver__)](const uint64_t& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'id'
((&(writer__)))->WriteSentinel(20447438);
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (static_cast<MFMediaEngineParent*>(this))->RecvInitMediaEngine(std::move(info), std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PMFMediaEngine::Msg_Play__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFMediaEngine::Msg_Play", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<MFMediaEngineParent*>(this))->RecvPlay();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PMFMediaEngine::Msg_Pause__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFMediaEngine::Msg_Pause", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<MFMediaEngineParent*>(this))->RecvPause();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PMFMediaEngine::Msg_Seek__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFMediaEngine::Msg_Seek", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__targetTimeInSecond = IPC::ReadParam<double>((&(reader__)));
if (!maybe__targetTimeInSecond) {
FatalError("Error deserializing 'double'");
return MsgValueError;
}
auto& targetTimeInSecond = *maybe__targetTimeInSecond;
// Sentinel = 'targetTimeInSecond'
if ((!(((&(reader__)))->ReadSentinel(1154352938)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'double'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<MFMediaEngineParent*>(this))->RecvSeek(std::move(targetTimeInSecond));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PMFMediaEngine::Msg_SetCDMProxyId__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFMediaEngine::Msg_SetCDMProxyId", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__type = IPC::ReadParam<uint64_t>((&(reader__)));
if (!maybe__type) {
FatalError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto& type = *maybe__type;
// Sentinel = 'type'
if ((!(((&(reader__)))->ReadSentinel(75760067)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<MFMediaEngineParent*>(this))->RecvSetCDMProxyId(std::move(type));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PMFMediaEngine::Msg_SetVolume__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFMediaEngine::Msg_SetVolume", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__volume = IPC::ReadParam<double>((&(reader__)));
if (!maybe__volume) {
FatalError("Error deserializing 'double'");
return MsgValueError;
}
auto& volume = *maybe__volume;
// Sentinel = 'volume'
if ((!(((&(reader__)))->ReadSentinel(155386521)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'double'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<MFMediaEngineParent*>(this))->RecvSetVolume(std::move(volume));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PMFMediaEngine::Msg_SetPlaybackRate__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFMediaEngine::Msg_SetPlaybackRate", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__playbackRate = IPC::ReadParam<double>((&(reader__)));
if (!maybe__playbackRate) {
FatalError("Error deserializing 'double'");
return MsgValueError;
}
auto& playbackRate = *maybe__playbackRate;
// Sentinel = 'playbackRate'
if ((!(((&(reader__)))->ReadSentinel(533923028)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'double'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<MFMediaEngineParent*>(this))->RecvSetPlaybackRate(std::move(playbackRate));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PMFMediaEngine::Msg_SetLooping__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFMediaEngine::Msg_SetLooping", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__looping = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__looping) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& looping = *maybe__looping;
// Sentinel = 'looping'
if ((!(((&(reader__)))->ReadSentinel(201196281)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<MFMediaEngineParent*>(this))->RecvSetLooping(std::move(looping));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PMFMediaEngine::Msg_NotifyEndOfStream__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFMediaEngine::Msg_NotifyEndOfStream", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__type = IPC::ReadParam<TrackType>((&(reader__)));
if (!maybe__type) {
FatalError("Error deserializing 'TrackType'");
return MsgValueError;
}
auto& type = *maybe__type;
// Sentinel = 'type'
if ((!(((&(reader__)))->ReadSentinel(75760067)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'TrackType'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<MFMediaEngineParent*>(this))->RecvNotifyEndOfStream(std::move(type));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PMFMediaEngine::Msg_Shutdown__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFMediaEngine::Msg_Shutdown", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<MFMediaEngineParent*>(this))->RecvShutdown();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PMFMediaEngine::Msg___delete____ID:
{
if (mozilla::ipc::LoggingEnabledFor("PMFMediaEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PMFMediaEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PMFMediaEngine::Msg___delete__", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<MFMediaEngineParent*>(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;
}
default:
return MsgNotKnown;
}
}
auto PMFMediaEngineParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PMFMediaEngineParent::Result
{
return MsgNotKnown;
}
auto PMFMediaEngineParent::DoomSubtree() -> void
{
SetDoomed();
}
auto PMFMediaEngineParent::PeekManagedActor() -> IProtocol*
{
return nullptr;
}
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::PMFMediaEngineParent*>::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::PMFMediaEngineParent*>::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, "PMFMediaEngine", PMFMediaEngineMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::PMFMediaEngineParent*>(actor.ref());
}
return {};
}
} // namespace IPC