Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/PFetchEventOpParent.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/RemoteLazyInputStream.h"
#include "mozilla/dom/FetchEventOpParent.h"
#include "mozilla/dom/FetchIPCTypes.h"
#include "mozilla/dom/ServiceWorkerIPCUtils.h"
#include "mozilla/ipc/TransportSecurityInfoUtils.h"
#include "nsID.h"
#include "nsITransportSecurityInfo.h"
#include "mozilla/dom/PRemoteWorkerControllerParent.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 dom {
MOZ_IMPLICIT PFetchEventOpParent::PFetchEventOpParent() :
mozilla::ipc::IProtocol(PFetchEventOpMsgStart, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PFetchEventOpParent);
}
PFetchEventOpParent::~PFetchEventOpParent()
{
MOZ_COUNT_DTOR(PFetchEventOpParent);
}
auto PFetchEventOpParent::ActorAlloc() -> void
{
}
auto PFetchEventOpParent::ActorDealloc() -> void
{
if (Manager()) {
Manager()->DeallocManagee(PFetchEventOpMsgStart, this);
}
}
auto PFetchEventOpParent::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PFetchEventOpParent::Manager() const -> PRemoteWorkerControllerParent*
{
return static_cast<PRemoteWorkerControllerParent*>(IProtocol::Manager());
}
auto PFetchEventOpParent::AllManagedActors(nsTArray<RefPtr<mozilla::ipc::ActorLifecycleProxy>>& arr__) const -> void
{
uint32_t total = 0;
arr__.SetCapacity(total);
}
auto PFetchEventOpParent::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PFetchEventOpParent::SendAsyncLog(
const nsACString& aScriptSpec,
const uint32_t& aLineNumber,
const uint32_t& aColumnNumber,
const nsACString& aMessageName,
mozilla::Span<nsString const> aParams) -> bool
{
UniquePtr<IPC::Message> msg__ = PFetchEventOp::Msg_AsyncLog(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aScriptSpec);
// Sentinel = 'aScriptSpec'
((&(writer__)))->WriteSentinel(436929634);
IPC::WriteParam((&(writer__)), aLineNumber);
// Sentinel = 'aLineNumber'
((&(writer__)))->WriteSentinel(423953491);
IPC::WriteParam((&(writer__)), aColumnNumber);
// Sentinel = 'aColumnNumber'
((&(writer__)))->WriteSentinel(601163065);
IPC::WriteParam((&(writer__)), aMessageName);
// Sentinel = 'aMessageName'
((&(writer__)))->WriteSentinel(505414824);
IPC::WriteParam((&(writer__)), aParams);
// Sentinel = 'aParams'
((&(writer__)))->WriteSentinel(178979526);
if (mozilla::ipc::LoggingEnabledFor("PFetchEventOp", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFetchEventOpParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PFetchEventOp::Msg_AsyncLog", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PFetchEventOpParent::SendRespondWith(const ParentToParentFetchEventRespondWithResult& aResult) -> bool
{
UniquePtr<IPC::Message> msg__ = PFetchEventOp::Msg_RespondWith(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aResult);
// Sentinel = 'aResult'
((&(writer__)))->WriteSentinel(185205473);
if (mozilla::ipc::LoggingEnabledFor("PFetchEventOp", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFetchEventOpParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PFetchEventOp::Msg_RespondWith", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PFetchEventOpParent::Send__delete__(
PFetchEventOpParent* actor,
const ServiceWorkerFetchEventOpResult& aResult) -> bool
{
if (!actor || !actor->CanSend()) {
NS_WARNING("Attempt to __delete__ missing or closed actor");
return false;
}
UniquePtr<IPC::Message> msg__ = PFetchEventOp::Msg___delete__((actor)->Id());
IPC::MessageWriter writer__{
(*(msg__)),
actor};
IPC::WriteParam((&(writer__)), aResult);
// Sentinel = 'aResult'
((&(writer__)))->WriteSentinel(185205473);
if (mozilla::ipc::LoggingEnabledFor("PFetchEventOp", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFetchEventOpParent",
actor->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PFetchEventOp::Msg___delete__", OTHER);
bool sendok__ = (actor)->ChannelSend(std::move(msg__));
IProtocol* mgr = actor->Manager();
actor->DestroySubtree(Deletion);
actor->ClearSubtree();
mgr->RemoveManagee(PFetchEventOpMsgStart, actor);
return sendok__;
}
auto PFetchEventOpParent::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PFetchEventOpParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PFetchEventOpParent::OnMessageReceived(const Message& msg__) -> PFetchEventOpParent::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;
IProtocol* mgr = this->Manager();
this->DestroySubtree(ManagedEndpointDropped);
this->ClearSubtree();
mgr->RemoveManagee(PFetchEventOpMsgStart, this);
return MsgProcessed;
}
case PFetchEventOp::Msg_PreloadResponse__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PFetchEventOp", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFetchEventOpParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PFetchEventOp::Msg_PreloadResponse", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aResponse = IPC::ReadParam<ParentToParentInternalResponse>((&(reader__)));
if (!maybe__aResponse) {
FatalError("Error deserializing 'ParentToParentInternalResponse'");
return MsgValueError;
}
auto& aResponse = *maybe__aResponse;
// Sentinel = 'aResponse'
if ((!(((&(reader__)))->ReadSentinel(301466545)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ParentToParentInternalResponse'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<FetchEventOpParent*>(this))->RecvPreloadResponse(std::move(aResponse));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PFetchEventOp::Msg_PreloadResponseTiming__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PFetchEventOp", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFetchEventOpParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PFetchEventOp::Msg_PreloadResponseTiming", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aTiming = IPC::ReadParam<ResponseTiming>((&(reader__)));
if (!maybe__aTiming) {
FatalError("Error deserializing 'ResponseTiming'");
return MsgValueError;
}
auto& aTiming = *maybe__aTiming;
// Sentinel = 'aTiming'
if ((!(((&(reader__)))->ReadSentinel(182780618)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ResponseTiming'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<FetchEventOpParent*>(this))->RecvPreloadResponseTiming(std::move(aTiming));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PFetchEventOp::Msg_PreloadResponseEnd__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PFetchEventOp", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFetchEventOpParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PFetchEventOp::Msg_PreloadResponseEnd", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aArgs = IPC::ReadParam<ResponseEndArgs>((&(reader__)));
if (!maybe__aArgs) {
FatalError("Error deserializing 'ResponseEndArgs'");
return MsgValueError;
}
auto& aArgs = *maybe__aArgs;
// Sentinel = 'aArgs'
if ((!(((&(reader__)))->ReadSentinel(92602863)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ResponseEndArgs'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<FetchEventOpParent*>(this))->RecvPreloadResponseEnd(std::move(aArgs));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PFetchEventOp::Reply___delete____ID:
{
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PFetchEventOpParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PFetchEventOpParent::Result
{
return MsgNotKnown;
}
auto PFetchEventOpParent::ClearSubtree() -> void
{
}
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::PFetchEventOpParent*>::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::dom::PFetchEventOpParent*>::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, "PFetchEventOp", PFetchEventOpMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::dom::PFetchEventOpParent*>(actor.ref());
}
return {};
}
} // namespace IPC