Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/quota/PQuotaChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/dom/quota/SerializationHelpers.h"
#include "mozilla/ipc/IPCCore.h"
#include "mozilla/ipc/PBackgroundChild.h"
#include "mozilla/dom/quota/PQuotaRequestChild.h"
#include "mozilla/dom/quota/PQuotaUsageRequestChild.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 {
namespace quota {
MOZ_IMPLICIT PQuotaChild::PQuotaChild() :
mozilla::ipc::IRefCountedProtocol(PQuotaMsgStart, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PQuotaChild);
}
PQuotaChild::~PQuotaChild()
{
MOZ_COUNT_DTOR(PQuotaChild);
}
auto PQuotaChild::ActorAlloc() -> void
{
AddRef();
}
auto PQuotaChild::ActorDealloc() -> void
{
Release();
}
auto PQuotaChild::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PQuotaChild::Manager() const -> PBackgroundChild*
{
return static_cast<PBackgroundChild*>(IProtocol::Manager());
}
auto PQuotaChild::ManagedPQuotaRequestChild(nsTArray<PQuotaRequestChild*>& aArr) const -> void
{
mManagedPQuotaRequestChild.ToArray(aArr);
}
auto PQuotaChild::ManagedPQuotaRequestChild() const -> const ManagedContainer<PQuotaRequestChild>&
{
return mManagedPQuotaRequestChild;
}
auto PQuotaChild::ManagedPQuotaUsageRequestChild(nsTArray<PQuotaUsageRequestChild*>& aArr) const -> void
{
mManagedPQuotaUsageRequestChild.ToArray(aArr);
}
auto PQuotaChild::ManagedPQuotaUsageRequestChild() const -> const ManagedContainer<PQuotaUsageRequestChild>&
{
return mManagedPQuotaUsageRequestChild;
}
auto PQuotaChild::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
total += mManagedPQuotaRequestChild.Count();
total += mManagedPQuotaUsageRequestChild.Count();
return total;
}
auto PQuotaChild::OpenPQuotaRequestEndpoint(PQuotaRequestChild* aActor) -> ManagedEndpoint<PQuotaRequestParent>
{
if (!aActor) {
NS_WARNING("Cannot bind null PQuotaRequestChild actor");
return ManagedEndpoint<PQuotaRequestParent>();
}
if (aActor->SetManagerAndRegister(this)) {
mManagedPQuotaRequestChild.Insert(aActor);
} else {
NS_WARNING("Failed to bind PQuotaRequestChild actor");
return ManagedEndpoint<PQuotaRequestParent>();
}
// Mark our actor as awaiting the other side to be bound. This will
// be cleared when a `MANAGED_ENDPOINT_{DROPPED,BOUND}` message is
// received.
aActor->mAwaitingManagedEndpointBind = true;
return ManagedEndpoint<PQuotaRequestParent>(mozilla::ipc::PrivateIPDLInterface(), aActor);
}
auto PQuotaChild::BindPQuotaRequestEndpoint(
ManagedEndpoint<PQuotaRequestChild> aEndpoint,
PQuotaRequestChild* aActor) -> bool
{
return aEndpoint.Bind(mozilla::ipc::PrivateIPDLInterface(), aActor, this, mManagedPQuotaRequestChild);
}
auto PQuotaChild::OpenPQuotaUsageRequestEndpoint(PQuotaUsageRequestChild* aActor) -> ManagedEndpoint<PQuotaUsageRequestParent>
{
if (!aActor) {
NS_WARNING("Cannot bind null PQuotaUsageRequestChild actor");
return ManagedEndpoint<PQuotaUsageRequestParent>();
}
if (aActor->SetManagerAndRegister(this)) {
mManagedPQuotaUsageRequestChild.Insert(aActor);
} else {
NS_WARNING("Failed to bind PQuotaUsageRequestChild actor");
return ManagedEndpoint<PQuotaUsageRequestParent>();
}
// Mark our actor as awaiting the other side to be bound. This will
// be cleared when a `MANAGED_ENDPOINT_{DROPPED,BOUND}` message is
// received.
aActor->mAwaitingManagedEndpointBind = true;
return ManagedEndpoint<PQuotaUsageRequestParent>(mozilla::ipc::PrivateIPDLInterface(), aActor);
}
auto PQuotaChild::BindPQuotaUsageRequestEndpoint(
ManagedEndpoint<PQuotaUsageRequestChild> aEndpoint,
PQuotaUsageRequestChild* aActor) -> bool
{
return aEndpoint.Bind(mozilla::ipc::PrivateIPDLInterface(), aActor, this, mManagedPQuotaUsageRequestChild);
}
auto PQuotaChild::Send__delete__(PQuotaChild* actor) -> bool
{
if (!actor || !actor->CanSend()) {
NS_WARNING("Attempt to __delete__ missing or closed actor");
return false;
}
UniquePtr<IPC::Message> msg__ = PQuota::Msg___delete__((actor)->Id());
IPC::MessageWriter writer__{
(*(msg__)),
actor};
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
actor->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg___delete__", OTHER);
bool sendok__ = (actor)->ChannelSend(std::move(msg__));
actor->ActorDisconnected(Deletion);
return sendok__;
}
auto PQuotaChild::SendPQuotaUsageRequestConstructor(const UsageRequestParams& params) -> PQuotaUsageRequestChild*
{
PQuotaUsageRequestChild* actor = (this)->AllocPQuotaUsageRequestChild(params);
return SendPQuotaUsageRequestConstructor(std::move(actor), std::move(params));
}
auto PQuotaChild::SendPQuotaUsageRequestConstructor(
PQuotaUsageRequestChild* actor,
const UsageRequestParams& params) -> PQuotaUsageRequestChild*
{
if (!actor) {
NS_WARNING("Cannot bind null PQuotaUsageRequestChild actor");
return nullptr;
}
if (actor->SetManagerAndRegister(this)) {
mManagedPQuotaUsageRequestChild.Insert(actor);
} else {
NS_WARNING("Failed to bind PQuotaUsageRequestChild actor");
return nullptr;
}
// Build our constructor message.
UniquePtr<IPC::Message> msg__ = PQuota::Msg_PQuotaUsageRequestConstructor(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), actor);
// Sentinel = 'actor'
((&(writer__)))->WriteSentinel(102892058);
IPC::WriteParam((&(writer__)), params);
// Sentinel = 'params'
((&(writer__)))->WriteSentinel(146997893);
// Notify the other side about the newly created actor. This can
// fail if our manager has already been destroyed.
//
// NOTE: If the send call fails due to toplevel channel teardown,
// the `IProtocol::ChannelSend` wrapper absorbs the error for us,
// so we don't tear down actors unexpectedly.
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg_PQuotaUsageRequestConstructor", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
// Warn, destroy the actor, and return null if the message failed to
// send. Otherwise, return the successfully created actor reference.
if (!sendok__) {
NS_WARNING("Error sending PQuotaUsageRequestChild constructor");
actor->ActorDisconnected(FailedConstructor);
return nullptr;
}
return actor;
}
auto PQuotaChild::SendPQuotaRequestConstructor(const RequestParams& params) -> PQuotaRequestChild*
{
PQuotaRequestChild* actor = (this)->AllocPQuotaRequestChild(params);
return SendPQuotaRequestConstructor(std::move(actor), std::move(params));
}
auto PQuotaChild::SendPQuotaRequestConstructor(
PQuotaRequestChild* actor,
const RequestParams& params) -> PQuotaRequestChild*
{
if (!actor) {
NS_WARNING("Cannot bind null PQuotaRequestChild actor");
return nullptr;
}
if (actor->SetManagerAndRegister(this)) {
mManagedPQuotaRequestChild.Insert(actor);
} else {
NS_WARNING("Failed to bind PQuotaRequestChild actor");
return nullptr;
}
// Build our constructor message.
UniquePtr<IPC::Message> msg__ = PQuota::Msg_PQuotaRequestConstructor(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), actor);
// Sentinel = 'actor'
((&(writer__)))->WriteSentinel(102892058);
IPC::WriteParam((&(writer__)), params);
// Sentinel = 'params'
((&(writer__)))->WriteSentinel(146997893);
// Notify the other side about the newly created actor. This can
// fail if our manager has already been destroyed.
//
// NOTE: If the send call fails due to toplevel channel teardown,
// the `IProtocol::ChannelSend` wrapper absorbs the error for us,
// so we don't tear down actors unexpectedly.
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg_PQuotaRequestConstructor", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
// Warn, destroy the actor, and return null if the message failed to
// send. Otherwise, return the successfully created actor reference.
if (!sendok__) {
NS_WARNING("Error sending PQuotaRequestChild constructor");
actor->ActorDisconnected(FailedConstructor);
return nullptr;
}
return actor;
}
auto PQuotaChild::SendStorageInitialized(
mozilla::ipc::ResolveCallback<BoolResponse>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PQuota::Msg_StorageInitialized(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg_StorageInitialized", OTHER);
ChannelSend(std::move(msg__), PQuota::Reply_StorageInitialized__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PQuotaChild::SendStorageInitialized() -> RefPtr<StorageInitializedPromise>
{
RefPtr<MozPromise<BoolResponse, ResponseRejectReason, true>::Private> promise__ = new MozPromise<BoolResponse, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendStorageInitialized([promise__](BoolResponse&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PQuotaChild::SendTemporaryStorageInitialized(
mozilla::ipc::ResolveCallback<BoolResponse>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PQuota::Msg_TemporaryStorageInitialized(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg_TemporaryStorageInitialized", OTHER);
ChannelSend(std::move(msg__), PQuota::Reply_TemporaryStorageInitialized__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PQuotaChild::SendTemporaryStorageInitialized() -> RefPtr<TemporaryStorageInitializedPromise>
{
RefPtr<MozPromise<BoolResponse, ResponseRejectReason, true>::Private> promise__ = new MozPromise<BoolResponse, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendTemporaryStorageInitialized([promise__](BoolResponse&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PQuotaChild::SendInitializeStorage(
mozilla::ipc::ResolveCallback<BoolResponse>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PQuota::Msg_InitializeStorage(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg_InitializeStorage", OTHER);
ChannelSend(std::move(msg__), PQuota::Reply_InitializeStorage__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PQuotaChild::SendInitializeStorage() -> RefPtr<InitializeStoragePromise>
{
RefPtr<MozPromise<BoolResponse, ResponseRejectReason, true>::Private> promise__ = new MozPromise<BoolResponse, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendInitializeStorage([promise__](BoolResponse&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PQuotaChild::SendInitializePersistentClient(
const PrincipalInfo& principalInfo,
const Type& clientType,
mozilla::ipc::ResolveCallback<BoolResponse>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PQuota::Msg_InitializePersistentClient(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), principalInfo);
// Sentinel = 'principalInfo'
((&(writer__)))->WriteSentinel(633472335);
IPC::WriteParam((&(writer__)), clientType);
// Sentinel = 'clientType'
((&(writer__)))->WriteSentinel(378995746);
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg_InitializePersistentClient", OTHER);
ChannelSend(std::move(msg__), PQuota::Reply_InitializePersistentClient__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PQuotaChild::SendInitializePersistentClient(
const PrincipalInfo& principalInfo,
const Type& clientType) -> RefPtr<InitializePersistentClientPromise>
{
RefPtr<MozPromise<BoolResponse, ResponseRejectReason, true>::Private> promise__ = new MozPromise<BoolResponse, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendInitializePersistentClient(std::move(principalInfo), std::move(clientType), [promise__](BoolResponse&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PQuotaChild::SendInitializeTemporaryClient(
const PersistenceType& persistenceType,
const PrincipalInfo& principalInfo,
const Type& clientType,
mozilla::ipc::ResolveCallback<BoolResponse>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PQuota::Msg_InitializeTemporaryClient(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), persistenceType);
// Sentinel = 'persistenceType'
((&(writer__)))->WriteSentinel(853345864);
IPC::WriteParam((&(writer__)), principalInfo);
// Sentinel = 'principalInfo'
((&(writer__)))->WriteSentinel(633472335);
IPC::WriteParam((&(writer__)), clientType);
// Sentinel = 'clientType'
((&(writer__)))->WriteSentinel(378995746);
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg_InitializeTemporaryClient", OTHER);
ChannelSend(std::move(msg__), PQuota::Reply_InitializeTemporaryClient__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PQuotaChild::SendInitializeTemporaryClient(
const PersistenceType& persistenceType,
const PrincipalInfo& principalInfo,
const Type& clientType) -> RefPtr<InitializeTemporaryClientPromise>
{
RefPtr<MozPromise<BoolResponse, ResponseRejectReason, true>::Private> promise__ = new MozPromise<BoolResponse, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendInitializeTemporaryClient(std::move(persistenceType), std::move(principalInfo), std::move(clientType), [promise__](BoolResponse&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PQuotaChild::SendInitializeTemporaryStorage(
mozilla::ipc::ResolveCallback<BoolResponse>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PQuota::Msg_InitializeTemporaryStorage(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg_InitializeTemporaryStorage", OTHER);
ChannelSend(std::move(msg__), PQuota::Reply_InitializeTemporaryStorage__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PQuotaChild::SendInitializeTemporaryStorage() -> RefPtr<InitializeTemporaryStoragePromise>
{
RefPtr<MozPromise<BoolResponse, ResponseRejectReason, true>::Private> promise__ = new MozPromise<BoolResponse, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendInitializeTemporaryStorage([promise__](BoolResponse&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PQuotaChild::SendClearStoragesForOrigin(
const mozilla::Maybe<PersistenceType>& persistenceType,
const PrincipalInfo& principalInfo,
const mozilla::Maybe<Type>& clientType,
mozilla::ipc::ResolveCallback<BoolResponse>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PQuota::Msg_ClearStoragesForOrigin(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), persistenceType);
// Sentinel = 'persistenceType'
((&(writer__)))->WriteSentinel(853345864);
IPC::WriteParam((&(writer__)), principalInfo);
// Sentinel = 'principalInfo'
((&(writer__)))->WriteSentinel(633472335);
IPC::WriteParam((&(writer__)), clientType);
// Sentinel = 'clientType'
((&(writer__)))->WriteSentinel(378995746);
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg_ClearStoragesForOrigin", OTHER);
ChannelSend(std::move(msg__), PQuota::Reply_ClearStoragesForOrigin__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PQuotaChild::SendClearStoragesForOrigin(
const mozilla::Maybe<PersistenceType>& persistenceType,
const PrincipalInfo& principalInfo,
const mozilla::Maybe<Type>& clientType) -> RefPtr<ClearStoragesForOriginPromise>
{
RefPtr<MozPromise<BoolResponse, ResponseRejectReason, true>::Private> promise__ = new MozPromise<BoolResponse, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendClearStoragesForOrigin(std::move(persistenceType), std::move(principalInfo), std::move(clientType), [promise__](BoolResponse&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PQuotaChild::SendClearStoragesForOriginPrefix(
const mozilla::Maybe<PersistenceType>& persistenceType,
const PrincipalInfo& principalInfo,
mozilla::ipc::ResolveCallback<BoolResponse>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PQuota::Msg_ClearStoragesForOriginPrefix(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), persistenceType);
// Sentinel = 'persistenceType'
((&(writer__)))->WriteSentinel(853345864);
IPC::WriteParam((&(writer__)), principalInfo);
// Sentinel = 'principalInfo'
((&(writer__)))->WriteSentinel(633472335);
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg_ClearStoragesForOriginPrefix", OTHER);
ChannelSend(std::move(msg__), PQuota::Reply_ClearStoragesForOriginPrefix__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PQuotaChild::SendClearStoragesForOriginPrefix(
const mozilla::Maybe<PersistenceType>& persistenceType,
const PrincipalInfo& principalInfo) -> RefPtr<ClearStoragesForOriginPrefixPromise>
{
RefPtr<MozPromise<BoolResponse, ResponseRejectReason, true>::Private> promise__ = new MozPromise<BoolResponse, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendClearStoragesForOriginPrefix(std::move(persistenceType), std::move(principalInfo), [promise__](BoolResponse&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PQuotaChild::SendClearStoragesForOriginAttributesPattern(
const OriginAttributesPattern& pattern,
mozilla::ipc::ResolveCallback<BoolResponse>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PQuota::Msg_ClearStoragesForOriginAttributesPattern(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), pattern);
// Sentinel = 'pattern'
((&(writer__)))->WriteSentinel(200409855);
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg_ClearStoragesForOriginAttributesPattern", OTHER);
ChannelSend(std::move(msg__), PQuota::Reply_ClearStoragesForOriginAttributesPattern__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PQuotaChild::SendClearStoragesForOriginAttributesPattern(const OriginAttributesPattern& pattern) -> RefPtr<ClearStoragesForOriginAttributesPatternPromise>
{
RefPtr<MozPromise<BoolResponse, ResponseRejectReason, true>::Private> promise__ = new MozPromise<BoolResponse, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendClearStoragesForOriginAttributesPattern(std::move(pattern), [promise__](BoolResponse&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PQuotaChild::SendClearStoragesForPrivateBrowsing(
mozilla::ipc::ResolveCallback<BoolResponse>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PQuota::Msg_ClearStoragesForPrivateBrowsing(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg_ClearStoragesForPrivateBrowsing", OTHER);
ChannelSend(std::move(msg__), PQuota::Reply_ClearStoragesForPrivateBrowsing__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PQuotaChild::SendClearStoragesForPrivateBrowsing() -> RefPtr<ClearStoragesForPrivateBrowsingPromise>
{
RefPtr<MozPromise<BoolResponse, ResponseRejectReason, true>::Private> promise__ = new MozPromise<BoolResponse, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendClearStoragesForPrivateBrowsing([promise__](BoolResponse&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PQuotaChild::SendClearStorage(
mozilla::ipc::ResolveCallback<BoolResponse>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PQuota::Msg_ClearStorage(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg_ClearStorage", OTHER);
ChannelSend(std::move(msg__), PQuota::Reply_ClearStorage__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PQuotaChild::SendClearStorage() -> RefPtr<ClearStoragePromise>
{
RefPtr<MozPromise<BoolResponse, ResponseRejectReason, true>::Private> promise__ = new MozPromise<BoolResponse, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendClearStorage([promise__](BoolResponse&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PQuotaChild::SendShutdownStorage(
mozilla::ipc::ResolveCallback<BoolResponse>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PQuota::Msg_ShutdownStorage(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg_ShutdownStorage", OTHER);
ChannelSend(std::move(msg__), PQuota::Reply_ShutdownStorage__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PQuotaChild::SendShutdownStorage() -> RefPtr<ShutdownStoragePromise>
{
RefPtr<MozPromise<BoolResponse, ResponseRejectReason, true>::Private> promise__ = new MozPromise<BoolResponse, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendShutdownStorage([promise__](BoolResponse&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PQuotaChild::SendStartIdleMaintenance() -> bool
{
UniquePtr<IPC::Message> msg__ = PQuota::Msg_StartIdleMaintenance(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg_StartIdleMaintenance", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PQuotaChild::SendStopIdleMaintenance() -> bool
{
UniquePtr<IPC::Message> msg__ = PQuota::Msg_StopIdleMaintenance(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg_StopIdleMaintenance", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PQuotaChild::SendAbortOperationsForProcess(const ContentParentId& contentParentId) -> bool
{
UniquePtr<IPC::Message> msg__ = PQuota::Msg_AbortOperationsForProcess(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), contentParentId);
// Sentinel = 'contentParentId'
((&(writer__)))->WriteSentinel(830539283);
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PQuota::Msg_AbortOperationsForProcess", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PQuotaChild::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
switch (aProtocolId) {
case PQuotaRequestMsgStart:
MOZ_ALWAYS_TRUE(mManagedPQuotaRequestChild.EnsureRemoved(static_cast<PQuotaRequestChild*>(aListener)));
return;
case PQuotaUsageRequestMsgStart:
MOZ_ALWAYS_TRUE(mManagedPQuotaUsageRequestChild.EnsureRemoved(static_cast<PQuotaUsageRequestChild*>(aListener)));
return;
default:
FatalError("unreached");
return; }
}
auto PQuotaChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
switch (aProtocolId) {
case PQuotaRequestMsgStart:
this->DeallocPQuotaRequestChild(static_cast<PQuotaRequestChild*>(aListener));
return;
case PQuotaUsageRequestMsgStart:
this->DeallocPQuotaUsageRequestChild(static_cast<PQuotaUsageRequestChild*>(aListener));
return;
default:
FatalError("unreached");
return;
}
}
auto PQuotaChild::OnMessageReceived(const Message& msg__) -> PQuotaChild::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 PQuota::Reply___delete____ID:
{
return MsgProcessed;
}
case PQuota::Reply_PQuotaUsageRequestConstructor__ID:
{
return MsgProcessed;
}
case PQuota::Reply_PQuotaRequestConstructor__ID:
{
return MsgProcessed;
}
case PQuota::Reply_StorageInitialized__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PQuota::Msg_StorageInitialized", 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<BoolResponse> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__response = IPC::ReadParam<BoolResponse>((&(reader__)));
if (!maybe__response) {
FatalError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
auto& response = *maybe__response;
// Sentinel = 'response'
if ((!(((&(reader__)))->ReadSentinel(260965232)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(response));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PQuota::Reply_TemporaryStorageInitialized__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PQuota::Msg_TemporaryStorageInitialized", 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<BoolResponse> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__response = IPC::ReadParam<BoolResponse>((&(reader__)));
if (!maybe__response) {
FatalError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
auto& response = *maybe__response;
// Sentinel = 'response'
if ((!(((&(reader__)))->ReadSentinel(260965232)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(response));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PQuota::Reply_InitializeStorage__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PQuota::Msg_InitializeStorage", 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<BoolResponse> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__response = IPC::ReadParam<BoolResponse>((&(reader__)));
if (!maybe__response) {
FatalError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
auto& response = *maybe__response;
// Sentinel = 'response'
if ((!(((&(reader__)))->ReadSentinel(260965232)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(response));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PQuota::Reply_InitializePersistentClient__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PQuota::Msg_InitializePersistentClient", 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<BoolResponse> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__response = IPC::ReadParam<BoolResponse>((&(reader__)));
if (!maybe__response) {
FatalError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
auto& response = *maybe__response;
// Sentinel = 'response'
if ((!(((&(reader__)))->ReadSentinel(260965232)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(response));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PQuota::Reply_InitializeTemporaryClient__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PQuota::Msg_InitializeTemporaryClient", 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<BoolResponse> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__response = IPC::ReadParam<BoolResponse>((&(reader__)));
if (!maybe__response) {
FatalError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
auto& response = *maybe__response;
// Sentinel = 'response'
if ((!(((&(reader__)))->ReadSentinel(260965232)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(response));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PQuota::Reply_InitializeTemporaryStorage__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PQuota::Msg_InitializeTemporaryStorage", 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<BoolResponse> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__response = IPC::ReadParam<BoolResponse>((&(reader__)));
if (!maybe__response) {
FatalError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
auto& response = *maybe__response;
// Sentinel = 'response'
if ((!(((&(reader__)))->ReadSentinel(260965232)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(response));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PQuota::Reply_ClearStoragesForOrigin__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PQuota::Msg_ClearStoragesForOrigin", 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<BoolResponse> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__response = IPC::ReadParam<BoolResponse>((&(reader__)));
if (!maybe__response) {
FatalError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
auto& response = *maybe__response;
// Sentinel = 'response'
if ((!(((&(reader__)))->ReadSentinel(260965232)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(response));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PQuota::Reply_ClearStoragesForOriginPrefix__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PQuota::Msg_ClearStoragesForOriginPrefix", 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<BoolResponse> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__response = IPC::ReadParam<BoolResponse>((&(reader__)));
if (!maybe__response) {
FatalError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
auto& response = *maybe__response;
// Sentinel = 'response'
if ((!(((&(reader__)))->ReadSentinel(260965232)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(response));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PQuota::Reply_ClearStoragesForOriginAttributesPattern__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PQuota::Msg_ClearStoragesForOriginAttributesPattern", 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<BoolResponse> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__response = IPC::ReadParam<BoolResponse>((&(reader__)));
if (!maybe__response) {
FatalError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
auto& response = *maybe__response;
// Sentinel = 'response'
if ((!(((&(reader__)))->ReadSentinel(260965232)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(response));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PQuota::Reply_ClearStoragesForPrivateBrowsing__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PQuota::Msg_ClearStoragesForPrivateBrowsing", 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<BoolResponse> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__response = IPC::ReadParam<BoolResponse>((&(reader__)));
if (!maybe__response) {
FatalError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
auto& response = *maybe__response;
// Sentinel = 'response'
if ((!(((&(reader__)))->ReadSentinel(260965232)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(response));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PQuota::Reply_ClearStorage__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PQuota::Msg_ClearStorage", 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<BoolResponse> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__response = IPC::ReadParam<BoolResponse>((&(reader__)));
if (!maybe__response) {
FatalError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
auto& response = *maybe__response;
// Sentinel = 'response'
if ((!(((&(reader__)))->ReadSentinel(260965232)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(response));
} else {
ResponseRejectReason reason__{};
if (!IPC::ReadParam(&reader__, &reason__)) {
FatalError("Error deserializing ResponseRejectReason");
return MsgValueError;
}
reader__.EndRead();
callback->Reject(std::move(reason__));
}
return MsgProcessed;
}
case PQuota::Reply_ShutdownStorage__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PQuota", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PQuotaChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PQuota::Msg_ShutdownStorage", 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<BoolResponse> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__response = IPC::ReadParam<BoolResponse>((&(reader__)));
if (!maybe__response) {
FatalError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
auto& response = *maybe__response;
// Sentinel = 'response'
if ((!(((&(reader__)))->ReadSentinel(260965232)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'BoolResponse'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(response));
} 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;
}
}
auto PQuotaChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PQuotaChild::Result
{
return MsgNotKnown;
}
auto PQuotaChild::DoomSubtree() -> void
{
for (auto* key : mManagedPQuotaRequestChild) {
key->DoomSubtree();
}
for (auto* key : mManagedPQuotaUsageRequestChild) {
key->DoomSubtree();
}
SetDoomed();
}
auto PQuotaChild::PeekManagedActor() -> IProtocol*
{
if (IProtocol* actor = mManagedPQuotaRequestChild.Peek()) {
return actor;
}
if (IProtocol* actor = mManagedPQuotaUsageRequestChild.Peek()) {
return actor;
}
return nullptr;
}
} // namespace quota
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::quota::PQuotaChild*>::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::quota::PQuotaChild*>::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, "PQuota", PQuotaMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::dom::quota::PQuotaChild*>(actor.ref());
}
return {};
}
} // namespace IPC