Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/PServiceWorkerRegistrationChild.h"
#include "ipc/ErrorIPCUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/dom/ServiceWorkerIPCUtils.h"
#include "mozilla/ipc/PBackgroundChild.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 {
auto PServiceWorkerRegistrationChild::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
MOZ_IMPLICIT PServiceWorkerRegistrationChild::PServiceWorkerRegistrationChild() :
mozilla::ipc::IRefCountedProtocol(PServiceWorkerRegistrationMsgStart, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PServiceWorkerRegistrationChild);
}
PServiceWorkerRegistrationChild::~PServiceWorkerRegistrationChild()
{
MOZ_COUNT_DTOR(PServiceWorkerRegistrationChild);
}
auto PServiceWorkerRegistrationChild::ActorAlloc() -> void
{
AddRef();
}
auto PServiceWorkerRegistrationChild::ActorDealloc() -> void
{
Release();
}
auto PServiceWorkerRegistrationChild::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PServiceWorkerRegistrationChild::Manager() const -> PBackgroundChild*
{
return static_cast<PBackgroundChild*>(IProtocol::Manager());
}
auto PServiceWorkerRegistrationChild::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PServiceWorkerRegistrationChild::SendTeardown() -> bool
{
UniquePtr<IPC::Message> msg__ = PServiceWorkerRegistration::Msg_Teardown(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_Teardown", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PServiceWorkerRegistrationChild::SendUnregister(
mozilla::ipc::ResolveCallback<std::tuple<bool, CopyableErrorResult>>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PServiceWorkerRegistration::Msg_Unregister(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_Unregister", OTHER);
ChannelSend(std::move(msg__), PServiceWorkerRegistration::Reply_Unregister__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PServiceWorkerRegistrationChild::SendUnregister() -> RefPtr<UnregisterPromise>
{
RefPtr<MozPromise<std::tuple<bool, CopyableErrorResult>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<std::tuple<bool, CopyableErrorResult>, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendUnregister([promise__](std::tuple<bool, CopyableErrorResult>&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PServiceWorkerRegistrationChild::SendUpdate(
const nsACString& aNewestWorkerScriptUrl,
mozilla::ipc::ResolveCallback<IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PServiceWorkerRegistration::Msg_Update(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aNewestWorkerScriptUrl);
// Sentinel = 'aNewestWorkerScriptUrl'
((&(writer__)))->WriteSentinel(1714555130);
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_Update", OTHER);
ChannelSend(std::move(msg__), PServiceWorkerRegistration::Reply_Update__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PServiceWorkerRegistrationChild::SendUpdate(const nsACString& aNewestWorkerScriptUrl) -> RefPtr<UpdatePromise>
{
RefPtr<MozPromise<IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendUpdate(std::move(aNewestWorkerScriptUrl), [promise__](IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PServiceWorkerRegistrationChild::SendSetNavigationPreloadEnabled(
const bool& aEnabled,
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PServiceWorkerRegistration::Msg_SetNavigationPreloadEnabled(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aEnabled);
// Sentinel = 'aEnabled'
((&(writer__)))->WriteSentinel(224789261);
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_SetNavigationPreloadEnabled", OTHER);
ChannelSend(std::move(msg__), PServiceWorkerRegistration::Reply_SetNavigationPreloadEnabled__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PServiceWorkerRegistrationChild::SendSetNavigationPreloadEnabled(const bool& aEnabled) -> RefPtr<SetNavigationPreloadEnabledPromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendSetNavigationPreloadEnabled(std::move(aEnabled), [promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PServiceWorkerRegistrationChild::SendSetNavigationPreloadHeader(
const nsACString& aHeader,
mozilla::ipc::ResolveCallback<bool>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PServiceWorkerRegistration::Msg_SetNavigationPreloadHeader(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aHeader);
// Sentinel = 'aHeader'
((&(writer__)))->WriteSentinel(172163755);
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_SetNavigationPreloadHeader", OTHER);
ChannelSend(std::move(msg__), PServiceWorkerRegistration::Reply_SetNavigationPreloadHeader__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PServiceWorkerRegistrationChild::SendSetNavigationPreloadHeader(const nsACString& aHeader) -> RefPtr<SetNavigationPreloadHeaderPromise>
{
RefPtr<MozPromise<bool, ResponseRejectReason, true>::Private> promise__ = new MozPromise<bool, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendSetNavigationPreloadHeader(std::move(aHeader), [promise__](bool&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PServiceWorkerRegistrationChild::SendGetNavigationPreloadState(
mozilla::ipc::ResolveCallback<mozilla::Maybe<IPCNavigationPreloadState>>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PServiceWorkerRegistration::Msg_GetNavigationPreloadState(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_GetNavigationPreloadState", OTHER);
ChannelSend(std::move(msg__), PServiceWorkerRegistration::Reply_GetNavigationPreloadState__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PServiceWorkerRegistrationChild::SendGetNavigationPreloadState() -> RefPtr<GetNavigationPreloadStatePromise>
{
RefPtr<MozPromise<mozilla::Maybe<IPCNavigationPreloadState>, ResponseRejectReason, true>::Private> promise__ = new MozPromise<mozilla::Maybe<IPCNavigationPreloadState>, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendGetNavigationPreloadState([promise__](mozilla::Maybe<IPCNavigationPreloadState>&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PServiceWorkerRegistrationChild::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PServiceWorkerRegistrationChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PServiceWorkerRegistrationChild::OnMessageReceived(const Message& msg__) -> PServiceWorkerRegistrationChild::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::Reply_Unregister__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_Unregister", 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<bool, CopyableErrorResult>> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__aSuccess = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__aSuccess) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& aSuccess = *maybe__aSuccess;
// Sentinel = 'aSuccess'
if ((!(((&(reader__)))->ReadSentinel(236323643)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
auto maybe__aRv = IPC::ReadParam<CopyableErrorResult>((&(reader__)));
if (!maybe__aRv) {
FatalError("Error deserializing 'CopyableErrorResult'");
return MsgValueError;
}
auto& aRv = *maybe__aRv;
// Sentinel = 'aRv'
if ((!(((&(reader__)))->ReadSentinel(37749034)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'CopyableErrorResult'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::make_tuple(std::move(aSuccess), std::move(aRv)));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PServiceWorkerRegistration::Reply_Update__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_Update", 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<IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__aResult = IPC::ReadParam<IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult>((&(reader__)));
if (!maybe__aResult) {
FatalError("Error deserializing 'IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult'");
return MsgValueError;
}
auto& aResult = *maybe__aResult;
// Sentinel = 'aResult'
if ((!(((&(reader__)))->ReadSentinel(185205473)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(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;
}
case PServiceWorkerRegistration::Reply_SetNavigationPreloadEnabled__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_SetNavigationPreloadEnabled", 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<bool> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__aSuccess = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__aSuccess) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& aSuccess = *maybe__aSuccess;
// Sentinel = 'aSuccess'
if ((!(((&(reader__)))->ReadSentinel(236323643)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(aSuccess));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PServiceWorkerRegistration::Reply_SetNavigationPreloadHeader__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_SetNavigationPreloadHeader", 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<bool> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__aSuccess = IPC::ReadParam<bool>((&(reader__)));
if (!maybe__aSuccess) {
FatalError("Error deserializing 'bool'");
return MsgValueError;
}
auto& aSuccess = *maybe__aSuccess;
// Sentinel = 'aSuccess'
if ((!(((&(reader__)))->ReadSentinel(236323643)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(aSuccess));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PServiceWorkerRegistration::Reply_GetNavigationPreloadState__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_GetNavigationPreloadState", 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<mozilla::Maybe<IPCNavigationPreloadState>> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__aState = IPC::ReadParam<mozilla::Maybe<IPCNavigationPreloadState>>((&(reader__)));
if (!maybe__aState) {
FatalError("Error deserializing 'IPCNavigationPreloadState?'");
return MsgValueError;
}
auto& aState = *maybe__aState;
// Sentinel = 'aState'
if ((!(((&(reader__)))->ReadSentinel(137036387)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'IPCNavigationPreloadState?'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(aState));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PServiceWorkerRegistration::Msg___delete____ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg___delete__", OTHER);
mozilla::ipc::IPCResult __ok = (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;
}
case PServiceWorkerRegistration::Msg_UpdateState__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_UpdateState", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aDescriptor = IPC::ReadParam<IPCServiceWorkerRegistrationDescriptor>((&(reader__)));
if (!maybe__aDescriptor) {
FatalError("Error deserializing 'IPCServiceWorkerRegistrationDescriptor'");
return MsgValueError;
}
auto& aDescriptor = *maybe__aDescriptor;
// Sentinel = 'aDescriptor'
if ((!(((&(reader__)))->ReadSentinel(433915009)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'IPCServiceWorkerRegistrationDescriptor'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (this)->RecvUpdateState(std::move(aDescriptor));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PServiceWorkerRegistration::Msg_FireUpdateFound__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerRegistration", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerRegistrationChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerRegistration::Msg_FireUpdateFound", OTHER);
mozilla::ipc::IPCResult __ok = (this)->RecvFireUpdateFound();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PServiceWorkerRegistrationChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PServiceWorkerRegistrationChild::Result
{
return MsgNotKnown;
}
auto PServiceWorkerRegistrationChild::DoomSubtree() -> void
{
SetDoomed();
}
auto PServiceWorkerRegistrationChild::PeekManagedActor() -> IProtocol*
{
return nullptr;
}
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::PServiceWorkerRegistrationChild*>::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::PServiceWorkerRegistrationChild*>::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::PServiceWorkerRegistrationChild*>(actor.ref());
}
return {};
}
} // namespace IPC