Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/net/PDocumentChannelChild.h"
#include "mozilla/AntiTrackingIPCUtils.h"
#include "mozilla/GfxMessageUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/RemoteLazyInputStream.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/dom/CSPMessageUtils.h"
#include "mozilla/dom/DocShellMessageUtils.h"
#include "mozilla/dom/DomSecurityIPCUtils.h"
#include "mozilla/dom/FeaturePolicyUtils.h"
#include "mozilla/dom/FetchIPCTypes.h"
#include "mozilla/dom/PermissionMessageUtils.h"
#include "mozilla/dom/PropertyBagUtils.h"
#include "mozilla/dom/ReferrerInfoUtils.h"
#include "mozilla/dom/ServiceWorkerIPCUtils.h"
#include "mozilla/dom/SessionHistoryEntry.h"
#include "mozilla/dom/TabMessageUtils.h"
#include "mozilla/dom/notification/IPCUtils.h"
#include "mozilla/ipc/BigBuffer.h"
#include "mozilla/ipc/IPCCore.h"
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/SerializedStructuredCloneBuffer.h"
#include "mozilla/ipc/URIUtils.h"
#include "mozilla/layers/LayersMessageUtils.h"
#include "mozilla/net/CacheInfoIPCTypes.h"
#include "mozilla/net/ClassOfService.h"
#include "mozilla/net/DocumentChannelChild.h"
#include "mozilla/net/NeckoMessageUtils.h"
#include "nsDOMNavigationTiming.h"
#include "nsDocShellLoadState.h"
#include "nsHttp.h"
#include "nsHttpHeaderArray.h"
#include "nsHttpResponseHead.h"
#include "nsIContentSecurityPolicy.h"
#include "nsIPrincipal.h"
#include "nsIPropertyBag2.h"
#include "nsIReferrerInfo.h"
#include "nsIURI.h"
#include "nsIVariant.h"
#include "mozilla/net/PNeckoChild.h"
#include "mozilla/extensions/PStreamFilterChild.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 net {
MOZ_IMPLICIT PDocumentChannelChild::PDocumentChannelChild() :
mozilla::ipc::IRefCountedProtocol(kProtocolId, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PDocumentChannelChild);
}
PDocumentChannelChild::~PDocumentChannelChild()
{
MOZ_COUNT_DTOR(PDocumentChannelChild);
}
auto PDocumentChannelChild::ActorAlloc() -> void
{
AddRef();
}
auto PDocumentChannelChild::ActorDealloc() -> void
{
Release();
}
auto PDocumentChannelChild::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PDocumentChannelChild::OtherChildID() const -> ::GeckoChildID
{
::GeckoChildID childID =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid();
MOZ_RELEASE_ASSERT(childID != -1);
return childID;
}
auto PDocumentChannelChild::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo
{
return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()};
}
auto PDocumentChannelChild::Manager() const -> PNeckoChild*
{
return static_cast<PNeckoChild*>(IProtocol::Manager());
}
auto PDocumentChannelChild::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PDocumentChannelChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PDocumentChannelChild::RejectPendingResponses(ResponseRejectReason aReason) -> void
{
mAsyncCallbacks.RejectPendingResponses(aReason);
}
auto PDocumentChannelChild::SendCancel(
const nsresult& status,
const nsACString& reason) -> bool
{
UniquePtr<IPC::Message> msg__ = PDocumentChannel::Msg_Cancel(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), status);
// Sentinel = 'status'
((&(writer__)))->WriteSentinel(154731173);
IPC::WriteParam((&(writer__)), reason);
// Sentinel = 'reason'
((&(writer__)))->WriteSentinel(148112009);
if (mozilla::ipc::LoggingEnabledFor("PDocumentChannel", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PDocumentChannelChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PDocumentChannel::Msg_Cancel", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PDocumentChannelChild::Send__delete__(PDocumentChannelChild* actor) -> bool
{
if (!actor || !actor->CanSend()) {
NS_WARNING("Attempt to __delete__ missing or closed actor");
return false;
}
UniquePtr<IPC::Message> msg__ = PDocumentChannel::Msg___delete__((actor)->Id());
IPC::MessageWriter writer__{
(*(msg__)),
actor};
if (mozilla::ipc::LoggingEnabledFor("PDocumentChannel", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PDocumentChannelChild",
actor->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PDocumentChannel::Msg___delete__", OTHER);
bool sendok__ = (actor)->ChannelSend(std::move(msg__));
actor->ActorDisconnected(Deletion);
return sendok__;
}
auto PDocumentChannelChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PDocumentChannelChild::OnMessageReceived(const Message& msg__) -> PDocumentChannelChild::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 PDocumentChannel::Reply___delete____ID:
{
return MsgProcessed;
}
case PDocumentChannel::Msg_FailedAsyncOpen__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PDocumentChannel", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PDocumentChannelChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PDocumentChannel::Msg_FailedAsyncOpen", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__status = IPC::ReadParam<nsresult>((&(reader__)));
if (!maybe__status) {
FatalError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto& status = *maybe__status;
// Sentinel = 'status'
if ((!(((&(reader__)))->ReadSentinel(154731173)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<DocumentChannelChild*>(this))->RecvFailedAsyncOpen(std::move(status));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PDocumentChannel::Msg_DisconnectChildListeners__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PDocumentChannel", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PDocumentChannelChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PDocumentChannel::Msg_DisconnectChildListeners", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aStatus = IPC::ReadParam<nsresult>((&(reader__)));
if (!maybe__aStatus) {
FatalError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto& aStatus = *maybe__aStatus;
// Sentinel = 'aStatus'
if ((!(((&(reader__)))->ReadSentinel(186712806)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto maybe__aLoadGroupReason = IPC::ReadParam<nsresult>((&(reader__)));
if (!maybe__aLoadGroupReason) {
FatalError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto& aLoadGroupReason = *maybe__aLoadGroupReason;
// Sentinel = 'aLoadGroupReason'
if ((!(((&(reader__)))->ReadSentinel(879822423)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
return MsgValueError;
}
auto maybe__aContinueNavigating = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__aContinueNavigating) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& aContinueNavigating = *maybe__aContinueNavigating;
// Sentinel = 'aContinueNavigating'
if ((!(((&(reader__)))->ReadSentinel(1271859119)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<DocumentChannelChild*>(this))->RecvDisconnectChildListeners(std::move(aStatus), std::move(aLoadGroupReason), std::move(aContinueNavigating));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PDocumentChannel::Msg_RedirectToRealChannel__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PDocumentChannel", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PDocumentChannelChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PDocumentChannel::Msg_RedirectToRealChannel", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__args = IPC::ReadParam<RedirectToRealChannelArgs>((&(reader__)));
if (!maybe__args) {
FatalError("Error deserializing 'RedirectToRealChannelArgs'");
return MsgValueError;
}
auto& args = *maybe__args;
// Sentinel = 'args'
if ((!(((&(reader__)))->ReadSentinel(69140910)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'RedirectToRealChannelArgs'");
return MsgValueError;
}
auto maybe__aEndpoint = IPC::ReadParam<nsTArray<Endpoint<::mozilla::extensions::PStreamFilterParent>>>((&(reader__)));
if (!maybe__aEndpoint) {
FatalError("Error deserializing 'Endpoint<::mozilla::extensions::PStreamFilterParent>[]'");
return MsgValueError;
}
auto& aEndpoint = *maybe__aEndpoint;
// Sentinel = 'aEndpoint'
if ((!(((&(reader__)))->ReadSentinel(292225955)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'Endpoint<::mozilla::extensions::PStreamFilterParent>[]'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = Id();
UniquePtr<IPC::Message> reply__(PDocumentChannel::Reply_RedirectToRealChannel(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
RedirectToRealChannelResolver resolver = [resolver__ = std::move(resolver__)](const nsresult& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'rv'
((&(writer__)))->WriteSentinel(22806761);
if (mozilla::ipc::LoggingEnabledFor("PDocumentChannel", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PDocumentChannelChild",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (static_cast<DocumentChannelChild*>(this))->RecvRedirectToRealChannel(std::move(args), std::move(aEndpoint), std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PDocumentChannel::Msg_UpgradeObjectLoad__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PDocumentChannel", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PDocumentChannelChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PDocumentChannel::Msg_UpgradeObjectLoad", OTHER);
int32_t id__ = Id();
UniquePtr<IPC::Message> reply__(PDocumentChannel::Reply_UpgradeObjectLoad(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
UpgradeObjectLoadResolver resolver = [resolver__ = std::move(resolver__)](const MaybeDiscardedBrowsingContext& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'frameContext'
((&(writer__)))->WriteSentinel(528024817);
if (mozilla::ipc::LoggingEnabledFor("PDocumentChannel", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PDocumentChannelChild",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (static_cast<DocumentChannelChild*>(this))->RecvUpgradeObjectLoad(std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PDocumentChannelChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PDocumentChannelChild::Result
{
return MsgNotKnown;
}
} // namespace net
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::net::PDocumentChannelChild*>::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::net::PDocumentChannelChild*>::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, "PDocumentChannel", PDocumentChannelMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::net::PDocumentChannelChild*>(actor.ref());
}
return {};
}
} // namespace IPC