Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/ipc/PUtilityAudioDecoderParent.h"
#include "mozilla/D3DMessageUtils.h"
#include "mozilla/GfxMessageUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/ipc/IPCCore.h"
#include "mozilla/ipc/UtilityAudioDecoderParent.h"
#include "mozilla/PRemoteDecoderManagerParent.h"
#include "mozilla/layers/PVideoBridgeParent.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 ipc {
auto PUtilityAudioDecoderParent::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PUtilityAudioDecoderParent::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PUtilityAudioDecoderParent::PUtilityAudioDecoderParent() :
mozilla::ipc::IToplevelProtocol("PUtilityAudioDecoderParent", kProtocolId, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PUtilityAudioDecoderParent);
}
PUtilityAudioDecoderParent::~PUtilityAudioDecoderParent()
{
MOZ_COUNT_DTOR(PUtilityAudioDecoderParent);
}
auto PUtilityAudioDecoderParent::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsUtilityProcess(), "Invalid process for `PUtilityAudioDecoderParent'");
AddRef();
}
auto PUtilityAudioDecoderParent::ActorDealloc() -> void
{
Release();
}
auto PUtilityAudioDecoderParent::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PUtilityAudioDecoderParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PUtilityAudioDecoderParent::RejectPendingResponses(ResponseRejectReason aReason) -> void
{
mAsyncCallbacks.RejectPendingResponses(aReason);
}
auto PUtilityAudioDecoderParent::SendUpdateMediaCodecsSupported(
const RemoteDecodeIn& aLocation,
const MediaCodecsSupported& aSupported) -> bool
{
UniquePtr<IPC::Message> msg__ = PUtilityAudioDecoder::Msg_UpdateMediaCodecsSupported(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aLocation);
// Sentinel = 'aLocation'
((&(writer__)))->WriteSentinel(292094875);
IPC::WriteParam((&(writer__)), aSupported);
// Sentinel = 'aSupported'
((&(writer__)))->WriteSentinel(378799144);
if (mozilla::ipc::LoggingEnabledFor("PUtilityAudioDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityAudioDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PUtilityAudioDecoder::Msg_UpdateMediaCodecsSupported", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PUtilityAudioDecoderParent::SendCompleteCreatedVideoBridge() -> bool
{
UniquePtr<IPC::Message> msg__ = PUtilityAudioDecoder::Msg_CompleteCreatedVideoBridge(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PUtilityAudioDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityAudioDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PUtilityAudioDecoder::Msg_CompleteCreatedVideoBridge", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PUtilityAudioDecoderParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PUtilityAudioDecoderParent::OnMessageReceived(const Message& msg__) -> PUtilityAudioDecoderParent::Result
{
switch (msg__.type()) {
case PUtilityAudioDecoder::Msg_NewContentRemoteDecoderManager__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityAudioDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityAudioDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityAudioDecoder::Msg_NewContentRemoteDecoderManager", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__endpoint = IPC::ReadParam<Endpoint<::mozilla::PRemoteDecoderManagerParent>>((&(reader__)));
if (!maybe__endpoint) {
FatalError("Error deserializing 'Endpoint<::mozilla::PRemoteDecoderManagerParent>'");
return MsgValueError;
}
auto& endpoint = *maybe__endpoint;
// Sentinel = 'endpoint'
if ((!(((&(reader__)))->ReadSentinel(251724642)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'Endpoint<::mozilla::PRemoteDecoderManagerParent>'");
return MsgValueError;
}
auto maybe__parentId = IPC::ReadParam<ContentParentId>((&(reader__)));
if (!maybe__parentId) {
FatalError("Error deserializing 'ContentParentId'");
return MsgValueError;
}
auto& parentId = *maybe__parentId;
// Sentinel = 'parentId'
if ((!(((&(reader__)))->ReadSentinel(249430840)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ContentParentId'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UtilityAudioDecoderParent*>(this))->RecvNewContentRemoteDecoderManager(std::move(endpoint), std::move(parentId));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUtilityAudioDecoder::Msg_InitVideoBridge__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityAudioDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityAudioDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityAudioDecoder::Msg_InitVideoBridge", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__endpoint = IPC::ReadParam<Endpoint<::mozilla::layers::PVideoBridgeChild>>((&(reader__)));
if (!maybe__endpoint) {
FatalError("Error deserializing 'Endpoint<::mozilla::layers::PVideoBridgeChild>'");
return MsgValueError;
}
auto& endpoint = *maybe__endpoint;
// Sentinel = 'endpoint'
if ((!(((&(reader__)))->ReadSentinel(251724642)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'Endpoint<::mozilla::layers::PVideoBridgeChild>'");
return MsgValueError;
}
auto maybe__contentDeviceData = IPC::ReadParam<ContentDeviceData>((&(reader__)));
if (!maybe__contentDeviceData) {
FatalError("Error deserializing 'ContentDeviceData'");
return MsgValueError;
}
auto& contentDeviceData = *maybe__contentDeviceData;
// Sentinel = 'contentDeviceData'
if ((!(((&(reader__)))->ReadSentinel(1043203782)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ContentDeviceData'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UtilityAudioDecoderParent*>(this))->RecvInitVideoBridge(std::move(endpoint), std::move(contentDeviceData));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUtilityAudioDecoder::Msg_UpdateVar__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityAudioDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityAudioDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityAudioDecoder::Msg_UpdateVar", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__var = IPC::ReadParam<GfxVarUpdate>((&(reader__)));
if (!maybe__var) {
FatalError("Error deserializing 'GfxVarUpdate'");
return MsgValueError;
}
auto& var = *maybe__var;
// Sentinel = 'var'
if ((!(((&(reader__)))->ReadSentinel(43581770)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'GfxVarUpdate'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UtilityAudioDecoderParent*>(this))->RecvUpdateVar(std::move(var));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUtilityAudioDecoder::Msg_GetKeySystemCapabilities__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityAudioDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityAudioDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityAudioDecoder::Msg_GetKeySystemCapabilities", OTHER);
int32_t id__ = MSG_ROUTING_CONTROL;
UniquePtr<IPC::Message> reply__(PUtilityAudioDecoder::Reply_GetKeySystemCapabilities(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
GetKeySystemCapabilitiesResolver resolver = [resolver__ = std::move(resolver__)](mozilla::Span<MFCDMCapabilitiesIPDL const> aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'result'
((&(writer__)))->WriteSentinel(153223840);
if (mozilla::ipc::LoggingEnabledFor("PUtilityAudioDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityAudioDecoderParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (static_cast<UtilityAudioDecoderParent*>(this))->RecvGetKeySystemCapabilities(std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PUtilityAudioDecoder::Msg_UpdateWidevineL1Path__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PUtilityAudioDecoder", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PUtilityAudioDecoderParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PUtilityAudioDecoder::Msg_UpdateWidevineL1Path", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__path = IPC::ReadParam<nsString>((&(reader__)));
if (!maybe__path) {
FatalError("Error deserializing 'nsString'");
return MsgValueError;
}
auto& path = *maybe__path;
// Sentinel = 'path'
if ((!(((&(reader__)))->ReadSentinel(70713774)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<UtilityAudioDecoderParent*>(this))->RecvUpdateWidevineL1Path(std::move(path));
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 PUtilityAudioDecoderParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PUtilityAudioDecoderParent::Result
{
MOZ_ASSERT_UNREACHABLE("message protocol not supported");
return MsgNotKnown;
}
} // namespace ipc
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::ipc::PUtilityAudioDecoderParent*>::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::ipc::PUtilityAudioDecoderParent*>::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, "PUtilityAudioDecoder", PUtilityAudioDecoderMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::ipc::PUtilityAudioDecoderParent*>(actor.ref());
}
return {};
}
} // namespace IPC