// // Automatically generated by ipdlc. // Edit at your own risk // #include "mozilla/PRemoteSpellcheckEngineChild.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/ProfilerMarkers.h" #include "mozilla/RemoteSpellCheckEngineChild.h" #include "mozilla/RemoteSpellCheckEngineParent.h" #include "mozilla/dom/PContentChild.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 { MOZ_IMPLICIT PRemoteSpellcheckEngineChild::PRemoteSpellcheckEngineChild() : mozilla::ipc::IProtocol(kProtocolId, mozilla::ipc::ChildSide) { MOZ_COUNT_CTOR(PRemoteSpellcheckEngineChild); } PRemoteSpellcheckEngineChild::~PRemoteSpellcheckEngineChild() { MOZ_COUNT_DTOR(PRemoteSpellcheckEngineChild); } auto PRemoteSpellcheckEngineChild::ActorAlloc() -> void { } auto PRemoteSpellcheckEngineChild::ActorDealloc() -> void { if (Manager()) { Manager()->DeallocManagee(kProtocolId, this); } } auto PRemoteSpellcheckEngineChild::OtherPid() const -> ::base::ProcessId { ::base::ProcessId pid = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid(); MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId); return pid; } auto PRemoteSpellcheckEngineChild::OtherChildID() const -> ::GeckoChildID { ::GeckoChildID childID = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid(); MOZ_RELEASE_ASSERT(childID != -1); return childID; } auto PRemoteSpellcheckEngineChild::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo { return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()}; } auto PRemoteSpellcheckEngineChild::Manager() const -> PContentChild* { return static_cast(IProtocol::Manager()); } auto PRemoteSpellcheckEngineChild::ManagedProtocolIds() const -> mozilla::Span { return {}; } auto PRemoteSpellcheckEngineChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer* { switch (aProtocol) { default: return nullptr; } } auto PRemoteSpellcheckEngineChild::RejectPendingResponses(ResponseRejectReason aReason) -> void { mAsyncCallbacks.RejectPendingResponses(aReason); } auto PRemoteSpellcheckEngineChild::Send__delete__(PRemoteSpellcheckEngineChild* actor) -> bool { if (!actor || !actor->CanSend()) { NS_WARNING("Attempt to __delete__ missing or closed actor"); return false; } UniquePtr msg__ = PRemoteSpellcheckEngine::Msg___delete__((actor)->Id()); IPC::MessageWriter writer__{ (*(msg__)), actor}; if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PRemoteSpellcheckEngineChild", actor->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg___delete__", OTHER); bool sendok__ = (actor)->ChannelSend(std::move(msg__)); actor->ActorDisconnected(Deletion); return sendok__; } auto PRemoteSpellcheckEngineChild::SendCheckAsync( mozilla::Span aWord, mozilla::ipc::ResolveCallback>&& aResolve, mozilla::ipc::RejectCallback&& aReject) -> void { UniquePtr msg__ = PRemoteSpellcheckEngine::Msg_CheckAsync(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), aWord); // Sentinel = 'aWord' ((&(writer__)))->WriteSentinel(98238974); if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PRemoteSpellcheckEngineChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_CheckAsync", OTHER); IPC::Message::seqno_t seqno__ = 0; if (ChannelSend(std::move(msg__), (&(seqno__)))) { mAsyncCallbacks.AddCallback(seqno__, PRemoteSpellcheckEngine::Reply_CheckAsync__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable { auto maybe__aIsMisspelled = IPC::ReadParam>(aReader); if (!maybe__aIsMisspelled) { (aReader)->FatalError("Error deserializing 'bool[]'"); return MsgValueError; } auto& aIsMisspelled = *maybe__aIsMisspelled; // Sentinel = 'aIsMisspelled' if ((!((aReader)->ReadSentinel(595723568)))) { mozilla::ipc::SentinelReadError("Error deserializing 'bool[]'"); return MsgValueError; } aReader->EndRead(); resolve(std::move(aIsMisspelled)); return MsgProcessed; }, std::move(aReject)); } else { aReject(::mozilla::ipc::ResponseRejectReason::SendError); } return; } auto PRemoteSpellcheckEngineChild::SendCheckAsync(mozilla::Span aWord) -> RefPtr { RefPtr, ResponseRejectReason, true>::Private> promise__ = new MozPromise, ResponseRejectReason, true>::Private(__func__); promise__->UseDirectTaskDispatch(__func__); SendCheckAsync(std::forward>(aWord), [promise__](nsTArray&& aValue) { promise__->Resolve(std::move(aValue), __func__); }, [promise__](ResponseRejectReason&& aReason) { promise__->Reject(std::move(aReason), __func__); }); return promise__; } auto PRemoteSpellcheckEngineChild::SendSetDictionary( const nsACString& aDictionary, bool* success) -> bool { UniquePtr msg__ = PRemoteSpellcheckEngine::Msg_SetDictionary(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), aDictionary); // Sentinel = 'aDictionary' ((&(writer__)))->WriteSentinel(430703736); UniquePtr reply__; if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PRemoteSpellcheckEngineChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_SetDictionary", OTHER); bool sendok__ = false; { AUTO_PROFILER_MARKER("PRemoteSpellcheckEngine::Msg_SetDictionary", IPC); sendok__ = ChannelSend(std::move(msg__), (&(reply__))); } if ((!(sendok__))) { return false; } if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PRemoteSpellcheckEngineChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received reply ", reply__->type(), mozilla::ipc::MessageDirection::eReceiving); } IPC::MessageReader reader__{ (*(reply__)), this}; auto maybe__success__reply = IPC::ReadParam((&(reader__))); if (!maybe__success__reply) { FatalError("Error deserializing 'bool'"); return false; } auto& success__reply = *maybe__success__reply; // Sentinel = 'success' if ((!(((&(reader__)))->ReadSentinel(200082170)))) { mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); return false; } (*(success)) = std::move(success__reply); reader__.EndRead(); return true; } auto PRemoteSpellcheckEngineChild::SendSetDictionaries( mozilla::Span aDictionaries, mozilla::ipc::ResolveCallback&& aResolve, mozilla::ipc::RejectCallback&& aReject) -> void { UniquePtr msg__ = PRemoteSpellcheckEngine::Msg_SetDictionaries(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), aDictionaries); // Sentinel = 'aDictionaries' ((&(writer__)))->WriteSentinel(598279488); if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PRemoteSpellcheckEngineChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_SetDictionaries", OTHER); IPC::Message::seqno_t seqno__ = 0; if (ChannelSend(std::move(msg__), (&(seqno__)))) { mAsyncCallbacks.AddCallback(seqno__, PRemoteSpellcheckEngine::Reply_SetDictionaries__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable { auto maybe__success = IPC::ReadParam(aReader); if (!maybe__success) { (aReader)->FatalError("Error deserializing 'bool'"); return MsgValueError; } auto& success = *maybe__success; // Sentinel = 'success' if ((!((aReader)->ReadSentinel(200082170)))) { mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); return MsgValueError; } aReader->EndRead(); resolve(std::move(success)); return MsgProcessed; }, std::move(aReject)); } else { aReject(::mozilla::ipc::ResponseRejectReason::SendError); } return; } auto PRemoteSpellcheckEngineChild::SendSetDictionaries(mozilla::Span aDictionaries) -> RefPtr { RefPtr::Private> promise__ = new MozPromise::Private(__func__); promise__->UseDirectTaskDispatch(__func__); SendSetDictionaries(std::forward>(aDictionaries), [promise__](bool&& aValue) { promise__->Resolve(std::move(aValue), __func__); }, [promise__](ResponseRejectReason&& aReason) { promise__->Reject(std::move(aReason), __func__); }); return promise__; } auto PRemoteSpellcheckEngineChild::SendSuggest( const nsAString& aWord, const uint32_t& aCount, mozilla::ipc::ResolveCallback>&& aResolve, mozilla::ipc::RejectCallback&& aReject) -> void { UniquePtr msg__ = PRemoteSpellcheckEngine::Msg_Suggest(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), aWord); // Sentinel = 'aWord' ((&(writer__)))->WriteSentinel(98238974); IPC::WriteParam((&(writer__)), aCount); // Sentinel = 'aCount' ((&(writer__)))->WriteSentinel(134611563); if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PRemoteSpellcheckEngineChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_Suggest", OTHER); IPC::Message::seqno_t seqno__ = 0; if (ChannelSend(std::move(msg__), (&(seqno__)))) { mAsyncCallbacks.AddCallback(seqno__, PRemoteSpellcheckEngine::Reply_Suggest__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable { auto maybe__aSuggestions = IPC::ReadParam>(aReader); if (!maybe__aSuggestions) { (aReader)->FatalError("Error deserializing 'nsString[]'"); return MsgValueError; } auto& aSuggestions = *maybe__aSuggestions; // Sentinel = 'aSuggestions' if ((!((aReader)->ReadSentinel(529204477)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsString[]'"); return MsgValueError; } aReader->EndRead(); resolve(std::move(aSuggestions)); return MsgProcessed; }, std::move(aReject)); } else { aReject(::mozilla::ipc::ResponseRejectReason::SendError); } return; } auto PRemoteSpellcheckEngineChild::SendSuggest( const nsAString& aWord, const uint32_t& aCount) -> RefPtr { RefPtr, ResponseRejectReason, true>::Private> promise__ = new MozPromise, ResponseRejectReason, true>::Private(__func__); promise__->UseDirectTaskDispatch(__func__); SendSuggest(std::forward(aWord), std::forward(aCount), [promise__](nsTArray&& aValue) { promise__->Resolve(std::move(aValue), __func__); }, [promise__](ResponseRejectReason&& aReason) { promise__->Reject(std::move(aReason), __func__); }); return promise__; } auto PRemoteSpellcheckEngineChild::SendSetDictionaryFromList( mozilla::Span aList, mozilla::ipc::ResolveCallback>&& aResolve, mozilla::ipc::RejectCallback&& aReject) -> void { UniquePtr msg__ = PRemoteSpellcheckEngine::Msg_SetDictionaryFromList(Id()); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), aList); // Sentinel = 'aList' ((&(writer__)))->WriteSentinel(95355390); if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PRemoteSpellcheckEngineChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_SetDictionaryFromList", OTHER); IPC::Message::seqno_t seqno__ = 0; if (ChannelSend(std::move(msg__), (&(seqno__)))) { mAsyncCallbacks.AddCallback(seqno__, PRemoteSpellcheckEngine::Reply_SetDictionaryFromList__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable { auto maybe__aSuccess = IPC::ReadParam(aReader); if (!maybe__aSuccess) { (aReader)->FatalError("Error deserializing 'bool'"); return MsgValueError; } auto& aSuccess = *maybe__aSuccess; // Sentinel = 'aSuccess' if ((!((aReader)->ReadSentinel(236323643)))) { mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); return MsgValueError; } auto maybe__aDictionary = IPC::ReadParam(aReader); if (!maybe__aDictionary) { (aReader)->FatalError("Error deserializing 'nsCString'"); return MsgValueError; } auto& aDictionary = *maybe__aDictionary; // Sentinel = 'aDictionary' if ((!((aReader)->ReadSentinel(430703736)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'"); return MsgValueError; } aReader->EndRead(); resolve(std::make_tuple(std::move(aSuccess), std::move(aDictionary))); return MsgProcessed; }, std::move(aReject)); } else { aReject(::mozilla::ipc::ResponseRejectReason::SendError); } return; } auto PRemoteSpellcheckEngineChild::SendSetDictionaryFromList(mozilla::Span aList) -> RefPtr { RefPtr, ResponseRejectReason, true>::Private> promise__ = new MozPromise, ResponseRejectReason, true>::Private(__func__); promise__->UseDirectTaskDispatch(__func__); SendSetDictionaryFromList(std::forward>(aList), [promise__](std::tuple&& aValue) { promise__->Resolve(std::move(aValue), __func__); }, [promise__](ResponseRejectReason&& aReason) { promise__->Reject(std::move(aReason), __func__); }); return promise__; } auto PRemoteSpellcheckEngineChild::DeallocManagee( mozilla::ipc::ProtocolId aProtocolId, IProtocol* aListener) -> void { FatalError("unreached"); return; } auto PRemoteSpellcheckEngineChild::OnMessageReceived(const Message& msg__) -> PRemoteSpellcheckEngineChild::Result { if (!CanSend()) { if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PRemoteSpellcheckEngineChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Ignored message for dead actor", (&(msg__))->type(), mozilla::ipc::MessageDirection::eSending); } return MsgProcessed; } 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::Reply___delete____ID: { return MsgProcessed; } case PRemoteSpellcheckEngine::Reply_CheckAsync__ID: { if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PRemoteSpellcheckEngineChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_CheckAsync", OTHER); return mAsyncCallbacks.GotReply(this, msg__); } case PRemoteSpellcheckEngine::Reply_SetDictionaries__ID: { if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PRemoteSpellcheckEngineChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_SetDictionaries", OTHER); return mAsyncCallbacks.GotReply(this, msg__); } case PRemoteSpellcheckEngine::Reply_Suggest__ID: { if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PRemoteSpellcheckEngineChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_Suggest", OTHER); return mAsyncCallbacks.GotReply(this, msg__); } case PRemoteSpellcheckEngine::Reply_SetDictionaryFromList__ID: { if (mozilla::ipc::LoggingEnabledFor("PRemoteSpellcheckEngine", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PRemoteSpellcheckEngineChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PRemoteSpellcheckEngine::Msg_SetDictionaryFromList", OTHER); return mAsyncCallbacks.GotReply(this, msg__); } default: return MsgNotKnown; } } auto PRemoteSpellcheckEngineChild::OnMessageReceived( const Message& msg__, UniquePtr& reply__) -> PRemoteSpellcheckEngineChild::Result { if (!CanSend()) { return MsgDropped; } return MsgNotKnown; } } // namespace mozilla