Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/widget/filedialog/WinFileDialogCommandsDefn.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 SetOptions|
//
namespace mozilla {
namespace widget {
namespace filedialog {
} // namespace filedialog
} // namespace widget
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::widget::filedialog::SetOptions>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
(aWriter)->WriteBytes((&((aVar).options())), 4);
// Sentinel = 'options'
(aWriter)->WriteSentinel(204735245);
}
auto ParamTraits<::mozilla::widget::filedialog::SetOptions>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
IPC::ReadResult<paramType> result__{
std::in_place,
::uint32_t{0}};
if ((!((aReader)->ReadBytesInto((&((result__)->options())), 4)))) {
aReader->FatalError("Error bulk reading fields from uint32_t");
return {};
}
// Sentinel = 'options'
if ((!((aReader)->ReadSentinel(204735245)))) {
mozilla::ipc::SentinelReadError("Error bulk reading fields from uint32_t");
return {};
}
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct SetTitle|
//
namespace mozilla {
namespace widget {
namespace filedialog {
} // namespace filedialog
} // namespace widget
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::widget::filedialog::SetTitle>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, (aVar).title());
// Sentinel = 'title'
(aWriter)->WriteSentinel(109445667);
}
auto ParamTraits<::mozilla::widget::filedialog::SetTitle>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe___title = IPC::ReadParam<::nsString>(aReader);
if (!maybe___title) {
aReader->FatalError("Error deserializing 'title' (nsString) member of 'SetTitle'");
return {};
}
auto& _title = *maybe___title;
// Sentinel = 'title'
if ((!((aReader)->ReadSentinel(109445667)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'title' (nsString) member of 'SetTitle'");
return {};
}
IPC::ReadResult<paramType> result__{
std::in_place,
std::move(_title)};
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct SetOkButtonLabel|
//
namespace mozilla {
namespace widget {
namespace filedialog {
} // namespace filedialog
} // namespace widget
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::widget::filedialog::SetOkButtonLabel>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, (aVar).label());
// Sentinel = 'label'
(aWriter)->WriteSentinel(100729345);
}
auto ParamTraits<::mozilla::widget::filedialog::SetOkButtonLabel>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe___label = IPC::ReadParam<::nsString>(aReader);
if (!maybe___label) {
aReader->FatalError("Error deserializing 'label' (nsString) member of 'SetOkButtonLabel'");
return {};
}
auto& _label = *maybe___label;
// Sentinel = 'label'
if ((!((aReader)->ReadSentinel(100729345)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'label' (nsString) member of 'SetOkButtonLabel'");
return {};
}
IPC::ReadResult<paramType> result__{
std::in_place,
std::move(_label)};
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct SetFolder|
//
namespace mozilla {
namespace widget {
namespace filedialog {
} // namespace filedialog
} // namespace widget
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::widget::filedialog::SetFolder>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, (aVar).path());
// Sentinel = 'path'
(aWriter)->WriteSentinel(70713774);
}
auto ParamTraits<::mozilla::widget::filedialog::SetFolder>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe___path = IPC::ReadParam<::nsString>(aReader);
if (!maybe___path) {
aReader->FatalError("Error deserializing 'path' (nsString) member of 'SetFolder'");
return {};
}
auto& _path = *maybe___path;
// Sentinel = 'path'
if ((!((aReader)->ReadSentinel(70713774)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'path' (nsString) member of 'SetFolder'");
return {};
}
IPC::ReadResult<paramType> result__{
std::in_place,
std::move(_path)};
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct SetFileName|
//
namespace mozilla {
namespace widget {
namespace filedialog {
} // namespace filedialog
} // namespace widget
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::widget::filedialog::SetFileName>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, (aVar).filename());
// Sentinel = 'filename'
(aWriter)->WriteSentinel(246547266);
}
auto ParamTraits<::mozilla::widget::filedialog::SetFileName>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe___filename = IPC::ReadParam<::nsString>(aReader);
if (!maybe___filename) {
aReader->FatalError("Error deserializing 'filename' (nsString) member of 'SetFileName'");
return {};
}
auto& _filename = *maybe___filename;
// Sentinel = 'filename'
if ((!((aReader)->ReadSentinel(246547266)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'filename' (nsString) member of 'SetFileName'");
return {};
}
IPC::ReadResult<paramType> result__{
std::in_place,
std::move(_filename)};
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct SetDefaultExtension|
//
namespace mozilla {
namespace widget {
namespace filedialog {
} // namespace filedialog
} // namespace widget
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::widget::filedialog::SetDefaultExtension>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, (aVar).extension());
// Sentinel = 'extension'
(aWriter)->WriteSentinel(324600798);
}
auto ParamTraits<::mozilla::widget::filedialog::SetDefaultExtension>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe___extension = IPC::ReadParam<::nsString>(aReader);
if (!maybe___extension) {
aReader->FatalError("Error deserializing 'extension' (nsString) member of 'SetDefaultExtension'");
return {};
}
auto& _extension = *maybe___extension;
// Sentinel = 'extension'
if ((!((aReader)->ReadSentinel(324600798)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'extension' (nsString) member of 'SetDefaultExtension'");
return {};
}
IPC::ReadResult<paramType> result__{
std::in_place,
std::move(_extension)};
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct ComDlgFilterSpec|
//
namespace mozilla {
namespace widget {
namespace filedialog {
} // namespace filedialog
} // namespace widget
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::widget::filedialog::ComDlgFilterSpec>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, (aVar).name());
// Sentinel = 'name'
(aWriter)->WriteSentinel(69075362);
IPC::WriteParam(aWriter, (aVar).spec());
// Sentinel = 'spec'
(aWriter)->WriteSentinel(72155564);
}
auto ParamTraits<::mozilla::widget::filedialog::ComDlgFilterSpec>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe___name = IPC::ReadParam<::nsString>(aReader);
if (!maybe___name) {
aReader->FatalError("Error deserializing 'name' (nsString) member of 'ComDlgFilterSpec'");
return {};
}
auto& _name = *maybe___name;
// Sentinel = 'name'
if ((!((aReader)->ReadSentinel(69075362)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'name' (nsString) member of 'ComDlgFilterSpec'");
return {};
}
auto maybe___spec = IPC::ReadParam<::nsString>(aReader);
if (!maybe___spec) {
aReader->FatalError("Error deserializing 'spec' (nsString) member of 'ComDlgFilterSpec'");
return {};
}
auto& _spec = *maybe___spec;
// Sentinel = 'spec'
if ((!((aReader)->ReadSentinel(72155564)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'spec' (nsString) member of 'ComDlgFilterSpec'");
return {};
}
IPC::ReadResult<paramType> result__{
std::in_place,
std::move(_name),
std::move(_spec)};
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct SetFileTypes|
//
namespace mozilla {
namespace widget {
namespace filedialog {
} // namespace filedialog
} // namespace widget
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::widget::filedialog::SetFileTypes>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, (aVar).filterList());
// Sentinel = 'filterList'
(aWriter)->WriteSentinel(379585571);
}
auto ParamTraits<::mozilla::widget::filedialog::SetFileTypes>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe___filterList = IPC::ReadParam<nsTArray<::mozilla::widget::filedialog::ComDlgFilterSpec>>(aReader);
if (!maybe___filterList) {
aReader->FatalError("Error deserializing 'filterList' (ComDlgFilterSpec[]) member of 'SetFileTypes'");
return {};
}
auto& _filterList = *maybe___filterList;
// Sentinel = 'filterList'
if ((!((aReader)->ReadSentinel(379585571)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'filterList' (ComDlgFilterSpec[]) member of 'SetFileTypes'");
return {};
}
IPC::ReadResult<paramType> result__{
std::in_place,
std::move(_filterList)};
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct SetFileTypeIndex|
//
namespace mozilla {
namespace widget {
namespace filedialog {
} // namespace filedialog
} // namespace widget
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::widget::filedialog::SetFileTypeIndex>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
(aWriter)->WriteBytes((&((aVar).index())), 4);
// Sentinel = 'index'
(aWriter)->WriteSentinel(104333849);
}
auto ParamTraits<::mozilla::widget::filedialog::SetFileTypeIndex>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
IPC::ReadResult<paramType> result__{
std::in_place,
::uint32_t{0}};
if ((!((aReader)->ReadBytesInto((&((result__)->index())), 4)))) {
aReader->FatalError("Error bulk reading fields from uint32_t");
return {};
}
// Sentinel = 'index'
if ((!((aReader)->ReadSentinel(104333849)))) {
mozilla::ipc::SentinelReadError("Error bulk reading fields from uint32_t");
return {};
}
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |union Command|
//
namespace mozilla {
namespace widget {
namespace filedialog {
auto Command::MaybeDestroy() -> void
{
if ((mType) == (T__None)) {
return;
}
switch (mType) {
case TSetOptions:
{
(ptr_SetOptions())->~SetOptions__tdef();
break;
}
case TSetTitle:
{
(ptr_SetTitle())->~SetTitle__tdef();
break;
}
case TSetOkButtonLabel:
{
(ptr_SetOkButtonLabel())->~SetOkButtonLabel__tdef();
break;
}
case TSetFolder:
{
(ptr_SetFolder())->~SetFolder__tdef();
break;
}
case TSetFileName:
{
(ptr_SetFileName())->~SetFileName__tdef();
break;
}
case TSetDefaultExtension:
{
(ptr_SetDefaultExtension())->~SetDefaultExtension__tdef();
break;
}
case TSetFileTypes:
{
(ptr_SetFileTypes())->~SetFileTypes__tdef();
break;
}
case TSetFileTypeIndex:
{
(ptr_SetFileTypeIndex())->~SetFileTypeIndex__tdef();
break;
}
default:
{
mozilla::ipc::LogicError("not reached");
break;
}
}
}
MOZ_IMPLICIT Command::Command(const SetOptions& aOther)
{
new (mozilla::KnownNotNull, ptr_SetOptions()) SetOptions(aOther);
mType = TSetOptions;
}
MOZ_IMPLICIT Command::Command(SetOptions&& aOther)
{
new (mozilla::KnownNotNull, ptr_SetOptions()) SetOptions(std::move(aOther));
mType = TSetOptions;
}
MOZ_IMPLICIT Command::Command(const SetTitle& aOther)
{
new (mozilla::KnownNotNull, ptr_SetTitle()) SetTitle(aOther);
mType = TSetTitle;
}
MOZ_IMPLICIT Command::Command(SetTitle&& aOther)
{
new (mozilla::KnownNotNull, ptr_SetTitle()) SetTitle(std::move(aOther));
mType = TSetTitle;
}
MOZ_IMPLICIT Command::Command(const SetOkButtonLabel& aOther)
{
new (mozilla::KnownNotNull, ptr_SetOkButtonLabel()) SetOkButtonLabel(aOther);
mType = TSetOkButtonLabel;
}
MOZ_IMPLICIT Command::Command(SetOkButtonLabel&& aOther)
{
new (mozilla::KnownNotNull, ptr_SetOkButtonLabel()) SetOkButtonLabel(std::move(aOther));
mType = TSetOkButtonLabel;
}
MOZ_IMPLICIT Command::Command(const SetFolder& aOther)
{
new (mozilla::KnownNotNull, ptr_SetFolder()) SetFolder(aOther);
mType = TSetFolder;
}
MOZ_IMPLICIT Command::Command(SetFolder&& aOther)
{
new (mozilla::KnownNotNull, ptr_SetFolder()) SetFolder(std::move(aOther));
mType = TSetFolder;
}
MOZ_IMPLICIT Command::Command(const SetFileName& aOther)
{
new (mozilla::KnownNotNull, ptr_SetFileName()) SetFileName(aOther);
mType = TSetFileName;
}
MOZ_IMPLICIT Command::Command(SetFileName&& aOther)
{
new (mozilla::KnownNotNull, ptr_SetFileName()) SetFileName(std::move(aOther));
mType = TSetFileName;
}
MOZ_IMPLICIT Command::Command(const SetDefaultExtension& aOther)
{
new (mozilla::KnownNotNull, ptr_SetDefaultExtension()) SetDefaultExtension(aOther);
mType = TSetDefaultExtension;
}
MOZ_IMPLICIT Command::Command(SetDefaultExtension&& aOther)
{
new (mozilla::KnownNotNull, ptr_SetDefaultExtension()) SetDefaultExtension(std::move(aOther));
mType = TSetDefaultExtension;
}
MOZ_IMPLICIT Command::Command(const SetFileTypes& aOther)
{
new (mozilla::KnownNotNull, ptr_SetFileTypes()) SetFileTypes(aOther);
mType = TSetFileTypes;
}
MOZ_IMPLICIT Command::Command(SetFileTypes&& aOther)
{
new (mozilla::KnownNotNull, ptr_SetFileTypes()) SetFileTypes(std::move(aOther));
mType = TSetFileTypes;
}
MOZ_IMPLICIT Command::Command(const SetFileTypeIndex& aOther)
{
new (mozilla::KnownNotNull, ptr_SetFileTypeIndex()) SetFileTypeIndex(aOther);
mType = TSetFileTypeIndex;
}
MOZ_IMPLICIT Command::Command(SetFileTypeIndex&& aOther)
{
new (mozilla::KnownNotNull, ptr_SetFileTypeIndex()) SetFileTypeIndex(std::move(aOther));
mType = TSetFileTypeIndex;
}
MOZ_IMPLICIT Command::Command(const Command& aOther)
{
(aOther).AssertSanity();
switch ((aOther).type()) {
case TSetOptions:
{
new (mozilla::KnownNotNull, ptr_SetOptions()) SetOptions((aOther).get_SetOptions());
break;
}
case TSetTitle:
{
new (mozilla::KnownNotNull, ptr_SetTitle()) SetTitle((aOther).get_SetTitle());
break;
}
case TSetOkButtonLabel:
{
new (mozilla::KnownNotNull, ptr_SetOkButtonLabel()) SetOkButtonLabel((aOther).get_SetOkButtonLabel());
break;
}
case TSetFolder:
{
new (mozilla::KnownNotNull, ptr_SetFolder()) SetFolder((aOther).get_SetFolder());
break;
}
case TSetFileName:
{
new (mozilla::KnownNotNull, ptr_SetFileName()) SetFileName((aOther).get_SetFileName());
break;
}
case TSetDefaultExtension:
{
new (mozilla::KnownNotNull, ptr_SetDefaultExtension()) SetDefaultExtension((aOther).get_SetDefaultExtension());
break;
}
case TSetFileTypes:
{
new (mozilla::KnownNotNull, ptr_SetFileTypes()) SetFileTypes((aOther).get_SetFileTypes());
break;
}
case TSetFileTypeIndex:
{
new (mozilla::KnownNotNull, ptr_SetFileTypeIndex()) SetFileTypeIndex((aOther).get_SetFileTypeIndex());
break;
}
case T__None:
{
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
return;
}
}
mType = (aOther).type();
}
MOZ_IMPLICIT Command::Command(Command&& aOther)
{
(aOther).AssertSanity();
Type t = (aOther).type();
switch (t) {
case TSetOptions:
{
new (mozilla::KnownNotNull, ptr_SetOptions()) SetOptions(std::move((aOther).get_SetOptions()));
(aOther).MaybeDestroy();
break;
}
case TSetTitle:
{
new (mozilla::KnownNotNull, ptr_SetTitle()) SetTitle(std::move((aOther).get_SetTitle()));
(aOther).MaybeDestroy();
break;
}
case TSetOkButtonLabel:
{
new (mozilla::KnownNotNull, ptr_SetOkButtonLabel()) SetOkButtonLabel(std::move((aOther).get_SetOkButtonLabel()));
(aOther).MaybeDestroy();
break;
}
case TSetFolder:
{
new (mozilla::KnownNotNull, ptr_SetFolder()) SetFolder(std::move((aOther).get_SetFolder()));
(aOther).MaybeDestroy();
break;
}
case TSetFileName:
{
new (mozilla::KnownNotNull, ptr_SetFileName()) SetFileName(std::move((aOther).get_SetFileName()));
(aOther).MaybeDestroy();
break;
}
case TSetDefaultExtension:
{
new (mozilla::KnownNotNull, ptr_SetDefaultExtension()) SetDefaultExtension(std::move((aOther).get_SetDefaultExtension()));
(aOther).MaybeDestroy();
break;
}
case TSetFileTypes:
{
new (mozilla::KnownNotNull, ptr_SetFileTypes()) SetFileTypes(std::move((aOther).get_SetFileTypes()));
(aOther).MaybeDestroy();
break;
}
case TSetFileTypeIndex:
{
new (mozilla::KnownNotNull, ptr_SetFileTypeIndex()) SetFileTypeIndex(std::move((aOther).get_SetFileTypeIndex()));
(aOther).MaybeDestroy();
break;
}
case T__None:
{
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
return;
}
}
(aOther).mType = T__None;
mType = t;
}
Command::~Command()
{
MaybeDestroy();
}
auto Command::operator=(const SetOptions& aRhs) -> Command&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetOptions()) SetOptions(aRhs);
mType = TSetOptions;
return (*(this));
}
auto Command::operator=(SetOptions&& aRhs) -> Command&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetOptions()) SetOptions(std::move(aRhs));
mType = TSetOptions;
return (*(this));
}
auto Command::operator=(const SetTitle& aRhs) -> Command&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetTitle()) SetTitle(aRhs);
mType = TSetTitle;
return (*(this));
}
auto Command::operator=(SetTitle&& aRhs) -> Command&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetTitle()) SetTitle(std::move(aRhs));
mType = TSetTitle;
return (*(this));
}
auto Command::operator=(const SetOkButtonLabel& aRhs) -> Command&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetOkButtonLabel()) SetOkButtonLabel(aRhs);
mType = TSetOkButtonLabel;
return (*(this));
}
auto Command::operator=(SetOkButtonLabel&& aRhs) -> Command&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetOkButtonLabel()) SetOkButtonLabel(std::move(aRhs));
mType = TSetOkButtonLabel;
return (*(this));
}
auto Command::operator=(const SetFolder& aRhs) -> Command&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetFolder()) SetFolder(aRhs);
mType = TSetFolder;
return (*(this));
}
auto Command::operator=(SetFolder&& aRhs) -> Command&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetFolder()) SetFolder(std::move(aRhs));
mType = TSetFolder;
return (*(this));
}
auto Command::operator=(const SetFileName& aRhs) -> Command&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetFileName()) SetFileName(aRhs);
mType = TSetFileName;
return (*(this));
}
auto Command::operator=(SetFileName&& aRhs) -> Command&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetFileName()) SetFileName(std::move(aRhs));
mType = TSetFileName;
return (*(this));
}
auto Command::operator=(const SetDefaultExtension& aRhs) -> Command&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetDefaultExtension()) SetDefaultExtension(aRhs);
mType = TSetDefaultExtension;
return (*(this));
}
auto Command::operator=(SetDefaultExtension&& aRhs) -> Command&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetDefaultExtension()) SetDefaultExtension(std::move(aRhs));
mType = TSetDefaultExtension;
return (*(this));
}
auto Command::operator=(const SetFileTypes& aRhs) -> Command&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetFileTypes()) SetFileTypes(aRhs);
mType = TSetFileTypes;
return (*(this));
}
auto Command::operator=(SetFileTypes&& aRhs) -> Command&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetFileTypes()) SetFileTypes(std::move(aRhs));
mType = TSetFileTypes;
return (*(this));
}
auto Command::operator=(const SetFileTypeIndex& aRhs) -> Command&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetFileTypeIndex()) SetFileTypeIndex(aRhs);
mType = TSetFileTypeIndex;
return (*(this));
}
auto Command::operator=(SetFileTypeIndex&& aRhs) -> Command&
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetFileTypeIndex()) SetFileTypeIndex(std::move(aRhs));
mType = TSetFileTypeIndex;
return (*(this));
}
auto Command::operator=(const Command& aRhs) -> Command&
{
(aRhs).AssertSanity();
Type t = (aRhs).type();
switch (t) {
case TSetOptions:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetOptions()) SetOptions((aRhs).get_SetOptions());
break;
}
case TSetTitle:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetTitle()) SetTitle((aRhs).get_SetTitle());
break;
}
case TSetOkButtonLabel:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetOkButtonLabel()) SetOkButtonLabel((aRhs).get_SetOkButtonLabel());
break;
}
case TSetFolder:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetFolder()) SetFolder((aRhs).get_SetFolder());
break;
}
case TSetFileName:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetFileName()) SetFileName((aRhs).get_SetFileName());
break;
}
case TSetDefaultExtension:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetDefaultExtension()) SetDefaultExtension((aRhs).get_SetDefaultExtension());
break;
}
case TSetFileTypes:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetFileTypes()) SetFileTypes((aRhs).get_SetFileTypes());
break;
}
case TSetFileTypeIndex:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetFileTypeIndex()) SetFileTypeIndex((aRhs).get_SetFileTypeIndex());
break;
}
case T__None:
{
MaybeDestroy();
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
break;
}
}
mType = t;
return (*(this));
}
auto Command::operator=(Command&& aRhs) -> Command&
{
(aRhs).AssertSanity();
Type t = (aRhs).type();
switch (t) {
case TSetOptions:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetOptions()) SetOptions(std::move((aRhs).get_SetOptions()));
(aRhs).MaybeDestroy();
break;
}
case TSetTitle:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetTitle()) SetTitle(std::move((aRhs).get_SetTitle()));
(aRhs).MaybeDestroy();
break;
}
case TSetOkButtonLabel:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetOkButtonLabel()) SetOkButtonLabel(std::move((aRhs).get_SetOkButtonLabel()));
(aRhs).MaybeDestroy();
break;
}
case TSetFolder:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetFolder()) SetFolder(std::move((aRhs).get_SetFolder()));
(aRhs).MaybeDestroy();
break;
}
case TSetFileName:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetFileName()) SetFileName(std::move((aRhs).get_SetFileName()));
(aRhs).MaybeDestroy();
break;
}
case TSetDefaultExtension:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetDefaultExtension()) SetDefaultExtension(std::move((aRhs).get_SetDefaultExtension()));
(aRhs).MaybeDestroy();
break;
}
case TSetFileTypes:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetFileTypes()) SetFileTypes(std::move((aRhs).get_SetFileTypes()));
(aRhs).MaybeDestroy();
break;
}
case TSetFileTypeIndex:
{
MaybeDestroy();
new (mozilla::KnownNotNull, ptr_SetFileTypeIndex()) SetFileTypeIndex(std::move((aRhs).get_SetFileTypeIndex()));
(aRhs).MaybeDestroy();
break;
}
case T__None:
{
MaybeDestroy();
break;
}
default:
{
mozilla::ipc::LogicError("unreached");
break;
}
}
(aRhs).mType = T__None;
mType = t;
return (*(this));
}
} // namespace filedialog
} // namespace widget
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::widget::filedialog::Command>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
typedef ::mozilla::widget::filedialog::Command union__;
int type = (aVar).type();
IPC::WriteParam(aWriter, type);
// Sentinel = 'Command'
(aWriter)->WriteSentinel(179176128);
switch (type) {
case union__::TSetOptions:
{
IPC::WriteParam(aWriter, (aVar).get_SetOptions());
// Sentinel = 'TSetOptions'
(aWriter)->WriteSentinel(425657453);
return;
}
case union__::TSetTitle:
{
IPC::WriteParam(aWriter, (aVar).get_SetTitle());
// Sentinel = 'TSetTitle'
(aWriter)->WriteSentinel(284230531);
return;
}
case union__::TSetOkButtonLabel:
{
IPC::WriteParam(aWriter, (aVar).get_SetOkButtonLabel());
// Sentinel = 'TSetOkButtonLabel'
(aWriter)->WriteSentinel(976488087);
return;
}
case union__::TSetFolder:
{
IPC::WriteParam(aWriter, (aVar).get_SetFolder());
// Sentinel = 'TSetFolder'
(aWriter)->WriteSentinel(343409629);
return;
}
case union__::TSetFileName:
{
IPC::WriteParam(aWriter, (aVar).get_SetFileName());
// Sentinel = 'TSetFileName'
(aWriter)->WriteSentinel(482149506);
return;
}
case union__::TSetDefaultExtension:
{
IPC::WriteParam(aWriter, (aVar).get_SetDefaultExtension());
// Sentinel = 'TSetDefaultExtension'
(aWriter)->WriteSentinel(1360988163);
return;
}
case union__::TSetFileTypes:
{
IPC::WriteParam(aWriter, (aVar).get_SetFileTypes());
// Sentinel = 'TSetFileTypes'
(aWriter)->WriteSentinel(574162198);
return;
}
case union__::TSetFileTypeIndex:
{
IPC::WriteParam(aWriter, (aVar).get_SetFileTypeIndex());
// Sentinel = 'TSetFileTypeIndex'
(aWriter)->WriteSentinel(971310747);
return;
}
default:
{
aWriter->FatalError("unknown variant of union Command");
return;
}
}
}
auto ParamTraits<::mozilla::widget::filedialog::Command>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
typedef ::mozilla::widget::filedialog::Command union__;
auto maybe__type = IPC::ReadParam<int>(aReader);
if (!maybe__type) {
aReader->FatalError("Error deserializing type of union Command");
return {};
}
auto& type = *maybe__type;
// Sentinel = 'Command'
if ((!((aReader)->ReadSentinel(179176128)))) {
mozilla::ipc::SentinelReadError("Error deserializing type of union Command");
return {};
}
switch (type) {
case union__::TSetOptions:
{
auto maybe__tmp = IPC::ReadParam<::mozilla::widget::filedialog::SetOptions>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TSetOptions of union Command");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TSetOptions'
if ((!((aReader)->ReadSentinel(425657453)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TSetOptions of union Command");
return {};
}
return std::move(tmp);
}
case union__::TSetTitle:
{
auto maybe__tmp = IPC::ReadParam<::mozilla::widget::filedialog::SetTitle>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TSetTitle of union Command");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TSetTitle'
if ((!((aReader)->ReadSentinel(284230531)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TSetTitle of union Command");
return {};
}
return std::move(tmp);
}
case union__::TSetOkButtonLabel:
{
auto maybe__tmp = IPC::ReadParam<::mozilla::widget::filedialog::SetOkButtonLabel>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TSetOkButtonLabel of union Command");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TSetOkButtonLabel'
if ((!((aReader)->ReadSentinel(976488087)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TSetOkButtonLabel of union Command");
return {};
}
return std::move(tmp);
}
case union__::TSetFolder:
{
auto maybe__tmp = IPC::ReadParam<::mozilla::widget::filedialog::SetFolder>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TSetFolder of union Command");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TSetFolder'
if ((!((aReader)->ReadSentinel(343409629)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TSetFolder of union Command");
return {};
}
return std::move(tmp);
}
case union__::TSetFileName:
{
auto maybe__tmp = IPC::ReadParam<::mozilla::widget::filedialog::SetFileName>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TSetFileName of union Command");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TSetFileName'
if ((!((aReader)->ReadSentinel(482149506)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TSetFileName of union Command");
return {};
}
return std::move(tmp);
}
case union__::TSetDefaultExtension:
{
auto maybe__tmp = IPC::ReadParam<::mozilla::widget::filedialog::SetDefaultExtension>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TSetDefaultExtension of union Command");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TSetDefaultExtension'
if ((!((aReader)->ReadSentinel(1360988163)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TSetDefaultExtension of union Command");
return {};
}
return std::move(tmp);
}
case union__::TSetFileTypes:
{
auto maybe__tmp = IPC::ReadParam<::mozilla::widget::filedialog::SetFileTypes>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TSetFileTypes of union Command");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TSetFileTypes'
if ((!((aReader)->ReadSentinel(574162198)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TSetFileTypes of union Command");
return {};
}
return std::move(tmp);
}
case union__::TSetFileTypeIndex:
{
auto maybe__tmp = IPC::ReadParam<::mozilla::widget::filedialog::SetFileTypeIndex>(aReader);
if (!maybe__tmp) {
aReader->FatalError("Error deserializing variant TSetFileTypeIndex of union Command");
return {};
}
auto& tmp = *maybe__tmp;
// Sentinel = 'TSetFileTypeIndex'
if ((!((aReader)->ReadSentinel(971310747)))) {
mozilla::ipc::SentinelReadError("Error deserializing variant TSetFileTypeIndex of union Command");
return {};
}
return std::move(tmp);
}
default:
{
aReader->FatalError("unknown variant of union Command");
return {};
}
}
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct Results|
//
namespace mozilla {
namespace widget {
namespace filedialog {
} // namespace filedialog
} // namespace widget
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::widget::filedialog::Results>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, (aVar).paths());
// Sentinel = 'paths'
(aWriter)->WriteSentinel(106431009);
(aWriter)->WriteBytes((&((aVar).selectedFileTypeIndex())), 4);
// Sentinel = 'selectedFileTypeIndex'
(aWriter)->WriteSentinel(1552484452);
}
auto ParamTraits<::mozilla::widget::filedialog::Results>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe___paths = IPC::ReadParam<nsTArray<::nsString>>(aReader);
if (!maybe___paths) {
aReader->FatalError("Error deserializing 'paths' (nsString[]) member of 'Results'");
return {};
}
auto& _paths = *maybe___paths;
// Sentinel = 'paths'
if ((!((aReader)->ReadSentinel(106431009)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'paths' (nsString[]) member of 'Results'");
return {};
}
IPC::ReadResult<paramType> result__{
std::in_place,
std::move(_paths),
::uint32_t{0}};
if ((!((aReader)->ReadBytesInto((&((result__)->selectedFileTypeIndex())), 4)))) {
aReader->FatalError("Error bulk reading fields from uint32_t");
return {};
}
// Sentinel = 'selectedFileTypeIndex'
if ((!((aReader)->ReadSentinel(1552484452)))) {
mozilla::ipc::SentinelReadError("Error bulk reading fields from uint32_t");
return {};
}
return result__;
}
} // namespace IPC
//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct RemoteError|
//
namespace mozilla {
namespace widget {
namespace filedialog {
auto RemoteError::StaticAssertions() const -> void
{
static_assert(
(offsetof(RemoteError, why_) - offsetof(RemoteError, where_)) == 4,
"Bad assumptions about field layout!");
}
} // namespace filedialog
} // namespace widget
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::widget::filedialog::RemoteError>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
(aWriter)->WriteBytes((&((aVar).where())), 8);
// Sentinel = 'where | why'
(aWriter)->WriteSentinel(426902576);
}
auto ParamTraits<::mozilla::widget::filedialog::RemoteError>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
IPC::ReadResult<paramType> result__{
std::in_place,
::uint32_t{0},
::uint32_t{0}};
if ((!((aReader)->ReadBytesInto((&((result__)->where())), 8)))) {
aReader->FatalError("Error bulk reading fields from uint32_t");
return {};
}
// Sentinel = 'where | why'
if ((!((aReader)->ReadSentinel(426902576)))) {
mozilla::ipc::SentinelReadError("Error bulk reading fields from uint32_t");
return {};
}
return result__;
}
} // namespace IPC