Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/PRemoteSpellcheckEngineParent.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/RemoteSpellCheckEngineChild.h"
#include "mozilla/RemoteSpellCheckEngineParent.h"
#include "mozilla/dom/PContentParent.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 {
auto PRemoteSpellcheckEngineParent::Recv__delete__() -> mozilla::ipc::IPCResult
{
return IPC_OK();
}
MOZ_IMPLICIT PRemoteSpellcheckEngineParent::PRemoteSpellcheckEngineParent() :
mozilla::ipc::IProtocol(PRemoteSpellcheckEngineMsgStart, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PRemoteSpellcheckEngineParent);
}
PRemoteSpellcheckEngineParent::~PRemoteSpellcheckEngineParent()
{
MOZ_COUNT_DTOR(PRemoteSpellcheckEngineParent);
}
auto PRemoteSpellcheckEngineParent::ActorAlloc() -> void
{
}
auto PRemoteSpellcheckEngineParent::ActorDealloc() -> void
{
if (Manager()) {
Manager()->DeallocManagee(PRemoteSpellcheckEngineMsgStart, this);
}
}
auto PRemoteSpellcheckEngineParent::OtherPid() const -> ::base::ProcessId
{
::base::ProcessId pid =
::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid();
MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId);
return pid;
}
auto PRemoteSpellcheckEngineParent::Manager() const -> PContentParent*
{
return static_cast<PContentParent*>(IProtocol::Manager());
}
auto PRemoteSpellcheckEngineParent::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PRemoteSpellcheckEngineParent::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PRemoteSpellcheckEngineParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PRemoteSpellcheckEngineParent::OnMessageReceived(const Message& msg__) -> PRemoteSpellcheckEngineParent::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 PRemoteSpellcheckEngine::Msg___delete____ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteSpellcheckEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg___delete__", OTHER);
mozilla::ipc::IPCResult __ok = (static_cast<RemoteSpellcheckEngineParent*>(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 PRemoteSpellcheckEngine::Msg_CheckAsync__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteSpellcheckEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_CheckAsync", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aWord = IPC::ReadParam<nsTArray<nsString>>((&(reader__)));
if (!maybe__aWord) {
FatalError("Error deserializing 'nsString[]'");
return MsgValueError;
}
auto& aWord = *maybe__aWord;
// Sentinel = 'aWord'
if ((!(((&(reader__)))->ReadSentinel(98238974)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsString[]'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = Id();
UniquePtr<IPC::Message> reply__(PRemoteSpellcheckEngine::Reply_CheckAsync(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
CheckAsyncResolver resolver = [resolver__ = std::move(resolver__)](mozilla::Span<bool const> aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'aIsMisspelled'
((&(writer__)))->WriteSentinel(595723568);
if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteSpellcheckEngineParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (static_cast<RemoteSpellcheckEngineParent*>(this))->RecvCheckAsync(std::move(aWord), std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PRemoteSpellcheckEngine::Msg_SetDictionaries__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteSpellcheckEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_SetDictionaries", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aDictionaries = IPC::ReadParam<nsTArray<nsCString>>((&(reader__)));
if (!maybe__aDictionaries) {
FatalError("Error deserializing 'nsCString[]'");
return MsgValueError;
}
auto& aDictionaries = *maybe__aDictionaries;
// Sentinel = 'aDictionaries'
if ((!(((&(reader__)))->ReadSentinel(598279488)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString[]'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = Id();
UniquePtr<IPC::Message> reply__(PRemoteSpellcheckEngine::Reply_SetDictionaries(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
SetDictionariesResolver resolver = [resolver__ = std::move(resolver__)](const bool& aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'success'
((&(writer__)))->WriteSentinel(200082170);
if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteSpellcheckEngineParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (static_cast<RemoteSpellcheckEngineParent*>(this))->RecvSetDictionaries(std::move(aDictionaries), std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PRemoteSpellcheckEngine::Msg_Suggest__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteSpellcheckEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_Suggest", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aWord = IPC::ReadParam<nsString>((&(reader__)));
if (!maybe__aWord) {
FatalError("Error deserializing 'nsString'");
return MsgValueError;
}
auto& aWord = *maybe__aWord;
// Sentinel = 'aWord'
if ((!(((&(reader__)))->ReadSentinel(98238974)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
return MsgValueError;
}
auto maybe__aCount = IPC::ReadParam<uint32_t>((&(reader__)));
if (!maybe__aCount) {
FatalError("Error deserializing 'uint32_t'");
return MsgValueError;
}
auto& aCount = *maybe__aCount;
// Sentinel = 'aCount'
if ((!(((&(reader__)))->ReadSentinel(134611563)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = Id();
UniquePtr<IPC::Message> reply__(PRemoteSpellcheckEngine::Reply_Suggest(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
SuggestResolver resolver = [resolver__ = std::move(resolver__)](mozilla::Span<nsString const> aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'aSuggestions'
((&(writer__)))->WriteSentinel(529204477);
if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteSpellcheckEngineParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (static_cast<RemoteSpellcheckEngineParent*>(this))->RecvSuggest(std::move(aWord), std::move(aCount), std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PRemoteSpellcheckEngine::Msg_SetDictionaryFromList__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteSpellcheckEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_SetDictionaryFromList", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aList = IPC::ReadParam<nsTArray<nsCString>>((&(reader__)));
if (!maybe__aList) {
FatalError("Error deserializing 'nsCString[]'");
return MsgValueError;
}
auto& aList = *maybe__aList;
// Sentinel = 'aList'
if ((!(((&(reader__)))->ReadSentinel(95355390)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString[]'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = Id();
UniquePtr<IPC::Message> reply__(PRemoteSpellcheckEngine::Reply_SetDictionaryFromList(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
SetDictionaryFromListResolver resolver = [resolver__ = std::move(resolver__)](std::tuple<const bool&, const nsACString&> aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), std::get<0>(aParam));
// Sentinel = 'aSuccess'
((&(writer__)))->WriteSentinel(236323643);
IPC::WriteParam((&(writer__)), std::get<1>(aParam));
// Sentinel = 'aDictionary'
((&(writer__)))->WriteSentinel(430703736);
if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteSpellcheckEngineParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (static_cast<RemoteSpellcheckEngineParent*>(this))->RecvSetDictionaryFromList(std::move(aList), std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PRemoteSpellcheckEngineParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PRemoteSpellcheckEngineParent::Result
{
switch (msg__.type()) {
case PRemoteSpellcheckEngine::Msg_SetDictionary__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteSpellcheckEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_SetDictionary", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aDictionary = IPC::ReadParam<nsCString>((&(reader__)));
if (!maybe__aDictionary) {
FatalError("Error deserializing 'nsCString'");
return MsgValueError;
}
auto& aDictionary = *maybe__aDictionary;
// Sentinel = 'aDictionary'
if ((!(((&(reader__)))->ReadSentinel(430703736)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = Id();
bool success{};
mozilla::ipc::IPCResult __ok = (static_cast<RemoteSpellcheckEngineParent*>(this))->RecvSetDictionary(std::move(aDictionary), (&(success)));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
reply__ = PRemoteSpellcheckEngine::Reply_SetDictionary(id__);
IPC::MessageWriter writer__{
(*(reply__)),
this};
IPC::WriteParam((&(writer__)), success);
// Sentinel = 'success'
((&(writer__)))->WriteSentinel(200082170);
if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PRemoteSpellcheckEngineParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PRemoteSpellcheckEngineParent::DoomSubtree() -> void
{
SetDoomed();
}
auto PRemoteSpellcheckEngineParent::PeekManagedActor() -> IProtocol*
{
return nullptr;
}
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::PRemoteSpellcheckEngineParent*>::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::PRemoteSpellcheckEngineParent*>::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, "PRemoteSpellcheckEngine", PRemoteSpellcheckEngineMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::PRemoteSpellcheckEngineParent*>(actor.ref());
}
return {};
}
} // namespace IPC