Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/PServiceWorkerContainerChild.h"
#include "ipc/ErrorIPCUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/dom/BindingIPCUtils.h"
#include "mozilla/dom/ClientIPCUtils.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 PServiceWorkerContainerChild::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
MOZ_IMPLICIT PServiceWorkerContainerChild::PServiceWorkerContainerChild() :
mozilla::ipc::IRefCountedProtocol(PServiceWorkerContainerMsgStart, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PServiceWorkerContainerChild);
}
PServiceWorkerContainerChild::~PServiceWorkerContainerChild()
{
MOZ_COUNT_DTOR(PServiceWorkerContainerChild);
}
auto PServiceWorkerContainerChild::ActorAlloc() -> void
{
AddRef();
}
auto PServiceWorkerContainerChild::ActorDealloc() -> void
{
Release();
}
auto PServiceWorkerContainerChild::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PServiceWorkerContainerChild::Manager() const -> PBackgroundChild*
{
return static_cast<PBackgroundChild*>(IProtocol::Manager());
}
auto PServiceWorkerContainerChild::AllManagedActors(nsTArray<RefPtr<mozilla::ipc::ActorLifecycleProxy>>& arr__) const -> void
{
uint32_t total = 0;
arr__.SetCapacity(total);
}
auto PServiceWorkerContainerChild::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PServiceWorkerContainerChild::SendTeardown() -> bool
{
UniquePtr<IPC::Message> msg__ = PServiceWorkerContainer::Msg_Teardown(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerContainer", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerContainerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PServiceWorkerContainer::Msg_Teardown", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PServiceWorkerContainerChild::SendRegister(
const IPCClientInfo& aClientInfo,
const nsACString& aScopeURL,
const nsACString& aScriptURL,
const ServiceWorkerUpdateViaCache& aUpdateViaCache,
mozilla::ipc::ResolveCallback<IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PServiceWorkerContainer::Msg_Register(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aClientInfo);
// Sentinel = 'aClientInfo'
((&(writer__)))->WriteSentinel(422315085);
IPC::WriteParam((&(writer__)), aScopeURL);
// Sentinel = 'aScopeURL'
((&(writer__)))->WriteSentinel(285999951);
IPC::WriteParam((&(writer__)), aScriptURL);
// Sentinel = 'aScriptURL'
((&(writer__)))->WriteSentinel(358220746);
IPC::WriteParam((&(writer__)), aUpdateViaCache);
// Sentinel = 'aUpdateViaCache'
((&(writer__)))->WriteSentinel(772408761);
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerContainer", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerContainerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PServiceWorkerContainer::Msg_Register", OTHER);
ChannelSend(std::move(msg__), PServiceWorkerContainer::Reply_Register__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PServiceWorkerContainerChild::SendRegister(
const IPCClientInfo& aClientInfo,
const nsACString& aScopeURL,
const nsACString& aScriptURL,
const ServiceWorkerUpdateViaCache& aUpdateViaCache) -> RefPtr<RegisterPromise>
{
RefPtr<MozPromise<IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendRegister(std::move(aClientInfo), std::move(aScopeURL), std::move(aScriptURL), std::move(aUpdateViaCache), [promise__](IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PServiceWorkerContainerChild::SendGetRegistration(
const IPCClientInfo& aClientInfo,
const nsACString& aURL,
mozilla::ipc::ResolveCallback<IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PServiceWorkerContainer::Msg_GetRegistration(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aClientInfo);
// Sentinel = 'aClientInfo'
((&(writer__)))->WriteSentinel(422315085);
IPC::WriteParam((&(writer__)), aURL);
// Sentinel = 'aURL'
((&(writer__)))->WriteSentinel(58130773);
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerContainer", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerContainerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PServiceWorkerContainer::Msg_GetRegistration", OTHER);
ChannelSend(std::move(msg__), PServiceWorkerContainer::Reply_GetRegistration__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PServiceWorkerContainerChild::SendGetRegistration(
const IPCClientInfo& aClientInfo,
const nsACString& aURL) -> RefPtr<GetRegistrationPromise>
{
RefPtr<MozPromise<IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendGetRegistration(std::move(aClientInfo), std::move(aURL), [promise__](IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PServiceWorkerContainerChild::SendGetRegistrations(
const IPCClientInfo& aClientInfo,
mozilla::ipc::ResolveCallback<IPCServiceWorkerRegistrationDescriptorListOrCopyableErrorResult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PServiceWorkerContainer::Msg_GetRegistrations(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aClientInfo);
// Sentinel = 'aClientInfo'
((&(writer__)))->WriteSentinel(422315085);
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerContainer", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerContainerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PServiceWorkerContainer::Msg_GetRegistrations", OTHER);
ChannelSend(std::move(msg__), PServiceWorkerContainer::Reply_GetRegistrations__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PServiceWorkerContainerChild::SendGetRegistrations(const IPCClientInfo& aClientInfo) -> RefPtr<GetRegistrationsPromise>
{
RefPtr<MozPromise<IPCServiceWorkerRegistrationDescriptorListOrCopyableErrorResult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<IPCServiceWorkerRegistrationDescriptorListOrCopyableErrorResult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendGetRegistrations(std::move(aClientInfo), [promise__](IPCServiceWorkerRegistrationDescriptorListOrCopyableErrorResult&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PServiceWorkerContainerChild::SendGetReady(
const IPCClientInfo& aClientInfo,
mozilla::ipc::ResolveCallback<IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PServiceWorkerContainer::Msg_GetReady(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aClientInfo);
// Sentinel = 'aClientInfo'
((&(writer__)))->WriteSentinel(422315085);
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerContainer", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerContainerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PServiceWorkerContainer::Msg_GetReady", OTHER);
ChannelSend(std::move(msg__), PServiceWorkerContainer::Reply_GetReady__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PServiceWorkerContainerChild::SendGetReady(const IPCClientInfo& aClientInfo) -> RefPtr<GetReadyPromise>
{
RefPtr<MozPromise<IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendGetReady(std::move(aClientInfo), [promise__](IPCServiceWorkerRegistrationDescriptorOrCopyableErrorResult&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PServiceWorkerContainerChild::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PServiceWorkerContainerChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PServiceWorkerContainerChild::OnMessageReceived(const Message& msg__) -> PServiceWorkerContainerChild::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;
IProtocol* mgr = this->Manager();
this->DestroySubtree(ManagedEndpointDropped);
this->ClearSubtree();
mgr->RemoveManagee(PServiceWorkerContainerMsgStart, this);
return MsgProcessed;
}
case PServiceWorkerContainer::Reply_Register__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerContainer", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerContainerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerContainer::Msg_Register", 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 PServiceWorkerContainer::Reply_GetRegistration__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerContainer", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerContainerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerContainer::Msg_GetRegistration", 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 PServiceWorkerContainer::Reply_GetRegistrations__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerContainer", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerContainerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerContainer::Msg_GetRegistrations", 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<IPCServiceWorkerRegistrationDescriptorListOrCopyableErrorResult> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__aResult = IPC::ReadParam<IPCServiceWorkerRegistrationDescriptorListOrCopyableErrorResult>((&(reader__)));
if (!maybe__aResult) {
FatalError("Error deserializing 'IPCServiceWorkerRegistrationDescriptorListOrCopyableErrorResult'");
return MsgValueError;
}
auto& aResult = *maybe__aResult;
// Sentinel = 'aResult'
if ((!(((&(reader__)))->ReadSentinel(185205473)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'IPCServiceWorkerRegistrationDescriptorListOrCopyableErrorResult'");
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 PServiceWorkerContainer::Reply_GetReady__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerContainer", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerContainerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerContainer::Msg_GetReady", 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 PServiceWorkerContainer::Msg___delete____ID:
{
if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerContainer", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PServiceWorkerContainerChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PServiceWorkerContainer::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;
}
IProtocol* mgr = this->Manager();
this->DestroySubtree(Deletion);
this->ClearSubtree();
mgr->RemoveManagee(PServiceWorkerContainerMsgStart, this);
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PServiceWorkerContainerChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PServiceWorkerContainerChild::Result
{
return MsgNotKnown;
}
auto PServiceWorkerContainerChild::ClearSubtree() -> void
{
}
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::PServiceWorkerContainerChild*>::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::PServiceWorkerContainerChild*>::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, "PServiceWorkerContainer", PServiceWorkerContainerMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::dom::PServiceWorkerContainerChild*>(actor.ref());
}
return {};
}
} // namespace IPC