Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/PFileSystemParams.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"
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct FileSystemGetDirectoryListingParams|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::FileSystemGetDirectoryListingParams>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, (aVar).filesystem());
// Sentinel = 'filesystem'
(aWriter)->WriteSentinel(390595654);
IPC::WriteParam(aWriter, (aVar).realPath());
// Sentinel = 'realPath'
(aWriter)->WriteSentinel(242221874);
IPC::WriteParam(aWriter, (aVar).domPath());
// Sentinel = 'domPath'
(aWriter)->WriteSentinel(187761358);
IPC::WriteParam(aWriter, (aVar).filters());
// Sentinel = 'filters'
(aWriter)->WriteSentinel(196674298);
}
auto ParamTraits<::mozilla::dom::FileSystemGetDirectoryListingParams>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe___filesystem = IPC::ReadParam<::nsString>(aReader);
if (!maybe___filesystem) {
aReader->FatalError("Error deserializing 'filesystem' (nsString) member of 'FileSystemGetDirectoryListingParams'");
return {};
}
auto& _filesystem = *maybe___filesystem;
// Sentinel = 'filesystem'
if ((!((aReader)->ReadSentinel(390595654)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'filesystem' (nsString) member of 'FileSystemGetDirectoryListingParams'");
return {};
}
auto maybe___realPath = IPC::ReadParam<::nsString>(aReader);
if (!maybe___realPath) {
aReader->FatalError("Error deserializing 'realPath' (nsString) member of 'FileSystemGetDirectoryListingParams'");
return {};
}
auto& _realPath = *maybe___realPath;
// Sentinel = 'realPath'
if ((!((aReader)->ReadSentinel(242221874)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'realPath' (nsString) member of 'FileSystemGetDirectoryListingParams'");
return {};
}
auto maybe___domPath = IPC::ReadParam<::nsString>(aReader);
if (!maybe___domPath) {
aReader->FatalError("Error deserializing 'domPath' (nsString) member of 'FileSystemGetDirectoryListingParams'");
return {};
}
auto& _domPath = *maybe___domPath;
// Sentinel = 'domPath'
if ((!((aReader)->ReadSentinel(187761358)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'domPath' (nsString) member of 'FileSystemGetDirectoryListingParams'");
return {};
}
auto maybe___filters = IPC::ReadParam<::nsString>(aReader);
if (!maybe___filters) {
aReader->FatalError("Error deserializing 'filters' (nsString) member of 'FileSystemGetDirectoryListingParams'");
return {};
}
auto& _filters = *maybe___filters;
// Sentinel = 'filters'
if ((!((aReader)->ReadSentinel(196674298)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'filters' (nsString) member of 'FileSystemGetDirectoryListingParams'");
return {};
}
IPC::ReadResult<paramType> result__{
std::in_place,
std::move(_filesystem),
std::move(_realPath),
std::move(_domPath),
std::move(_filters)};
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct FileSystemGetFilesParams|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::FileSystemGetFilesParams>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, (aVar).filesystem());
// Sentinel = 'filesystem'
(aWriter)->WriteSentinel(390595654);
IPC::WriteParam(aWriter, (aVar).realPath());
// Sentinel = 'realPath'
(aWriter)->WriteSentinel(242221874);
IPC::WriteParam(aWriter, (aVar).domPath());
// Sentinel = 'domPath'
(aWriter)->WriteSentinel(187761358);
IPC::WriteParam(aWriter, (aVar).recursiveFlag());
// Sentinel = 'recursiveFlag'
(aWriter)->WriteSentinel(639698259);
}
auto ParamTraits<::mozilla::dom::FileSystemGetFilesParams>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe___filesystem = IPC::ReadParam<::nsString>(aReader);
if (!maybe___filesystem) {
aReader->FatalError("Error deserializing 'filesystem' (nsString) member of 'FileSystemGetFilesParams'");
return {};
}
auto& _filesystem = *maybe___filesystem;
// Sentinel = 'filesystem'
if ((!((aReader)->ReadSentinel(390595654)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'filesystem' (nsString) member of 'FileSystemGetFilesParams'");
return {};
}
auto maybe___realPath = IPC::ReadParam<::nsString>(aReader);
if (!maybe___realPath) {
aReader->FatalError("Error deserializing 'realPath' (nsString) member of 'FileSystemGetFilesParams'");
return {};
}
auto& _realPath = *maybe___realPath;
// Sentinel = 'realPath'
if ((!((aReader)->ReadSentinel(242221874)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'realPath' (nsString) member of 'FileSystemGetFilesParams'");
return {};
}
auto maybe___domPath = IPC::ReadParam<::nsString>(aReader);
if (!maybe___domPath) {
aReader->FatalError("Error deserializing 'domPath' (nsString) member of 'FileSystemGetFilesParams'");
return {};
}
auto& _domPath = *maybe___domPath;
// Sentinel = 'domPath'
if ((!((aReader)->ReadSentinel(187761358)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'domPath' (nsString) member of 'FileSystemGetFilesParams'");
return {};
}
auto maybe___recursiveFlag = IPC::ReadParam<bool>(aReader);
if (!maybe___recursiveFlag) {
aReader->FatalError("Error deserializing 'recursiveFlag' (bool) member of 'FileSystemGetFilesParams'");
return {};
}
auto& _recursiveFlag = *maybe___recursiveFlag;
// Sentinel = 'recursiveFlag'
if ((!((aReader)->ReadSentinel(639698259)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'recursiveFlag' (bool) member of 'FileSystemGetFilesParams'");
return {};
}
IPC::ReadResult<paramType> result__{
std::in_place,
std::move(_filesystem),
std::move(_realPath),
std::move(_domPath),
std::move(_recursiveFlag)};
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct FileSystemGetFileOrDirectoryParams|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::FileSystemGetFileOrDirectoryParams>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, (aVar).filesystem());
// Sentinel = 'filesystem'
(aWriter)->WriteSentinel(390595654);
IPC::WriteParam(aWriter, (aVar).realPath());
// Sentinel = 'realPath'
(aWriter)->WriteSentinel(242221874);
}
auto ParamTraits<::mozilla::dom::FileSystemGetFileOrDirectoryParams>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe___filesystem = IPC::ReadParam<::nsString>(aReader);
if (!maybe___filesystem) {
aReader->FatalError("Error deserializing 'filesystem' (nsString) member of 'FileSystemGetFileOrDirectoryParams'");
return {};
}
auto& _filesystem = *maybe___filesystem;
// Sentinel = 'filesystem'
if ((!((aReader)->ReadSentinel(390595654)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'filesystem' (nsString) member of 'FileSystemGetFileOrDirectoryParams'");
return {};
}
auto maybe___realPath = IPC::ReadParam<::nsString>(aReader);
if (!maybe___realPath) {
aReader->FatalError("Error deserializing 'realPath' (nsString) member of 'FileSystemGetFileOrDirectoryParams'");
return {};
}
auto& _realPath = *maybe___realPath;
// Sentinel = 'realPath'
if ((!((aReader)->ReadSentinel(242221874)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'realPath' (nsString) member of 'FileSystemGetFileOrDirectoryParams'");
return {};
}
IPC::ReadResult<paramType> result__{
std::in_place,
std::move(_filesystem),
std::move(_realPath)};
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |union FileSystemParams|
//
namespace mozilla {
namespace dom {
auto FileSystemParams::MaybeDestroy() -> void
{
if ((mType) == (T__None)) {
return;
}
switch (mType) {
case TFileSystemGetDirectoryListingParams:
{
(ptr_FileSystemGetDirectoryListingParams())->~FileSystemGetDirectoryListingParams__tdef();
break;
}
case TFileSystemGetFilesParams:
{
(ptr_FileSystemGetFilesParams())->~FileSystemGetFilesParams__tdef();
break;
}
case TFileSystemGetFileOrDirectoryParams:
{
(ptr_FileSystemGetFileOrDirectoryParams())->~FileSystemGetFileOrDirectoryParams__tdef();
break;
}
default:
{
mozilla::ipc::LogicError("not reached");
break;
}
}
}
MOZ_IMPLICIT FileSystemParams::FileSystemParams(const FileSystemGetDirectoryListingParams& aOther)
{
new (mozilla::KnownNotNull, ptr_FileSystemGetDirectoryListingParams()) FileSystemGetDirectoryListingParams(aOther);
mType = TFileSystemGetDirectoryListingParams;
}
MOZ_IMPLICIT FileSystemParams::FileSystemParams(FileSystemGetDirectoryListingParams&& aOther)
{
new (mozilla::KnownNotNull, ptr_FileSystemGetDirectoryListingParams()) FileSystemGetDirectoryListingParams(std::move(aOther));
mType = TFileSystemGetDirectoryListingParams;
}
MOZ_IMPLICIT FileSystemParams::FileSystemParams(const FileSystemGetFilesParams& aOther)
{
new (mozilla::KnownNotNull, ptr_FileSystemGetFilesParams()) FileSystemGetFilesParams(aOther);
mType = TFileSystemGetFilesParams;
}
MOZ_IMPLICIT FileSystemParams::FileSystemParams(FileSystemGetFilesParams&& aOther)
{
new (mozilla::KnownNotNull, ptr_FileSystemGetFilesParams()) FileSystemGetFilesParams(std::move(aOther));
mType = TFileSystemGetFilesParams;
}
MOZ_IMPLICIT FileSystemParams::FileSystemParams(const FileSystemGetFileOrDirectoryParams& aOther)
{
new (mozilla::KnownNotNull, ptr_FileSystemGetFileOrDirectoryParams()) FileSystemGetFileOrDirectoryParams(aOther);
mType = TFileSystemGetFileOrDirectoryParams;
}
MOZ_IMPLICIT FileSystemParams::FileSystemParams(FileSystemGetFileOrDirectoryParams&& aOther)
{
new (mozilla::KnownNotNull, ptr_FileSystemGetFileOrDirectoryParams()) FileSystemGetFileOrDirectoryParams(std::move(aOther));
mType = TFileSystemGetFileOrDirectoryParams;
}
MOZ_IMPLICIT FileSystemParams::FileSystemParams(const FileSystemParams& aOther)
{
(aOther).AssertSanity();
switch ((aOther).type()) {
case TFileSystemGetDirectoryListingParams:
{
new (mozilla::KnownNotNull, ptr_FileSystemGetDirectoryListingParams()) FileSystemGetDirectoryListingParams((aOther).get_FileSystemGetDirectoryListingParams());
break;
}
case TFileSystemGetFilesParams:
{
new (mozilla::KnownNotNull, ptr_FileSystemGetFilesParams()) FileSystemGetFilesParams((aOther).get_FileSystemGetFilesParams());
break;
}
case TFileSystemGetFileOrDirectoryParams:
{
new (mozilla::KnownNotNull, ptr_FileSystemGetFileOrDirectoryParams()) FileSystemGetFileOrDirectoryParams((aOther).get_FileSystemGetFileOrDirectoryParams());
break;
}
case T__None:
{
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
return;
}
}
mType = (aOther).type();
}
MOZ_IMPLICIT FileSystemParams::FileSystemParams(FileSystemParams&& aOther)
{
(aOther).AssertSanity();
Type t = (aOther).type();
switch (t) {
case TFileSystemGetDirectoryListingParams:
{
new (mozilla::KnownNotNull, ptr_FileSystemGetDirectoryListingParams()) FileSystemGetDirectoryListingParams(std::move((aOther).get_FileSystemGetDirectoryListingParams()));
(aOther).MaybeDestroy();
break;
}
case TFileSystemGetFilesParams:
{
new (mozilla::KnownNotNull, ptr_FileSystemGetFilesParams()) FileSystemGetFilesParams(std::move((aOther).get_FileSystemGetFilesParams()));
(aOther).MaybeDestroy();
break;
}
case TFileSystemGetFileOrDirectoryParams:
{
new (mozilla::KnownNotNull, ptr_FileSystemGetFileOrDirectoryParams()) FileSystemGetFileOrDirectoryParams(std::move((aOther).get_FileSystemGetFileOrDirectoryParams()));
(aOther).MaybeDestroy();
break;
}
case T__None:
{
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
return;
}
}
(aOther).mType = T__None;
mType = t;
}
FileSystemParams::~FileSystemParams()
{
MaybeDestroy();
}
auto FileSystemParams::operator=(const FileSystemGetDirectoryListingParams& aRhs) -> FileSystemParams&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_FileSystemGetDirectoryListingParams()) FileSystemGetDirectoryListingParams(aRhs);
mType = TFileSystemGetDirectoryListingParams;
return (*(this));
}
auto FileSystemParams::operator=(FileSystemGetDirectoryListingParams&& aRhs) -> FileSystemParams&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_FileSystemGetDirectoryListingParams()) FileSystemGetDirectoryListingParams(std::move(aRhs));
mType = TFileSystemGetDirectoryListingParams;
return (*(this));
}
auto FileSystemParams::operator=(const FileSystemGetFilesParams& aRhs) -> FileSystemParams&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_FileSystemGetFilesParams()) FileSystemGetFilesParams(aRhs);
mType = TFileSystemGetFilesParams;
return (*(this));
}
auto FileSystemParams::operator=(FileSystemGetFilesParams&& aRhs) -> FileSystemParams&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_FileSystemGetFilesParams()) FileSystemGetFilesParams(std::move(aRhs));
mType = TFileSystemGetFilesParams;
return (*(this));
}
auto FileSystemParams::operator=(const FileSystemGetFileOrDirectoryParams& aRhs) -> FileSystemParams&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_FileSystemGetFileOrDirectoryParams()) FileSystemGetFileOrDirectoryParams(aRhs);
mType = TFileSystemGetFileOrDirectoryParams;
return (*(this));
}
auto FileSystemParams::operator=(FileSystemGetFileOrDirectoryParams&& aRhs) -> FileSystemParams&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_FileSystemGetFileOrDirectoryParams()) FileSystemGetFileOrDirectoryParams(std::move(aRhs));
mType = TFileSystemGetFileOrDirectoryParams;
return (*(this));
}
auto FileSystemParams::operator=(const FileSystemParams& aRhs) -> FileSystemParams&
{
(aRhs).AssertSanity();
Type t = (aRhs).type();
switch (t) {
case TFileSystemGetDirectoryListingParams:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_FileSystemGetDirectoryListingParams()) FileSystemGetDirectoryListingParams((aRhs).get_FileSystemGetDirectoryListingParams());
break;
}
case TFileSystemGetFilesParams:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_FileSystemGetFilesParams()) FileSystemGetFilesParams((aRhs).get_FileSystemGetFilesParams());
break;
}
case TFileSystemGetFileOrDirectoryParams:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_FileSystemGetFileOrDirectoryParams()) FileSystemGetFileOrDirectoryParams((aRhs).get_FileSystemGetFileOrDirectoryParams());
break;
}
case T__None:
{
MaybeDestroy();
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
break;
}
}
mType = t;
return (*(this));
}
auto FileSystemParams::operator=(FileSystemParams&& aRhs) -> FileSystemParams&
{
(aRhs).AssertSanity();
Type t = (aRhs).type();
switch (t) {
case TFileSystemGetDirectoryListingParams:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_FileSystemGetDirectoryListingParams()) FileSystemGetDirectoryListingParams(std::move((aRhs).get_FileSystemGetDirectoryListingParams()));
(aRhs).MaybeDestroy();
break;
}
case TFileSystemGetFilesParams:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_FileSystemGetFilesParams()) FileSystemGetFilesParams(std::move((aRhs).get_FileSystemGetFilesParams()));
(aRhs).MaybeDestroy();
break;
}
case TFileSystemGetFileOrDirectoryParams:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_FileSystemGetFileOrDirectoryParams()) FileSystemGetFileOrDirectoryParams(std::move((aRhs).get_FileSystemGetFileOrDirectoryParams()));
(aRhs).MaybeDestroy();
break;
}
case T__None:
{
MaybeDestroy();
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
break;
}
}
(aRhs).mType = T__None;
mType = t;
return (*(this));
}
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::FileSystemParams>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
typedef ::mozilla::dom::FileSystemParams union__;
int type = (aVar).type();
IPC::WriteParam(aWriter, type);
// Sentinel = 'FileSystemParams'
(aWriter)->WriteSentinel(896075370);
switch (type) {
case union__::TFileSystemGetDirectoryListingParams:
{
IPC::WriteParam(aWriter, (aVar).get_FileSystemGetDirectoryListingParams());
// Sentinel = 'TFileSystemGetDirectoryListingParams'
(aWriter)->WriteSentinel(109252205);
return;
}
case union__::TFileSystemGetFilesParams:
{
IPC::WriteParam(aWriter, (aVar).get_FileSystemGetFilesParams());
// Sentinel = 'TFileSystemGetFilesParams'
(aWriter)->WriteSentinel(2104887761);
return;
}
case union__::TFileSystemGetFileOrDirectoryParams:
{
IPC::WriteParam(aWriter, (aVar).get_FileSystemGetFileOrDirectoryParams());
// Sentinel = 'TFileSystemGetFileOrDirectoryParams'
(aWriter)->WriteSentinel(4098035156);
return;
}
default:
{
aWriter->FatalError("unknown variant of union FileSystemParams");
return;
}
}
}
auto ParamTraits<::mozilla::dom::FileSystemParams>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
typedef ::mozilla::dom::FileSystemParams union__;
auto maybe__type = IPC::ReadParam<int>(aReader);
if (!maybe__type) {
aReader->FatalError("Error deserializing type of union FileSystemParams");
return {};
}
auto& type = *maybe__type;
// Sentinel = 'FileSystemParams'
if ((!((aReader)->ReadSentinel(896075370)))) {
mozilla::ipc::SentinelReadError("Error deserializing type of union FileSystemParams");
return {};
}
switch (type) {
case union__::TFileSystemGetDirectoryListingParams:
{
auto maybe__tmp = IPC::ReadParam<::mozilla::dom::FileSystemGetDirectoryListingParams>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TFileSystemGetDirectoryListingParams of union FileSystemParams");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TFileSystemGetDirectoryListingParams'
if ((!((aReader)->ReadSentinel(109252205)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TFileSystemGetDirectoryListingParams of union FileSystemParams");
return {};
}
return std::move(tmp);
}
case union__::TFileSystemGetFilesParams:
{
auto maybe__tmp = IPC::ReadParam<::mozilla::dom::FileSystemGetFilesParams>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TFileSystemGetFilesParams of union FileSystemParams");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TFileSystemGetFilesParams'
if ((!((aReader)->ReadSentinel(2104887761)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TFileSystemGetFilesParams of union FileSystemParams");
return {};
}
return std::move(tmp);
}
case union__::TFileSystemGetFileOrDirectoryParams:
{
auto maybe__tmp = IPC::ReadParam<::mozilla::dom::FileSystemGetFileOrDirectoryParams>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TFileSystemGetFileOrDirectoryParams of union FileSystemParams");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TFileSystemGetFileOrDirectoryParams'
if ((!((aReader)->ReadSentinel(4098035156)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TFileSystemGetFileOrDirectoryParams of union FileSystemParams");
return {};
}
return std::move(tmp);
}
default:
{
aReader->FatalError("unknown variant of union FileSystemParams");
return {};
}
}
}
} // namespace IPC