Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/RemoteLazyInputStream.h"
#include "mozilla/dom/indexedDB/ActorsChild.h"
#include "mozilla/dom/indexedDB/Key.h"
#include "mozilla/dom/indexedDB/KeyPath.h"
#include "mozilla/dom/indexedDB/SerializationHelpers.h"
#include "mozilla/dom/quota/SerializationHelpers.h"
#include "mozilla/ipc/IPCCore.h"
#include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseFileChild.h"
#include "mozilla/dom/indexedDB/PBackgroundIDBFactoryChild.h"
#include "mozilla/dom/indexedDB/PBackgroundIDBTransactionChild.h"
#include "mozilla/dom/indexedDB/PBackgroundIDBVersionChangeTransactionChild.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 indexedDB {
auto PBackgroundIDBDatabaseChild::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
auto PBackgroundIDBDatabaseChild::RecvPBackgroundIDBVersionChangeTransactionConstructor(
PBackgroundIDBVersionChangeTransactionChild* actor,
const uint64_t& currentVersion,
const uint64_t& requestedVersion,
const int64_t& nextObjectStoreId,
const int64_t& nextIndexId) -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
MOZ_IMPLICIT PBackgroundIDBDatabaseChild::PBackgroundIDBDatabaseChild() :
mozilla::ipc::IRefCountedProtocol(PBackgroundIDBDatabaseMsgStart, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PBackgroundIDBDatabaseChild);
}
PBackgroundIDBDatabaseChild::~PBackgroundIDBDatabaseChild()
{
MOZ_COUNT_DTOR(PBackgroundIDBDatabaseChild);
}
auto PBackgroundIDBDatabaseChild::ActorAlloc() -> void
{
AddRef();
}
auto PBackgroundIDBDatabaseChild::ActorDealloc() -> void
{
Release();
}
auto PBackgroundIDBDatabaseChild::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PBackgroundIDBDatabaseChild::Manager() const -> PBackgroundIDBFactoryChild*
{
return static_cast<PBackgroundIDBFactoryChild*>(IProtocol::Manager());
}
auto PBackgroundIDBDatabaseChild::ManagedPBackgroundIDBDatabaseFileChild(nsTArray<PBackgroundIDBDatabaseFileChild*>& aArr) const -> void
{
mManagedPBackgroundIDBDatabaseFileChild.ToArray(aArr);
}
auto PBackgroundIDBDatabaseChild::ManagedPBackgroundIDBDatabaseFileChild() const -> const ManagedContainer<PBackgroundIDBDatabaseFileChild>&
{
return mManagedPBackgroundIDBDatabaseFileChild;
}
auto PBackgroundIDBDatabaseChild::ManagedPBackgroundIDBTransactionChild(nsTArray<PBackgroundIDBTransactionChild*>& aArr) const -> void
{
mManagedPBackgroundIDBTransactionChild.ToArray(aArr);
}
auto PBackgroundIDBDatabaseChild::ManagedPBackgroundIDBTransactionChild() const -> const ManagedContainer<PBackgroundIDBTransactionChild>&
{
return mManagedPBackgroundIDBTransactionChild;
}
auto PBackgroundIDBDatabaseChild::ManagedPBackgroundIDBVersionChangeTransactionChild(nsTArray<PBackgroundIDBVersionChangeTransactionChild*>& aArr) const -> void
{
mManagedPBackgroundIDBVersionChangeTransactionChild.ToArray(aArr);
}
auto PBackgroundIDBDatabaseChild::ManagedPBackgroundIDBVersionChangeTransactionChild() const -> const ManagedContainer<PBackgroundIDBVersionChangeTransactionChild>&
{
return mManagedPBackgroundIDBVersionChangeTransactionChild;
}
auto PBackgroundIDBDatabaseChild::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
total += mManagedPBackgroundIDBDatabaseFileChild.Count();
total += mManagedPBackgroundIDBTransactionChild.Count();
total += mManagedPBackgroundIDBVersionChangeTransactionChild.Count();
return total;
}
auto PBackgroundIDBDatabaseChild::OpenPBackgroundIDBDatabaseFileEndpoint(PBackgroundIDBDatabaseFileChild* aActor) -> ManagedEndpoint<PBackgroundIDBDatabaseFileParent>
{
if (!aActor) {
NS_WARNING("Cannot bind null PBackgroundIDBDatabaseFileChild actor");
return ManagedEndpoint<PBackgroundIDBDatabaseFileParent>();
}
if (aActor->SetManagerAndRegister(this)) {
mManagedPBackgroundIDBDatabaseFileChild.Insert(aActor);
} else {
NS_WARNING("Failed to bind PBackgroundIDBDatabaseFileChild actor");
return ManagedEndpoint<PBackgroundIDBDatabaseFileParent>();
}
// 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<PBackgroundIDBDatabaseFileParent>(mozilla::ipc::PrivateIPDLInterface(), aActor);
}
auto PBackgroundIDBDatabaseChild::BindPBackgroundIDBDatabaseFileEndpoint(
ManagedEndpoint<PBackgroundIDBDatabaseFileChild> aEndpoint,
PBackgroundIDBDatabaseFileChild* aActor) -> bool
{
return aEndpoint.Bind(mozilla::ipc::PrivateIPDLInterface(), aActor, this, mManagedPBackgroundIDBDatabaseFileChild);
}
auto PBackgroundIDBDatabaseChild::OpenPBackgroundIDBTransactionEndpoint(PBackgroundIDBTransactionChild* aActor) -> ManagedEndpoint<PBackgroundIDBTransactionParent>
{
if (!aActor) {
NS_WARNING("Cannot bind null PBackgroundIDBTransactionChild actor");
return ManagedEndpoint<PBackgroundIDBTransactionParent>();
}
if (aActor->SetManagerAndRegister(this)) {
mManagedPBackgroundIDBTransactionChild.Insert(aActor);
} else {
NS_WARNING("Failed to bind PBackgroundIDBTransactionChild actor");
return ManagedEndpoint<PBackgroundIDBTransactionParent>();
}
// 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<PBackgroundIDBTransactionParent>(mozilla::ipc::PrivateIPDLInterface(), aActor);
}
auto PBackgroundIDBDatabaseChild::BindPBackgroundIDBTransactionEndpoint(
ManagedEndpoint<PBackgroundIDBTransactionChild> aEndpoint,
PBackgroundIDBTransactionChild* aActor) -> bool
{
return aEndpoint.Bind(mozilla::ipc::PrivateIPDLInterface(), aActor, this, mManagedPBackgroundIDBTransactionChild);
}
auto PBackgroundIDBDatabaseChild::OpenPBackgroundIDBVersionChangeTransactionEndpoint(PBackgroundIDBVersionChangeTransactionChild* aActor) -> ManagedEndpoint<PBackgroundIDBVersionChangeTransactionParent>
{
if (!aActor) {
NS_WARNING("Cannot bind null PBackgroundIDBVersionChangeTransactionChild actor");
return ManagedEndpoint<PBackgroundIDBVersionChangeTransactionParent>();
}
if (aActor->SetManagerAndRegister(this)) {
mManagedPBackgroundIDBVersionChangeTransactionChild.Insert(aActor);
} else {
NS_WARNING("Failed to bind PBackgroundIDBVersionChangeTransactionChild actor");
return ManagedEndpoint<PBackgroundIDBVersionChangeTransactionParent>();
}
// 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<PBackgroundIDBVersionChangeTransactionParent>(mozilla::ipc::PrivateIPDLInterface(), aActor);
}
auto PBackgroundIDBDatabaseChild::BindPBackgroundIDBVersionChangeTransactionEndpoint(
ManagedEndpoint<PBackgroundIDBVersionChangeTransactionChild> aEndpoint,
PBackgroundIDBVersionChangeTransactionChild* aActor) -> bool
{
return aEndpoint.Bind(mozilla::ipc::PrivateIPDLInterface(), aActor, this, mManagedPBackgroundIDBVersionChangeTransactionChild);
}
auto PBackgroundIDBDatabaseChild::SendDeleteMe() -> bool
{
UniquePtr<IPC::Message> msg__ = PBackgroundIDBDatabase::Msg_DeleteMe(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBDatabase", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PBackgroundIDBDatabaseChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PBackgroundIDBDatabase::Msg_DeleteMe", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PBackgroundIDBDatabaseChild::SendBlocked() -> bool
{
UniquePtr<IPC::Message> msg__ = PBackgroundIDBDatabase::Msg_Blocked(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBDatabase", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PBackgroundIDBDatabaseChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PBackgroundIDBDatabase::Msg_Blocked", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PBackgroundIDBDatabaseChild::SendClose() -> bool
{
UniquePtr<IPC::Message> msg__ = PBackgroundIDBDatabase::Msg_Close(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBDatabase", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PBackgroundIDBDatabaseChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PBackgroundIDBDatabase::Msg_Close", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PBackgroundIDBDatabaseChild::SendPBackgroundIDBDatabaseFileConstructor(const IPCBlob& blob) -> PBackgroundIDBDatabaseFileChild*
{
PBackgroundIDBDatabaseFileChild* actor = (static_cast<indexedDB::BackgroundDatabaseChild*>(this))->AllocPBackgroundIDBDatabaseFileChild(blob);
return SendPBackgroundIDBDatabaseFileConstructor(std::move(actor), std::move(blob));
}
auto PBackgroundIDBDatabaseChild::SendPBackgroundIDBDatabaseFileConstructor(
PBackgroundIDBDatabaseFileChild* actor,
const IPCBlob& blob) -> PBackgroundIDBDatabaseFileChild*
{
if (!actor) {
NS_WARNING("Cannot bind null PBackgroundIDBDatabaseFileChild actor");
return nullptr;
}
if (actor->SetManagerAndRegister(this)) {
mManagedPBackgroundIDBDatabaseFileChild.Insert(actor);
} else {
NS_WARNING("Failed to bind PBackgroundIDBDatabaseFileChild actor");
return nullptr;
}
// Build our constructor message.
UniquePtr<IPC::Message> msg__ = PBackgroundIDBDatabase::Msg_PBackgroundIDBDatabaseFileConstructor(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), actor);
// Sentinel = 'actor'
((&(writer__)))->WriteSentinel(102892058);
IPC::WriteParam((&(writer__)), blob);
// Sentinel = 'blob'
((&(writer__)))->WriteSentinel(68157856);
// 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("PBackgroundIDBDatabase", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PBackgroundIDBDatabaseChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PBackgroundIDBDatabase::Msg_PBackgroundIDBDatabaseFileConstructor", 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 PBackgroundIDBDatabaseFileChild constructor");
actor->ActorDisconnected(FailedConstructor);
return nullptr;
}
return actor;
}
auto PBackgroundIDBDatabaseChild::SendPBackgroundIDBTransactionConstructor(
PBackgroundIDBTransactionChild* actor,
mozilla::Span<nsString const> objectStoreNames,
const Mode& mode,
const Durability& durability) -> PBackgroundIDBTransactionChild*
{
if (!actor) {
NS_WARNING("Cannot bind null PBackgroundIDBTransactionChild actor");
return nullptr;
}
if (actor->SetManagerAndRegister(this)) {
mManagedPBackgroundIDBTransactionChild.Insert(actor);
} else {
NS_WARNING("Failed to bind PBackgroundIDBTransactionChild actor");
return nullptr;
}
// Build our constructor message.
UniquePtr<IPC::Message> msg__ = PBackgroundIDBDatabase::Msg_PBackgroundIDBTransactionConstructor(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), actor);
// Sentinel = 'actor'
((&(writer__)))->WriteSentinel(102892058);
IPC::WriteParam((&(writer__)), objectStoreNames);
// Sentinel = 'objectStoreNames'
((&(writer__)))->WriteSentinel(924780153);
IPC::WriteParam((&(writer__)), mode);
// Sentinel = 'mode'
((&(writer__)))->WriteSentinel(70386086);
IPC::WriteParam((&(writer__)), durability);
// Sentinel = 'durability'
((&(writer__)))->WriteSentinel(384500794);
// 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("PBackgroundIDBDatabase", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PBackgroundIDBDatabaseChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PBackgroundIDBDatabase::Msg_PBackgroundIDBTransactionConstructor", 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 PBackgroundIDBTransactionChild constructor");
actor->ActorDisconnected(FailedConstructor);
return nullptr;
}
return actor;
}
auto PBackgroundIDBDatabaseChild::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
switch (aProtocolId) {
case PBackgroundIDBDatabaseFileMsgStart:
MOZ_ALWAYS_TRUE(mManagedPBackgroundIDBDatabaseFileChild.EnsureRemoved(static_cast<PBackgroundIDBDatabaseFileChild*>(aListener)));
return;
case PBackgroundIDBTransactionMsgStart:
MOZ_ALWAYS_TRUE(mManagedPBackgroundIDBTransactionChild.EnsureRemoved(static_cast<PBackgroundIDBTransactionChild*>(aListener)));
return;
case PBackgroundIDBVersionChangeTransactionMsgStart:
MOZ_ALWAYS_TRUE(mManagedPBackgroundIDBVersionChangeTransactionChild.EnsureRemoved(static_cast<PBackgroundIDBVersionChangeTransactionChild*>(aListener)));
return;
default:
FatalError("unreached");
return; }
}
auto PBackgroundIDBDatabaseChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
switch (aProtocolId) {
case PBackgroundIDBDatabaseFileMsgStart:
static_cast<indexedDB::BackgroundDatabaseChild*>(this)->DeallocPBackgroundIDBDatabaseFileChild(static_cast<PBackgroundIDBDatabaseFileChild*>(aListener));
return;
default:
FatalError("unreached");
return;
}
}
auto PBackgroundIDBDatabaseChild::OnMessageReceived(const Message& msg__) -> PBackgroundIDBDatabaseChild::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 PBackgroundIDBDatabase::Reply_PBackgroundIDBDatabaseFileConstructor__ID:
{
return MsgProcessed;
}
case PBackgroundIDBDatabase::Reply_PBackgroundIDBTransactionConstructor__ID:
{
return MsgProcessed;
}
case PBackgroundIDBDatabase::Msg___delete____ID:
{
if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBDatabase", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PBackgroundIDBDatabaseChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PBackgroundIDBDatabase::Msg___delete__", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<indexedDB::BackgroundDatabaseChild*>(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 PBackgroundIDBDatabase::Msg_VersionChange__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBDatabase", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PBackgroundIDBDatabaseChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PBackgroundIDBDatabase::Msg_VersionChange", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__oldVersion = IPC::ReadParam<uint64_t>((&(reader__)));
if (!maybe__oldVersion) {
FatalError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto& oldVersion = *maybe__oldVersion;
// Sentinel = 'oldVersion'
if ((!(((&(reader__)))->ReadSentinel(378602534)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto maybe__newVersion = IPC::ReadParam<mozilla::Maybe<uint64_t>>((&(reader__)));
if (!maybe__newVersion) {
FatalError("Error deserializing 'uint64_t?'");
return MsgValueError;
}
auto& newVersion = *maybe__newVersion;
// Sentinel = 'newVersion'
if ((!(((&(reader__)))->ReadSentinel(383779889)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t?'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<indexedDB::BackgroundDatabaseChild*>(this))->RecvVersionChange(std::move(oldVersion), std::move(newVersion));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PBackgroundIDBDatabase::Msg_Invalidate__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBDatabase", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PBackgroundIDBDatabaseChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PBackgroundIDBDatabase::Msg_Invalidate", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<indexedDB::BackgroundDatabaseChild*>(this))->RecvInvalidate();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PBackgroundIDBDatabase::Msg_CloseAfterInvalidationComplete__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBDatabase", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PBackgroundIDBDatabaseChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PBackgroundIDBDatabase::Msg_CloseAfterInvalidationComplete", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<indexedDB::BackgroundDatabaseChild*>(this))->RecvCloseAfterInvalidationComplete();
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PBackgroundIDBDatabase::Msg_PBackgroundIDBVersionChangeTransactionConstructor__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBDatabase", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PBackgroundIDBDatabaseChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PBackgroundIDBDatabase::Msg_PBackgroundIDBVersionChangeTransactionConstructor", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__handle__ = IPC::ReadParam<ActorHandle>((&(reader__)));
if (!maybe__handle__) {
FatalError("Error deserializing 'ActorHandle'");
return MsgValueError;
}
auto& handle__ = *maybe__handle__;
// Sentinel = 'actor'
if ((!(((&(reader__)))->ReadSentinel(102892058)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'");
return MsgValueError;
}
auto maybe__currentVersion = IPC::ReadParam<uint64_t>((&(reader__)));
if (!maybe__currentVersion) {
FatalError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto& currentVersion = *maybe__currentVersion;
// Sentinel = 'currentVersion'
if ((!(((&(reader__)))->ReadSentinel(744228330)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto maybe__requestedVersion = IPC::ReadParam<uint64_t>((&(reader__)));
if (!maybe__requestedVersion) {
FatalError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto& requestedVersion = *maybe__requestedVersion;
// Sentinel = 'requestedVersion'
if ((!(((&(reader__)))->ReadSentinel(962660025)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto maybe__nextObjectStoreId = IPC::ReadParam<int64_t>((&(reader__)));
if (!maybe__nextObjectStoreId) {
FatalError("Error deserializing 'int64_t'");
return MsgValueError;
}
auto& nextObjectStoreId = *maybe__nextObjectStoreId;
// Sentinel = 'nextObjectStoreId'
if ((!(((&(reader__)))->ReadSentinel(1046087377)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'int64_t'");
return MsgValueError;
}
auto maybe__nextIndexId = IPC::ReadParam<int64_t>((&(reader__)));
if (!maybe__nextIndexId) {
FatalError("Error deserializing 'int64_t'");
return MsgValueError;
}
auto& nextIndexId = *maybe__nextIndexId;
// Sentinel = 'nextIndexId'
if ((!(((&(reader__)))->ReadSentinel(453510245)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'int64_t'");
return MsgValueError;
}
reader__.EndRead();
RefPtr<PBackgroundIDBVersionChangeTransactionChild> actor = (static_cast<indexedDB::BackgroundDatabaseChild*>(this))->AllocPBackgroundIDBVersionChangeTransactionChild(currentVersion, requestedVersion, nextObjectStoreId, nextIndexId);
if (!actor) {
NS_WARNING("Cannot bind null PBackgroundIDBVersionChangeTransactionChild actor");
return MsgValueError;
}
if (actor->SetManagerAndRegister(this, (handle__).mId)) {
mManagedPBackgroundIDBVersionChangeTransactionChild.Insert(actor);
} else {
NS_WARNING("Failed to bind PBackgroundIDBVersionChangeTransactionChild actor");
return MsgValueError;
}
mozilla::ipc::IPCResult __ok = (static_cast<indexedDB::BackgroundDatabaseChild*>(this))->RecvPBackgroundIDBVersionChangeTransactionConstructor(actor, std::move(currentVersion), std::move(requestedVersion), std::move(nextObjectStoreId), std::move(nextIndexId));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PBackgroundIDBDatabaseChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PBackgroundIDBDatabaseChild::Result
{
return MsgNotKnown;
}
auto PBackgroundIDBDatabaseChild::DoomSubtree() -> void
{
for (auto* key : mManagedPBackgroundIDBDatabaseFileChild) {
key->DoomSubtree();
}
for (auto* key : mManagedPBackgroundIDBTransactionChild) {
key->DoomSubtree();
}
for (auto* key : mManagedPBackgroundIDBVersionChangeTransactionChild) {
key->DoomSubtree();
}
SetDoomed();
}
auto PBackgroundIDBDatabaseChild::PeekManagedActor() -> IProtocol*
{
if (IProtocol* actor = mManagedPBackgroundIDBDatabaseFileChild.Peek()) {
return actor;
}
if (IProtocol* actor = mManagedPBackgroundIDBTransactionChild.Peek()) {
return actor;
}
if (IProtocol* actor = mManagedPBackgroundIDBVersionChangeTransactionChild.Peek()) {
return actor;
}
return nullptr;
}
} // namespace indexedDB
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::indexedDB::PBackgroundIDBDatabaseChild*>::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::indexedDB::PBackgroundIDBDatabaseChild*>::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, "PBackgroundIDBDatabase", PBackgroundIDBDatabaseMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::dom::indexedDB::PBackgroundIDBDatabaseChild*>(actor.ref());
}
return {};
}
} // namespace IPC