Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/PFileSystemAccessHandleControlChild.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/dom/FileSystemAccessHandleControlChild.h"
#include "mozilla/ipc/IPCCore.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 PFileSystemAccessHandleControlChild::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PFileSystemAccessHandleControlChild::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PFileSystemAccessHandleControlChild::PFileSystemAccessHandleControlChild() :
mozilla::ipc::IToplevelProtocol("PFileSystemAccessHandleControlChild", PFileSystemAccessHandleControlMsgStart, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PFileSystemAccessHandleControlChild);
}
PFileSystemAccessHandleControlChild::~PFileSystemAccessHandleControlChild()
{
MOZ_COUNT_DTOR(PFileSystemAccessHandleControlChild);
}
auto PFileSystemAccessHandleControlChild::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsParentProcess() || XRE_IsContentProcess(), "Invalid process for `PFileSystemAccessHandleControlChild'");
AddRef();
}
auto PFileSystemAccessHandleControlChild::ActorDealloc() -> void
{
Release();
}
auto PFileSystemAccessHandleControlChild::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PFileSystemAccessHandleControlChild::SendClose(
mozilla::ipc::ResolveCallback<void_t>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PFileSystemAccessHandleControl::Msg_Close(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PFileSystemAccessHandleControl", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFileSystemAccessHandleControlChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PFileSystemAccessHandleControl::Msg_Close", OTHER);
ChannelSend(std::move(msg__), PFileSystemAccessHandleControl::Reply_Close__ID, std::move(aResolve), std::move(aReject));
return;
}
auto PFileSystemAccessHandleControlChild::SendClose() -> RefPtr<ClosePromise>
{
RefPtr<MozPromise<void_t, ResponseRejectReason, true>::Private> promise__ = new MozPromise<void_t, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendClose([promise__](void_t&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PFileSystemAccessHandleControlChild::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PFileSystemAccessHandleControlChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PFileSystemAccessHandleControlChild::OnMessageReceived(const Message& msg__) -> PFileSystemAccessHandleControlChild::Result
{
switch (msg__.type()) {
case PFileSystemAccessHandleControl::Reply_Close__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PFileSystemAccessHandleControl", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PFileSystemAccessHandleControlChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PFileSystemAccessHandleControl::Msg_Close", 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<void_t> CallbackHolder;
auto* callback = static_cast<CallbackHolder*>(untypedCallback.get());
if (!callback) {
FatalError("Error unknown callback");
return MsgProcessingError;
}
if (resolve__) {
auto maybe__ok = IPC::ReadParam<void_t>((&(reader__)));
if (!maybe__ok) {
FatalError("Error deserializing 'void_t'");
return MsgValueError;
}
auto& ok = *maybe__ok;
// Sentinel = 'ok'
if ((!(((&(reader__)))->ReadSentinel(21692635)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'void_t'");
return MsgValueError;
}
reader__.EndRead();
callback->Resolve(std::move(ok));
} 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;
case SHMEM_CREATED_MESSAGE_TYPE:
{
if (!ShmemCreated(msg__)) {
return MsgPayloadError;
}
return MsgProcessed;
}
case SHMEM_DESTROYED_MESSAGE_TYPE:
{
if (!ShmemDestroyed(msg__)) {
return MsgPayloadError;
}
return MsgProcessed;
}
}
}
auto PFileSystemAccessHandleControlChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PFileSystemAccessHandleControlChild::Result
{
MOZ_ASSERT_UNREACHABLE("message protocol not supported");
return MsgNotKnown;
}
auto PFileSystemAccessHandleControlChild::DoomSubtree() -> void
{
SetDoomed();
}
auto PFileSystemAccessHandleControlChild::PeekManagedActor() -> IProtocol*
{
return nullptr;
}
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::PFileSystemAccessHandleControlChild*>::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::PFileSystemAccessHandleControlChild*>::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, "PFileSystemAccessHandleControl", PFileSystemAccessHandleControlMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::dom::PFileSystemAccessHandleControlChild*>(actor.ref());
}
return {};
}
} // namespace IPC