Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/net/PProxyAutoConfigParent.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/net/ProxyAutoConfigParent.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 {
auto PProxyAutoConfigParent::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PProxyAutoConfigParent::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PProxyAutoConfigParent::PProxyAutoConfigParent() :
mozilla::ipc::IToplevelProtocol("PProxyAutoConfigParent", PProxyAutoConfigMsgStart, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PProxyAutoConfigParent);
}
PProxyAutoConfigParent::~PProxyAutoConfigParent()
{
MOZ_COUNT_DTOR(PProxyAutoConfigParent);
}
auto PProxyAutoConfigParent::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsParentProcess(), "Invalid process for `PProxyAutoConfigParent'");
AddRef();
}
auto PProxyAutoConfigParent::ActorDealloc() -> void
{
Release();
}
auto PProxyAutoConfigParent::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PProxyAutoConfigParent::SendConfigurePAC(
const nsACString& aPACURI,
const nsACString& aPACScriptData,
const bool& aIncludePath,
const uint32_t& aExtraHeapSize) -> bool
{
UniquePtr<IPC::Message> msg__ = PProxyAutoConfig::Msg_ConfigurePAC(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aPACURI);
// Sentinel = 'aPACURI'
((&(writer__)))->WriteSentinel(147522086);
IPC::WriteParam((&(writer__)), aPACScriptData);
// Sentinel = 'aPACScriptData'
((&(writer__)))->WriteSentinel(618726693);
IPC::WriteParam((&(writer__)), aIncludePath);
// Sentinel = 'aIncludePath'
((&(writer__)))->WriteSentinel(504956083);
IPC::WriteParam((&(writer__)), aExtraHeapSize);
// Sentinel = 'aExtraHeapSize'
((&(writer__)))->WriteSentinel(682558847);
if (mozilla::ipc::LoggingEnabledFor("PProxyAutoConfig", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProxyAutoConfigParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PProxyAutoConfig::Msg_ConfigurePAC", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PProxyAutoConfigParent::SendGetProxyForURI(
const nsACString& aTestURI,
const nsACString& aTestHost,
mozilla::ipc::ResolveCallback<std::tuple<nsresult, nsCString>>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PProxyAutoConfig::Msg_GetProxyForURI(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aTestURI);
// Sentinel = 'aTestURI'
((&(writer__)))->WriteSentinel(229966578);
IPC::WriteParam((&(writer__)), aTestHost);
// Sentinel = 'aTestHost'
((&(writer__)))->WriteSentinel(294781856);
if (mozilla::ipc::LoggingEnabledFor("PProxyAutoConfig", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProxyAutoConfigParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PProxyAutoConfig::Msg_GetProxyForURI", OTHER);
ChannelSend(std::move(msg__), PProxyAutoConfig::Reply_GetProxyForURI__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PProxyAutoConfigParent::SendGetProxyForURI(
const nsACString& aTestURI,
const nsACString& aTestHost) -> RefPtr<GetProxyForURIPromise>
{
RefPtr<MozPromise<std::tuple<nsresult, nsCString>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<std::tuple<nsresult, nsCString>, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendGetProxyForURI(std::move(aTestURI), std::move(aTestHost), [promise__](std::tuple<nsresult, nsCString>&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PProxyAutoConfigParent::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PProxyAutoConfigParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PProxyAutoConfigParent::OnMessageReceived(const Message& msg__) -> PProxyAutoConfigParent::Result
{
switch (msg__.type()) {
case PProxyAutoConfig::Reply_GetProxyForURI__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PProxyAutoConfig", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PProxyAutoConfigParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PProxyAutoConfig::Msg_GetProxyForURI", OTHER);
IPC::MessageReader reader__{
msg__,
this};
bool resolve__ = false;
if (!IPC::ReadParam(&reader__, &resolve__)) {
FatalError("Error deserializing bool");
return MsgValueError;
}
UniquePtr<MessageChannel::UntypedCallbackHolder> untypedCallback =
GetIPCChannel()->PopCallback(msg__, Id());
typedef MessageChannel::CallbackHolder<std::tuple<nsresult, nsCString>> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
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__aResult = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__aResult) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& aResult = *maybe__aResult;
// Sentinel = 'aResult'
if ((!(((&(reader__)))->ReadSentinel(185205473)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::make_tuple(std::move(aStatus), std::move(aResult)));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
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 PProxyAutoConfigParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PProxyAutoConfigParent::Result
{
return MsgNotKnown;
}
auto PProxyAutoConfigParent::DoomSubtree() -> void
{
SetDoomed();
}
auto PProxyAutoConfigParent::PeekManagedActor() -> IProtocol*
{
return nullptr;
}
} // namespace net
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::net::PProxyAutoConfigParent*>::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::PProxyAutoConfigParent*>::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, "PProxyAutoConfig", PProxyAutoConfigMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::net::PProxyAutoConfigParent*>(actor.ref());
}
return {};
}
} // namespace IPC