Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/PFetchParent.h"
#include "ipc/ErrorIPCUtils.h"
#include "mozilla/AntiTrackingIPCUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/RemoteLazyInputStream.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/dom/BindingIPCUtils.h"
#include "mozilla/dom/ClientIPCUtils.h"
#include "mozilla/dom/FetchIPCTypes.h"
#include "mozilla/dom/FetchParent.h"
#include "mozilla/dom/PropertyBagUtils.h"
#include "mozilla/dom/ReferrerInfoUtils.h"
#include "mozilla/dom/ServiceWorkerIPCUtils.h"
#include "mozilla/dom/SessionHistoryEntry.h"
#include "mozilla/ipc/IPCCore.h"
#include "mozilla/ipc/TransportSecurityInfoUtils.h"
#include "mozilla/ipc/URIUtils.h"
#include "mozilla/net/CacheInfoIPCTypes.h"
#include "mozilla/net/ClassOfService.h"
#include "nsDOMNavigationTiming.h"
#include "nsDocShellLoadState.h"
#include "nsHttp.h"
#include "nsHttpResponseHead.h"
#include "nsID.h"
#include "nsIPropertyBag2.h"
#include "nsITransportSecurityInfo.h"
#include "mozilla/ipc/PBackgroundParent.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 PFetchParent::PFetchParent() :
mozilla::ipc::IRefCountedProtocol(PFetchMsgStart, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PFetchParent);
}
PFetchParent::~PFetchParent()
{
MOZ_COUNT_DTOR(PFetchParent);
}
auto PFetchParent::ActorAlloc() -> void
{
AddRef();
}
auto PFetchParent::ActorDealloc() -> void
{
Release();
}
auto PFetchParent::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PFetchParent::Manager() const -> PBackgroundParent*
{
return static_cast<PBackgroundParent*>(IProtocol::Manager());
}
auto PFetchParent::AllManagedActors(nsTArray<RefPtr<mozilla::ipc::ActorLifecycleProxy>>& arr__) const -> void
{
uint32_t total = 0;
arr__.SetCapacity(total);
}
auto PFetchParent::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PFetchParent::SendOnResponseAvailableInternal(const ParentToChildInternalResponse& aResponse) -> bool
{
UniquePtr<IPC::Message> msg__ = PFetch::Msg_OnResponseAvailableInternal(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aResponse);
// Sentinel = 'aResponse'
((&(writer__)))->WriteSentinel(301466545);
if (mozilla::ipc::LoggingEnabledFor("PFetch", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFetchParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PFetch::Msg_OnResponseAvailableInternal", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PFetchParent::SendOnResponseEnd(const ResponseEndArgs& aResponseEndArgs) -> bool
{
UniquePtr<IPC::Message> msg__ = PFetch::Msg_OnResponseEnd(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aResponseEndArgs);
// Sentinel = 'aResponseEndArgs'
((&(writer__)))->WriteSentinel(903153237);
if (mozilla::ipc::LoggingEnabledFor("PFetch", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFetchParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PFetch::Msg_OnResponseEnd", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PFetchParent::SendOnDataAvailable() -> bool
{
UniquePtr<IPC::Message> msg__ = PFetch::Msg_OnDataAvailable(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PFetch", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFetchParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PFetch::Msg_OnDataAvailable", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PFetchParent::SendOnFlushConsoleReport(mozilla::Span<ConsoleReportCollected const> aReports) -> bool
{
UniquePtr<IPC::Message> msg__ = PFetch::Msg_OnFlushConsoleReport(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aReports);
// Sentinel = 'aReports'
((&(writer__)))->WriteSentinel(239666001);
if (mozilla::ipc::LoggingEnabledFor("PFetch", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFetchParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PFetch::Msg_OnFlushConsoleReport", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PFetchParent::SendOnCSPViolationEvent(const nsAString& aJSON) -> bool
{
UniquePtr<IPC::Message> msg__ = PFetch::Msg_OnCSPViolationEvent(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aJSON);
// Sentinel = 'aJSON'
((&(writer__)))->WriteSentinel(83296668);
if (mozilla::ipc::LoggingEnabledFor("PFetch", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFetchParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PFetch::Msg_OnCSPViolationEvent", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PFetchParent::SendOnReportPerformanceTiming(const ResponseTiming& aTiming) -> bool
{
UniquePtr<IPC::Message> msg__ = PFetch::Msg_OnReportPerformanceTiming(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aTiming);
// Sentinel = 'aTiming'
((&(writer__)))->WriteSentinel(182780618);
if (mozilla::ipc::LoggingEnabledFor("PFetch", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFetchParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PFetch::Msg_OnReportPerformanceTiming", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PFetchParent::SendOnNotifyNetworkMonitorAlternateStack(const uint64_t& aChannelID) -> bool
{
UniquePtr<IPC::Message> msg__ = PFetch::Msg_OnNotifyNetworkMonitorAlternateStack(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aChannelID);
// Sentinel = 'aChannelID'
((&(writer__)))->WriteSentinel(343802792);
if (mozilla::ipc::LoggingEnabledFor("PFetch", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFetchParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PFetch::Msg_OnNotifyNetworkMonitorAlternateStack", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PFetchParent::Send__delete__(
PFetchParent* actor,
const nsresult& aResult) -> bool
{
if (!actor || !actor->CanSend()) {
NS_WARNING("Attempt to __delete__ missing or closed actor");
return false;
}
UniquePtr<IPC::Message> msg__ = PFetch::Msg___delete__((actor)->Id());
IPC::MessageWriter writer__{
(*(msg__)),
actor};
IPC::WriteParam((&(writer__)), aResult);
// Sentinel = 'aResult'
((&(writer__)))->WriteSentinel(185205473);
if (mozilla::ipc::LoggingEnabledFor("PFetch", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFetchParent",
actor->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PFetch::Msg___delete__", OTHER);
bool sendok__ = (actor)->ChannelSend(std::move(msg__));
IProtocol* mgr = actor->Manager();
actor->DestroySubtree(Deletion);
actor->ClearSubtree();
mgr->RemoveManagee(PFetchMsgStart, actor);
return sendok__;
}
auto PFetchParent::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PFetchParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PFetchParent::OnMessageReceived(const Message& msg__) -> PFetchParent::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(PFetchMsgStart, this);
return MsgProcessed;
}
case PFetch::Msg_FetchOp__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PFetch", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFetchParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PFetch::Msg_FetchOp", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aArgs = IPC::ReadParam<FetchOpArgs>((&(reader__)));
if (!maybe__aArgs) {
FatalError("Error deserializing 'FetchOpArgs'");
return MsgValueError;
}
auto& aArgs = *maybe__aArgs;
// Sentinel = 'aArgs'
if ((!(((&(reader__)))->ReadSentinel(92602863)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'FetchOpArgs'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<FetchParent*>(this))->RecvFetchOp(std::move(aArgs));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PFetch::Msg_AbortFetchOp__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PFetch", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFetchParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PFetch::Msg_AbortFetchOp", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<FetchParent*>(this))->RecvAbortFetchOp();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PFetch::Reply___delete____ID:
{
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PFetchParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PFetchParent::Result
{
return MsgNotKnown;
}
auto PFetchParent::ClearSubtree() -> void
{
}
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::PFetchParent*>::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::PFetchParent*>::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, "PFetch", PFetchMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::dom::PFetchParent*>(actor.ref());
}
return {};
}
} // namespace IPC