Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/PServiceWorkerRegistrationParent.h"
#include "ipc/ErrorIPCUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/dom/ServiceWorkerIPCUtils.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 PServiceWorkerRegistrationParent::PServiceWorkerRegistrationParent() :
mozilla::ipc::IRefCountedProtocol(PServiceWorkerRegistrationMsgStart, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PServiceWorkerRegistrationParent);
}
PServiceWorkerRegistrationParent::~PServiceWorkerRegistrationParent()
{
MOZ_COUNT_DTOR(PServiceWorkerRegistrationParent);
}
auto PServiceWorkerRegistrationParent::ActorAlloc() -> void
{
AddRef();
}
auto PServiceWorkerRegistrationParent::ActorDealloc() -> void
{
Release();
}
auto PServiceWorkerRegistrationParent::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PServiceWorkerRegistrationParent::Manager() const -> PBackgroundParent*
{
return static_cast<PBackgroundParent*>(IProtocol::Manager());
}
auto PServiceWorkerRegistrationParent::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PServiceWorkerRegistrationParent::Send__delete__(PServiceWorkerRegistrationParent* actor) -> bool
{
if (!actor || !actor->CanSend()) {
NS_WARNING("Attempt to __delete__ missing or closed actor");
return false;
}
UniquePtr<IPC::Message> msg__ = PServiceWorkerRegistration::Msg___delete__((actor)->Id());
IPC::MessageWriter writer__{
(*(msg__)),
actor};
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationParent",
actor->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg___delete__", OTHER);
bool sendok__ = (actor)->ChannelSend(std::move(msg__));
actor->ActorDisconnected(Deletion);
return sendok__;
}
auto PServiceWorkerRegistrationParent::SendUpdateState(const IPCServiceWorkerRegistrationDescriptor& aDescriptor) -> bool
{
UniquePtr<IPC::Message> msg__ = PServiceWorkerRegistration::Msg_UpdateState(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aDescriptor);
// Sentinel = 'aDescriptor'
((&(writer__)))->WriteSentinel(433915009);
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_UpdateState", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PServiceWorkerRegistrationParent::SendFireUpdateFound() -> bool
{
UniquePtr<IPC::Message> msg__ = PServiceWorkerRegistration::Msg_FireUpdateFound(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_FireUpdateFound", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PServiceWorkerRegistrationParent::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PServiceWorkerRegistrationParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PServiceWorkerRegistrationParent::OnMessageReceived(const Message& msg__) -> PServiceWorkerRegistrationParent::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 PServiceWorkerRegistration::Msg_Teardown__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_Teardown", OTHER);
mozilla::ipc::IPCResult __ok = (this)->RecvTeardown();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PServiceWorkerRegistration::Msg_Unregister__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_Unregister", OTHER);
int32_t id__ = Id();
UniquePtr<IPC::Message> reply__(PServiceWorkerRegistration::Reply_Unregister(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
UnregisterResolver resolver = [resolver__ = std::move(resolver__)](std::tuple<const bool&, const CopyableErrorResult&> aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), std::get<0>(aParam));
// Sentinel = 'aSuccess'
((&(writer__)))->WriteSentinel(236323643);
IPC::WriteParam((&(writer__)), std::get<1>(aParam));
// Sentinel = 'aRv'
((&(writer__)))->WriteSentinel(37749034);
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (this)->RecvUnregister(std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PServiceWorkerRegistration::Msg_Update__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_Update", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aNewestWorkerScriptUrl = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__aNewestWorkerScriptUrl) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& aNewestWorkerScriptUrl = *maybe__aNewestWorkerScriptUrl;
// Sentinel = 'aNewestWorkerScriptUrl'
if ((!(((&(reader__)))->ReadSentinel(1714555130)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = Id();
UniquePtr<IPC::Message> reply__(PServiceWorkerRegistration::Reply_Update(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
UpdateResolver resolver = [resolver__ = std::move(resolver__)](const IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'aResult'
((&(writer__)))->WriteSentinel(185205473);
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (this)->RecvUpdate(std::move(aNewestWorkerScriptUrl), std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PServiceWorkerRegistration::Msg_SetNavigationPreloadEnabled__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_SetNavigationPreloadEnabled", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aEnabled = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__aEnabled) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& aEnabled = *maybe__aEnabled;
// Sentinel = 'aEnabled'
if ((!(((&(reader__)))->ReadSentinel(224789261)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = Id();
UniquePtr<IPC::Message> reply__(PServiceWorkerRegistration::Reply_SetNavigationPreloadEnabled(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
SetNavigationPreloadEnabledResolver resolver = [resolver__ = std::move(resolver__)](const bool& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'aSuccess'
((&(writer__)))->WriteSentinel(236323643);
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (this)->RecvSetNavigationPreloadEnabled(std::move(aEnabled), std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PServiceWorkerRegistration::Msg_SetNavigationPreloadHeader__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_SetNavigationPreloadHeader", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aHeader = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__aHeader) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& aHeader = *maybe__aHeader;
// Sentinel = 'aHeader'
if ((!(((&(reader__)))->ReadSentinel(172163755)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = Id();
UniquePtr<IPC::Message> reply__(PServiceWorkerRegistration::Reply_SetNavigationPreloadHeader(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
SetNavigationPreloadHeaderResolver resolver = [resolver__ = std::move(resolver__)](const bool& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'aSuccess'
((&(writer__)))->WriteSentinel(236323643);
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (this)->RecvSetNavigationPreloadHeader(std::move(aHeader), std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PServiceWorkerRegistration::Msg_GetNavigationPreloadState__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_GetNavigationPreloadState", OTHER);
int32_t id__ = Id();
UniquePtr<IPC::Message> reply__(PServiceWorkerRegistration::Reply_GetNavigationPreloadState(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
GetNavigationPreloadStateResolver resolver = [resolver__ = std::move(resolver__)](const mozilla::Maybe<IPCNavigationPreloadState>& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'aState'
((&(writer__)))->WriteSentinel(137036387);
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (this)->RecvGetNavigationPreloadState(std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PServiceWorkerRegistration::Reply___delete____ID:
{
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PServiceWorkerRegistrationParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PServiceWorkerRegistrationParent::Result
{
return MsgNotKnown;
}
auto PServiceWorkerRegistrationParent::DoomSubtree() -> void
{
SetDoomed();
}
auto PServiceWorkerRegistrationParent::PeekManagedActor() -> IProtocol*
{
return nullptr;
}
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::PServiceWorkerRegistrationParent*>::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::PServiceWorkerRegistrationParent*>::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, "PServiceWorkerRegistration", PServiceWorkerRegistrationMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::dom::PServiceWorkerRegistrationParent*>(actor.ref());
}
return {};
}
} // namespace IPC