Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/PWebBrowserPersistDocumentChild.h"
#include "mozilla/AntiTrackingIPCUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/WebBrowserPersistDocumentChild.h"
#include "mozilla/dom/FetchIPCTypes.h"
#include "mozilla/dom/PropertyBagUtils.h"
#include "mozilla/dom/ReferrerInfoUtils.h"
#include "mozilla/dom/SessionHistoryEntry.h"
#include "mozilla/ipc/IPCCore.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 "nsIPropertyBag2.h"
#include "nsIReferrerInfo.h"
#include "mozilla/dom/PContentChild.h"
#include "mozilla/PWebBrowserPersistResourcesChild.h"
#include "mozilla/PWebBrowserPersistSerializeChild.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 PWebBrowserPersistDocumentChild::RecvPWebBrowserPersistResourcesConstructor(PWebBrowserPersistResourcesChild* actor) -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
auto PWebBrowserPersistDocumentChild::RecvPWebBrowserPersistSerializeConstructor(
PWebBrowserPersistSerializeChild* actor,
const WebBrowserPersistURIMap& aMap,
const nsACString& aRequestedContentType,
const uint32_t& aEncoderFlags,
const uint32_t& aWrapColumn) -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
auto PWebBrowserPersistDocumentChild::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
MOZ_IMPLICIT PWebBrowserPersistDocumentChild::PWebBrowserPersistDocumentChild() :
mozilla::ipc::IRefCountedProtocol(PWebBrowserPersistDocumentMsgStart, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PWebBrowserPersistDocumentChild);
}
PWebBrowserPersistDocumentChild::~PWebBrowserPersistDocumentChild()
{
MOZ_COUNT_DTOR(PWebBrowserPersistDocumentChild);
}
auto PWebBrowserPersistDocumentChild::ActorAlloc() -> void
{
AddRef();
}
auto PWebBrowserPersistDocumentChild::ActorDealloc() -> void
{
Release();
}
auto PWebBrowserPersistDocumentChild::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PWebBrowserPersistDocumentChild::Manager() const -> PContentChild*
{
return static_cast<PContentChild*>(IProtocol::Manager());
}
auto PWebBrowserPersistDocumentChild::ManagedPWebBrowserPersistResourcesChild(nsTArray<PWebBrowserPersistResourcesChild*>& aArr) const -> void
{
mManagedPWebBrowserPersistResourcesChild.ToArray(aArr);
}
auto PWebBrowserPersistDocumentChild::ManagedPWebBrowserPersistResourcesChild() const -> const ManagedContainer<PWebBrowserPersistResourcesChild>&
{
return mManagedPWebBrowserPersistResourcesChild;
}
auto PWebBrowserPersistDocumentChild::ManagedPWebBrowserPersistSerializeChild(nsTArray<PWebBrowserPersistSerializeChild*>& aArr) const -> void
{
mManagedPWebBrowserPersistSerializeChild.ToArray(aArr);
}
auto PWebBrowserPersistDocumentChild::ManagedPWebBrowserPersistSerializeChild() const -> const ManagedContainer<PWebBrowserPersistSerializeChild>&
{
return mManagedPWebBrowserPersistSerializeChild;
}
auto PWebBrowserPersistDocumentChild::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
total += mManagedPWebBrowserPersistResourcesChild.Count();
total += mManagedPWebBrowserPersistSerializeChild.Count();
return total;
}
auto PWebBrowserPersistDocumentChild::OpenPWebBrowserPersistResourcesEndpoint(PWebBrowserPersistResourcesChild* aActor) -> ManagedEndpoint<PWebBrowserPersistResourcesParent>
{
if (!aActor) {
NS_WARNING("Cannot bind null PWebBrowserPersistResourcesChild actor");
return ManagedEndpoint<PWebBrowserPersistResourcesParent>();
}
if (aActor->SetManagerAndRegister(this)) {
mManagedPWebBrowserPersistResourcesChild.Insert(aActor);
} else {
NS_WARNING("Failed to bind PWebBrowserPersistResourcesChild actor");
return ManagedEndpoint<PWebBrowserPersistResourcesParent>();
}
// Mark our actor as awaiting the other side to be bound. This will
// be cleared when a `MANAGED_ENDPOINT_{DROPPED,BOUND}` message is
// received.
aActor->mAwaitingManagedEndpointBind = true;
return ManagedEndpoint<PWebBrowserPersistResourcesParent>(mozilla::ipc::PrivateIPDLInterface(), aActor);
}
auto PWebBrowserPersistDocumentChild::BindPWebBrowserPersistResourcesEndpoint(
ManagedEndpoint<PWebBrowserPersistResourcesChild> aEndpoint,
PWebBrowserPersistResourcesChild* aActor) -> bool
{
return aEndpoint.Bind(mozilla::ipc::PrivateIPDLInterface(), aActor, this, mManagedPWebBrowserPersistResourcesChild);
}
auto PWebBrowserPersistDocumentChild::OpenPWebBrowserPersistSerializeEndpoint(PWebBrowserPersistSerializeChild* aActor) -> ManagedEndpoint<PWebBrowserPersistSerializeParent>
{
if (!aActor) {
NS_WARNING("Cannot bind null PWebBrowserPersistSerializeChild actor");
return ManagedEndpoint<PWebBrowserPersistSerializeParent>();
}
if (aActor->SetManagerAndRegister(this)) {
mManagedPWebBrowserPersistSerializeChild.Insert(aActor);
} else {
NS_WARNING("Failed to bind PWebBrowserPersistSerializeChild actor");
return ManagedEndpoint<PWebBrowserPersistSerializeParent>();
}
// Mark our actor as awaiting the other side to be bound. This will
// be cleared when a `MANAGED_ENDPOINT_{DROPPED,BOUND}` message is
// received.
aActor->mAwaitingManagedEndpointBind = true;
return ManagedEndpoint<PWebBrowserPersistSerializeParent>(mozilla::ipc::PrivateIPDLInterface(), aActor);
}
auto PWebBrowserPersistDocumentChild::BindPWebBrowserPersistSerializeEndpoint(
ManagedEndpoint<PWebBrowserPersistSerializeChild> aEndpoint,
PWebBrowserPersistSerializeChild* aActor) -> bool
{
return aEndpoint.Bind(mozilla::ipc::PrivateIPDLInterface(), aActor, this, mManagedPWebBrowserPersistSerializeChild);
}
auto PWebBrowserPersistDocumentChild::SendAttributes(
const WebBrowserPersistDocumentAttrs& aAttrs,
const mozilla::Maybe<IPCStream>& stream) -> bool
{
UniquePtr<IPC::Message> msg__ = PWebBrowserPersistDocument::Msg_Attributes(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aAttrs);
// Sentinel = 'aAttrs'
((&(writer__)))->WriteSentinel(135529072);
IPC::WriteParam((&(writer__)), stream);
// Sentinel = 'stream'
((&(writer__)))->WriteSentinel(153223821);
if (mozilla::ipc::LoggingEnabledFor("PWebBrowserPersistDocument", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebBrowserPersistDocumentChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebBrowserPersistDocument::Msg_Attributes", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWebBrowserPersistDocumentChild::SendInitFailure(const nsresult& aStatus) -> bool
{
UniquePtr<IPC::Message> msg__ = PWebBrowserPersistDocument::Msg_InitFailure(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aStatus);
// Sentinel = 'aStatus'
((&(writer__)))->WriteSentinel(186712806);
if (mozilla::ipc::LoggingEnabledFor("PWebBrowserPersistDocument", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebBrowserPersistDocumentChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWebBrowserPersistDocument::Msg_InitFailure", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWebBrowserPersistDocumentChild::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
switch (aProtocolId) {
case PWebBrowserPersistResourcesMsgStart:
MOZ_ALWAYS_TRUE(mManagedPWebBrowserPersistResourcesChild.EnsureRemoved(static_cast<PWebBrowserPersistResourcesChild*>(aListener)));
return;
case PWebBrowserPersistSerializeMsgStart:
MOZ_ALWAYS_TRUE(mManagedPWebBrowserPersistSerializeChild.EnsureRemoved(static_cast<PWebBrowserPersistSerializeChild*>(aListener)));
return;
default:
FatalError("unreached");
return; }
}
auto PWebBrowserPersistDocumentChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
switch (aProtocolId) {
case PWebBrowserPersistResourcesMsgStart:
static_cast<WebBrowserPersistDocumentChild*>(this)->DeallocPWebBrowserPersistResourcesChild(static_cast<PWebBrowserPersistResourcesChild*>(aListener));
return;
case PWebBrowserPersistSerializeMsgStart:
static_cast<WebBrowserPersistDocumentChild*>(this)->DeallocPWebBrowserPersistSerializeChild(static_cast<PWebBrowserPersistSerializeChild*>(aListener));
return;
default:
FatalError("unreached");
return;
}
}
auto PWebBrowserPersistDocumentChild::OnMessageReceived(const Message& msg__) -> PWebBrowserPersistDocumentChild::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 PWebBrowserPersistDocument::Msg_SetPersistFlags__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebBrowserPersistDocument", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebBrowserPersistDocumentChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebBrowserPersistDocument::Msg_SetPersistFlags", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aNewFlags = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__aNewFlags) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& aNewFlags = *maybe__aNewFlags;
// Sentinel = 'aNewFlags'
if ((!(((&(reader__)))->ReadSentinel(283181945)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WebBrowserPersistDocumentChild*>(this))->RecvSetPersistFlags(std::move(aNewFlags));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWebBrowserPersistDocument::Msg_PWebBrowserPersistResourcesConstructor__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebBrowserPersistDocument", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebBrowserPersistDocumentChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebBrowserPersistDocument::Msg_PWebBrowserPersistResourcesConstructor", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__handle__ = IPC::ReadParam<ActorHandle>((&(reader__)));
if (!maybe__handle__) {
FatalError("Error deserializing 'ActorHandle'");
return MsgValueError;
}
auto& handle__ = *maybe__handle__;
// Sentinel = 'actor'
if ((!(((&(reader__)))->ReadSentinel(102892058)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'");
return MsgValueError;
}
reader__.EndRead();
PWebBrowserPersistResourcesChild* actor = (static_cast<WebBrowserPersistDocumentChild*>(this))->AllocPWebBrowserPersistResourcesChild();
if (!actor) {
NS_WARNING("Cannot bind null PWebBrowserPersistResourcesChild actor");
return MsgValueError;
}
if (actor->SetManagerAndRegister(this, (handle__).mId)) {
mManagedPWebBrowserPersistResourcesChild.Insert(actor);
} else {
NS_WARNING("Failed to bind PWebBrowserPersistResourcesChild actor");
return MsgValueError;
}
mozilla::ipc::IPCResult __ok = (static_cast<WebBrowserPersistDocumentChild*>(this))->RecvPWebBrowserPersistResourcesConstructor(std::move(actor));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWebBrowserPersistDocument::Msg_PWebBrowserPersistSerializeConstructor__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebBrowserPersistDocument", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebBrowserPersistDocumentChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebBrowserPersistDocument::Msg_PWebBrowserPersistSerializeConstructor", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__handle__ = IPC::ReadParam<ActorHandle>((&(reader__)));
if (!maybe__handle__) {
FatalError("Error deserializing 'ActorHandle'");
return MsgValueError;
}
auto& handle__ = *maybe__handle__;
// Sentinel = 'actor'
if ((!(((&(reader__)))->ReadSentinel(102892058)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'");
return MsgValueError;
}
auto maybe__aMap = IPC::ReadParam<WebBrowserPersistURIMap>((&(reader__)));
if (!maybe__aMap) {
FatalError("Error deserializing 'WebBrowserPersistURIMap'");
return MsgValueError;
}
auto& aMap = *maybe__aMap;
// Sentinel = 'aMap'
if ((!(((&(reader__)))->ReadSentinel(60883328)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'WebBrowserPersistURIMap'");
return MsgValueError;
}
auto maybe__aRequestedContentType = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__aRequestedContentType) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& aRequestedContentType = *maybe__aRequestedContentType;
// Sentinel = 'aRequestedContentType'
if ((!(((&(reader__)))->ReadSentinel(1563297937)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto maybe__aEncoderFlags = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__aEncoderFlags) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& aEncoderFlags = *maybe__aEncoderFlags;
// Sentinel = 'aEncoderFlags'
if ((!(((&(reader__)))->ReadSentinel(582354191)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto maybe__aWrapColumn = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__aWrapColumn) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& aWrapColumn = *maybe__aWrapColumn;
// Sentinel = 'aWrapColumn'
if ((!(((&(reader__)))->ReadSentinel(432669802)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
reader__.EndRead();
PWebBrowserPersistSerializeChild* actor = (static_cast<WebBrowserPersistDocumentChild*>(this))->AllocPWebBrowserPersistSerializeChild(aMap, aRequestedContentType, aEncoderFlags, aWrapColumn);
if (!actor) {
NS_WARNING("Cannot bind null PWebBrowserPersistSerializeChild actor");
return MsgValueError;
}
if (actor->SetManagerAndRegister(this, (handle__).mId)) {
mManagedPWebBrowserPersistSerializeChild.Insert(actor);
} else {
NS_WARNING("Failed to bind PWebBrowserPersistSerializeChild actor");
return MsgValueError;
}
mozilla::ipc::IPCResult __ok = (static_cast<WebBrowserPersistDocumentChild*>(this))->RecvPWebBrowserPersistSerializeConstructor(std::move(actor), std::move(aMap), std::move(aRequestedContentType), std::move(aEncoderFlags), std::move(aWrapColumn));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWebBrowserPersistDocument::Msg___delete____ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWebBrowserPersistDocument", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWebBrowserPersistDocumentChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWebBrowserPersistDocument::Msg___delete__", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<WebBrowserPersistDocumentChild*>(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 PWebBrowserPersistDocumentChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PWebBrowserPersistDocumentChild::Result
{
return MsgNotKnown;
}
auto PWebBrowserPersistDocumentChild::DoomSubtree() -> void
{
for (auto* key : mManagedPWebBrowserPersistResourcesChild) {
key->DoomSubtree();
}
for (auto* key : mManagedPWebBrowserPersistSerializeChild) {
key->DoomSubtree();
}
SetDoomed();
}
auto PWebBrowserPersistDocumentChild::PeekManagedActor() -> IProtocol*
{
if (IProtocol* actor = mManagedPWebBrowserPersistResourcesChild.Peek()) {
return actor;
}
if (IProtocol* actor = mManagedPWebBrowserPersistSerializeChild.Peek()) {
return actor;
}
return nullptr;
}
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::PWebBrowserPersistDocumentChild*>::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::PWebBrowserPersistDocumentChild*>::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, "PWebBrowserPersistDocument", PWebBrowserPersistDocumentMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::PWebBrowserPersistDocumentChild*>(actor.ref());
}
return {};
}
} // namespace IPC