// // Automatically generated by ipdlc. // Edit at your own risk // #include "mozilla/dom/PFilePickerParent.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/RemoteLazyInputStream.h" #include "mozilla/dom/FilePickerMessageUtils.h" #include "mozilla/dom/FilePickerParent.h" #include "mozilla/ipc/IPCCore.h" #include "mozilla/dom/PBrowserParent.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 { MOZ_IMPLICIT PFilePickerParent::PFilePickerParent() : mozilla::ipc::IRefCountedProtocol(kProtocolId, mozilla::ipc::ParentSide) { MOZ_COUNT_CTOR(PFilePickerParent); } PFilePickerParent::~PFilePickerParent() { MOZ_COUNT_DTOR(PFilePickerParent); } auto PFilePickerParent::ActorAlloc() -> void { AddRef(); } auto PFilePickerParent::ActorDealloc() -> void { Release(); } auto PFilePickerParent::OtherPid() const -> ::base::ProcessId { ::base::ProcessId pid = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherPidMaybeInvalid(); MOZ_RELEASE_ASSERT(pid != ::base::kInvalidProcessId); return pid; } auto PFilePickerParent::OtherChildID() const -> ::GeckoChildID { ::GeckoChildID childID = ::mozilla::ipc::IProtocol::ToplevelProtocol()->OtherChildIDMaybeInvalid(); MOZ_RELEASE_ASSERT(childID != -1); return childID; } auto PFilePickerParent::OtherEndpointProcInfo() const -> ::mozilla::ipc::EndpointProcInfo { return ::mozilla::ipc::EndpointProcInfo{OtherPid(), OtherChildID()}; } auto PFilePickerParent::Manager() const -> PBrowserParent* { return static_cast(IProtocol::Manager()); } auto PFilePickerParent::ManagedProtocolIds() const -> mozilla::Span { return {}; } auto PFilePickerParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer* { switch (aProtocol) { default: return nullptr; } } auto PFilePickerParent::Send__delete__( PFilePickerParent* actor, const MaybeInputData& data, const ResultCode& result) -> bool { if (!actor || !actor->CanSend()) { NS_WARNING("Attempt to __delete__ missing or closed actor"); return false; } UniquePtr msg__ = PFilePicker::Msg___delete__((actor)->Id()); IPC::MessageWriter writer__{ (*(msg__)), actor}; IPC::WriteParam((&(writer__)), data); // Sentinel = 'data' ((&(writer__)))->WriteSentinel(67109275); IPC::WriteParam((&(writer__)), result); // Sentinel = 'result' ((&(writer__)))->WriteSentinel(153223840); if (mozilla::ipc::LoggingEnabledFor("PFilePicker", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PFilePickerParent", actor->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PFilePicker::Msg___delete__", OTHER); bool sendok__ = (actor)->ChannelSend(std::move(msg__)); actor->ActorDisconnected(Deletion); return sendok__; } auto PFilePickerParent::DeallocManagee( mozilla::ipc::ProtocolId aProtocolId, IProtocol* aListener) -> void { FatalError("unreached"); return; } auto PFilePickerParent::OnMessageReceived(const Message& msg__) -> PFilePickerParent::Result { if (!CanSend()) { if (mozilla::ipc::LoggingEnabledFor("PFilePicker", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PFilePickerParent", 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 PFilePicker::Msg_Open__ID: { if (mozilla::ipc::LoggingEnabledFor("PFilePicker", mozilla::ipc::ParentSide)) { mozilla::ipc::LogMessageForProtocol( "PFilePickerParent", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PFilePicker::Msg_Open", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__selectedType = IPC::ReadParam((&(reader__))); if (!maybe__selectedType) { FatalError("Error deserializing 'int16_t'"); return MsgValueError; } auto& selectedType = *maybe__selectedType; // Sentinel = 'selectedType' if ((!(((&(reader__)))->ReadSentinel(539100396)))) { mozilla::ipc::SentinelReadError("Error deserializing 'int16_t'"); return MsgValueError; } auto maybe__addToRecentDocs = IPC::ReadParam((&(reader__))); if (!maybe__addToRecentDocs) { FatalError("Error deserializing 'bool'"); return MsgValueError; } auto& addToRecentDocs = *maybe__addToRecentDocs; // Sentinel = 'addToRecentDocs' if ((!(((&(reader__)))->ReadSentinel(772343255)))) { mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); return MsgValueError; } auto maybe__defaultFile = IPC::ReadParam((&(reader__))); if (!maybe__defaultFile) { FatalError("Error deserializing 'nsString'"); return MsgValueError; } auto& defaultFile = *maybe__defaultFile; // Sentinel = 'defaultFile' if ((!(((&(reader__)))->ReadSentinel(443941990)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); return MsgValueError; } auto maybe__defaultExtension = IPC::ReadParam((&(reader__))); if (!maybe__defaultExtension) { FatalError("Error deserializing 'nsString'"); return MsgValueError; } auto& defaultExtension = *maybe__defaultExtension; // Sentinel = 'defaultExtension' if ((!(((&(reader__)))->ReadSentinel(932447907)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); return MsgValueError; } auto maybe__filters = IPC::ReadParam>((&(reader__))); if (!maybe__filters) { FatalError("Error deserializing 'nsString[]'"); return MsgValueError; } auto& filters = *maybe__filters; // Sentinel = 'filters' if ((!(((&(reader__)))->ReadSentinel(196674298)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsString[]'"); return MsgValueError; } auto maybe__filterNames = IPC::ReadParam>((&(reader__))); if (!maybe__filterNames) { FatalError("Error deserializing 'nsString[]'"); return MsgValueError; } auto& filterNames = *maybe__filterNames; // Sentinel = 'filterNames' if ((!(((&(reader__)))->ReadSentinel(451937403)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsString[]'"); return MsgValueError; } auto maybe__rawFilters = IPC::ReadParam>((&(reader__))); if (!maybe__rawFilters) { FatalError("Error deserializing 'nsString[]'"); return MsgValueError; } auto& rawFilters = *maybe__rawFilters; // Sentinel = 'rawFilters' if ((!(((&(reader__)))->ReadSentinel(376505380)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsString[]'"); return MsgValueError; } auto maybe__displayDirectory = IPC::ReadParam((&(reader__))); if (!maybe__displayDirectory) { FatalError("Error deserializing 'nsString'"); return MsgValueError; } auto& displayDirectory = *maybe__displayDirectory; // Sentinel = 'displayDirectory' if ((!(((&(reader__)))->ReadSentinel(938935980)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); return MsgValueError; } auto maybe__displaySpecialDirectory = IPC::ReadParam((&(reader__))); if (!maybe__displaySpecialDirectory) { FatalError("Error deserializing 'nsString'"); return MsgValueError; } auto& displaySpecialDirectory = *maybe__displaySpecialDirectory; // Sentinel = 'displaySpecialDirectory' if ((!(((&(reader__)))->ReadSentinel(1884555629)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); return MsgValueError; } auto maybe__okButtonLabel = IPC::ReadParam((&(reader__))); if (!maybe__okButtonLabel) { FatalError("Error deserializing 'nsString'"); return MsgValueError; } auto& okButtonLabel = *maybe__okButtonLabel; // Sentinel = 'okButtonLabel' if ((!(((&(reader__)))->ReadSentinel(617153847)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); return MsgValueError; } auto maybe__capture = IPC::ReadParam((&(reader__))); if (!maybe__capture) { FatalError("Error deserializing 'CaptureTarget'"); return MsgValueError; } auto& capture = *maybe__capture; // Sentinel = 'capture' if ((!(((&(reader__)))->ReadSentinel(195691253)))) { mozilla::ipc::SentinelReadError("Error deserializing 'CaptureTarget'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::FilePickerParent*>(this))->RecvOpen(std::move(selectedType), std::move(addToRecentDocs), std::move(defaultFile), std::move(defaultExtension), std::move(filters), std::move(filterNames), std::move(rawFilters), std::move(displayDirectory), std::move(displaySpecialDirectory), std::move(okButtonLabel), std::move(capture)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PFilePicker::Reply___delete____ID: { return MsgProcessed; } default: return MsgNotKnown; } } auto PFilePickerParent::OnMessageReceived( const Message& msg__, UniquePtr& reply__) -> PFilePickerParent::Result { if (!CanSend()) { return MsgDropped; } return MsgNotKnown; } } // namespace dom } // namespace mozilla