// // Automatically generated by ipdlc. // Edit at your own risk // #include "mozilla/dom/notification/PNotificationChild.h" #include "ipc/ErrorIPCUtils.h" #include "mozilla/GfxMessageUtils.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/RemoteLazyInputStream.h" #include "mozilla/URLClassifierIPCUtils.h" #include "mozilla/dom/CSPMessageUtils.h" #include "mozilla/dom/DocShellMessageUtils.h" #include "mozilla/dom/DomSecurityIPCUtils.h" #include "mozilla/dom/NavigationAPIIPCUtils.h" #include "mozilla/dom/PermissionMessageUtils.h" #include "mozilla/dom/PolicyContainerMessageUtils.h" #include "mozilla/dom/PropertyBagUtils.h" #include "mozilla/dom/ReferrerInfoUtils.h" #include "mozilla/dom/RemoteType.h" #include "mozilla/dom/SessionHistoryEntry.h" #include "mozilla/dom/TabMessageUtils.h" #include "mozilla/dom/ipc/StructuredCloneData.h" #include "mozilla/dom/notification/IPCUtils.h" #include "mozilla/dom/notification/NotificationChild.h" #include "mozilla/ipc/BigBuffer.h" #include "mozilla/ipc/IPCCore.h" #include "mozilla/ipc/IPCStreamUtils.h" #include "mozilla/ipc/URIUtils.h" #include "mozilla/layers/LayersMessageUtils.h" #include "mozilla/net/NeckoMessageUtils.h" #include "nsIPolicyContainer.h" #include "nsIPrincipal.h" #include "nsIReferrerInfo.h" #include "nsIURI.h" #include "nsIVariant.h" #include "nsStructuredCloneContainer.h" #include "mozilla/ipc/PBackgroundChild.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 { namespace notification { auto PNotificationChild::ProcessingError( Result aCode, const char* aReason) -> void { } auto PNotificationChild::ShouldContinueFromReplyTimeout() -> bool { return true; } MOZ_IMPLICIT PNotificationChild::PNotificationChild() : mozilla::ipc::IToplevelProtocol("PNotificationChild", kProtocolId, mozilla::ipc::ChildSide) { MOZ_COUNT_CTOR(PNotificationChild); } PNotificationChild::~PNotificationChild() { MOZ_COUNT_DTOR(PNotificationChild); } auto PNotificationChild::ActorAlloc() -> void { MOZ_RELEASE_ASSERT(XRE_IsParentProcess() || XRE_IsContentProcess(), "Invalid process for `PNotificationChild'"); AddRef(); } auto PNotificationChild::ActorDealloc() -> void { Release(); } auto PNotificationChild::ManagedProtocolIds() const -> mozilla::Span { return {}; } auto PNotificationChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer* { switch (aProtocol) { default: return nullptr; } } auto PNotificationChild::RejectPendingResponses(ResponseRejectReason aReason) -> void { mAsyncCallbacks.RejectPendingResponses(aReason); } auto PNotificationChild::SendShow( mozilla::Maybe&& aIcon, mozilla::ipc::ResolveCallback&& aResolve, mozilla::ipc::RejectCallback&& aReject) -> void { UniquePtr msg__ = PNotification::Msg_Show(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), std::move(aIcon)); // Sentinel = 'aIcon' ((&(writer__)))->WriteSentinel(92471787); if (mozilla::ipc::LoggingEnabledFor("PNotification", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PNotificationChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PNotification::Msg_Show", OTHER); IPC::Message::seqno_t seqno__ = 0; if (ChannelSend(std::move(msg__), (&(seqno__)))) { mAsyncCallbacks.AddCallback(seqno__, PNotification::Reply_Show__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable { auto maybe__rv = IPC::ReadParam(aReader); if (!maybe__rv) { (aReader)->FatalError("Error deserializing 'CopyableErrorResult'"); return MsgValueError; } auto& rv = *maybe__rv; // Sentinel = 'rv' if ((!((aReader)->ReadSentinel(22806761)))) { mozilla::ipc::SentinelReadError("Error deserializing 'CopyableErrorResult'"); return MsgValueError; } aReader->EndRead(); resolve(std::move(rv)); return MsgProcessed; }, std::move(aReject)); } else { aReject(::mozilla::ipc::ResponseRejectReason::SendError); } return; } auto PNotificationChild::SendShow(mozilla::Maybe&& aIcon) -> RefPtr { RefPtr::Private> promise__ = new MozPromise::Private(__func__); promise__->UseDirectTaskDispatch(__func__); SendShow(std::forward&&>(aIcon), [promise__](CopyableErrorResult&& aValue) { promise__->Resolve(std::move(aValue), __func__); }, [promise__](ResponseRejectReason&& aReason) { promise__->Reject(std::move(aReason), __func__); }); return promise__; } auto PNotificationChild::SendClose() -> bool { UniquePtr msg__ = PNotification::Msg_Close(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PNotification", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PNotificationChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PNotification::Msg_Close", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PNotificationChild::DeallocManagee( mozilla::ipc::ProtocolId aProtocolId, IProtocol* aListener) -> void { FatalError("unreached"); return; } auto PNotificationChild::OnMessageReceived(const Message& msg__) -> PNotificationChild::Result { if (!CanSend()) { if (mozilla::ipc::LoggingEnabledFor("PNotification", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PNotificationChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Ignored message for dead actor", (&(msg__))->type(), mozilla::ipc::MessageDirection::eSending); } return MsgProcessed; } switch (msg__.type()) { case PNotification::Reply_Show__ID: { if (mozilla::ipc::LoggingEnabledFor("PNotification", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PNotificationChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PNotification::Msg_Show", OTHER); return mAsyncCallbacks.GotReply(this, msg__); } case PNotification::Msg_NotifyClick__ID: { if (mozilla::ipc::LoggingEnabledFor("PNotification", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PNotificationChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PNotification::Msg_NotifyClick", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::notification::NotificationChild*>(this))->RecvNotifyClick(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } 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 PNotificationChild::OnMessageReceived( const Message& msg__, UniquePtr& reply__) -> PNotificationChild::Result { if (!CanSend()) { return MsgDropped; } MOZ_ASSERT_UNREACHABLE("message protocol not supported"); return MsgNotKnown; } } // namespace notification } // namespace dom } // namespace mozilla