// // Automatically generated by ipdlc. // Edit at your own risk // #include "mozilla/dom/PWebTransportChild.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/dom/DomSecurityIPCUtils.h" #include "mozilla/dom/WebTransportChild.h" #include "mozilla/ipc/DataPipe.h" #include "mozilla/ipc/IPCCore.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 { auto PWebTransportChild::ProcessingError( Result aCode, const char* aReason) -> void { } auto PWebTransportChild::ShouldContinueFromReplyTimeout() -> bool { return true; } MOZ_IMPLICIT PWebTransportChild::PWebTransportChild() : mozilla::ipc::IToplevelProtocol("PWebTransportChild", kProtocolId, mozilla::ipc::ChildSide) { MOZ_COUNT_CTOR(PWebTransportChild); } PWebTransportChild::~PWebTransportChild() { MOZ_COUNT_DTOR(PWebTransportChild); } auto PWebTransportChild::ActorAlloc() -> void { MOZ_RELEASE_ASSERT(XRE_IsParentProcess() || XRE_IsContentProcess(), "Invalid process for `PWebTransportChild'"); AddRef(); } auto PWebTransportChild::ActorDealloc() -> void { Release(); } auto PWebTransportChild::ManagedProtocolIds() const -> mozilla::Span { return {}; } auto PWebTransportChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer* { switch (aProtocol) { default: return nullptr; } } auto PWebTransportChild::RejectPendingResponses(ResponseRejectReason aReason) -> void { mAsyncCallbacks.RejectPendingResponses(aReason); } auto PWebTransportChild::SendClose( const uint32_t& code, const nsACString& reason, mozilla::ipc::ResolveCallback>&& aResolve, mozilla::ipc::RejectCallback&& aReject) -> void { UniquePtr msg__ = PWebTransport::Msg_Close(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), code); // Sentinel = 'code' ((&(writer__)))->WriteSentinel(67764636); IPC::WriteParam((&(writer__)), reason); // Sentinel = 'reason' ((&(writer__)))->WriteSentinel(148112009); if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PWebTransport::Msg_Close", OTHER); IPC::Message::seqno_t seqno__ = 0; if (ChannelSend(std::move(msg__), (&(seqno__)))) { mAsyncCallbacks.AddCallback(seqno__, PWebTransport::Reply_Close__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable { auto maybe__stats = IPC::ReadParam>(aReader); if (!maybe__stats) { (aReader)->FatalError("Error deserializing 'WebTransportStatsData?'"); return MsgValueError; } auto& stats = *maybe__stats; // Sentinel = 'stats' if ((!((aReader)->ReadSentinel(110232112)))) { mozilla::ipc::SentinelReadError("Error deserializing 'WebTransportStatsData?'"); return MsgValueError; } aReader->EndRead(); resolve(std::move(stats)); return MsgProcessed; }, std::move(aReject)); } else { aReject(::mozilla::ipc::ResponseRejectReason::SendError); } return; } auto PWebTransportChild::SendClose( const uint32_t& code, const nsACString& reason) -> RefPtr { RefPtr, ResponseRejectReason, true>::Private> promise__ = new MozPromise, ResponseRejectReason, true>::Private(__func__); promise__->UseDirectTaskDispatch(__func__); SendClose(std::forward(code), std::forward(reason), [promise__](mozilla::Maybe&& aValue) { promise__->Resolve(std::move(aValue), __func__); }, [promise__](ResponseRejectReason&& aReason) { promise__->Reject(std::move(aReason), __func__); }); return promise__; } auto PWebTransportChild::SendCreateUnidirectionalStream( const int64_t& sendOrder, const mozilla::Maybe& sendGroupId, mozilla::ipc::ResolveCallback&& aResolve, mozilla::ipc::RejectCallback&& aReject) -> void { UniquePtr msg__ = PWebTransport::Msg_CreateUnidirectionalStream(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), sendOrder); // Sentinel = 'sendOrder' ((&(writer__)))->WriteSentinel(307299239); IPC::WriteParam((&(writer__)), sendGroupId); // Sentinel = 'sendGroupId' ((&(writer__)))->WriteSentinel(449709157); if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PWebTransport::Msg_CreateUnidirectionalStream", OTHER); IPC::Message::seqno_t seqno__ = 0; if (ChannelSend(std::move(msg__), (&(seqno__)))) { mAsyncCallbacks.AddCallback(seqno__, PWebTransport::Reply_CreateUnidirectionalStream__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable { auto maybe__response = IPC::ReadParam(aReader); if (!maybe__response) { (aReader)->FatalError("Error deserializing 'UnidirectionalStreamResponse'"); return MsgValueError; } auto& response = *maybe__response; // Sentinel = 'response' if ((!((aReader)->ReadSentinel(260965232)))) { mozilla::ipc::SentinelReadError("Error deserializing 'UnidirectionalStreamResponse'"); return MsgValueError; } aReader->EndRead(); resolve(std::move(response)); return MsgProcessed; }, std::move(aReject)); } else { aReject(::mozilla::ipc::ResponseRejectReason::SendError); } return; } auto PWebTransportChild::SendCreateUnidirectionalStream( const int64_t& sendOrder, const mozilla::Maybe& sendGroupId) -> RefPtr { RefPtr::Private> promise__ = new MozPromise::Private(__func__); promise__->UseDirectTaskDispatch(__func__); SendCreateUnidirectionalStream(std::forward(sendOrder), std::forward&>(sendGroupId), [promise__](UnidirectionalStreamResponse&& aValue) { promise__->Resolve(std::move(aValue), __func__); }, [promise__](ResponseRejectReason&& aReason) { promise__->Reject(std::move(aReason), __func__); }); return promise__; } auto PWebTransportChild::SendCreateBidirectionalStream( const int64_t& sendOrder, const mozilla::Maybe& sendGroupId, mozilla::ipc::ResolveCallback&& aResolve, mozilla::ipc::RejectCallback&& aReject) -> void { UniquePtr msg__ = PWebTransport::Msg_CreateBidirectionalStream(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), sendOrder); // Sentinel = 'sendOrder' ((&(writer__)))->WriteSentinel(307299239); IPC::WriteParam((&(writer__)), sendGroupId); // Sentinel = 'sendGroupId' ((&(writer__)))->WriteSentinel(449709157); if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PWebTransport::Msg_CreateBidirectionalStream", OTHER); IPC::Message::seqno_t seqno__ = 0; if (ChannelSend(std::move(msg__), (&(seqno__)))) { mAsyncCallbacks.AddCallback(seqno__, PWebTransport::Reply_CreateBidirectionalStream__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable { auto maybe__response = IPC::ReadParam(aReader); if (!maybe__response) { (aReader)->FatalError("Error deserializing 'BidirectionalStreamResponse'"); return MsgValueError; } auto& response = *maybe__response; // Sentinel = 'response' if ((!((aReader)->ReadSentinel(260965232)))) { mozilla::ipc::SentinelReadError("Error deserializing 'BidirectionalStreamResponse'"); return MsgValueError; } aReader->EndRead(); resolve(std::move(response)); return MsgProcessed; }, std::move(aReject)); } else { aReject(::mozilla::ipc::ResponseRejectReason::SendError); } return; } auto PWebTransportChild::SendCreateBidirectionalStream( const int64_t& sendOrder, const mozilla::Maybe& sendGroupId) -> RefPtr { RefPtr::Private> promise__ = new MozPromise::Private(__func__); promise__->UseDirectTaskDispatch(__func__); SendCreateBidirectionalStream(std::forward(sendOrder), std::forward&>(sendGroupId), [promise__](BidirectionalStreamResponse&& aValue) { promise__->Resolve(std::move(aValue), __func__); }, [promise__](ResponseRejectReason&& aReason) { promise__->Reject(std::move(aReason), __func__); }); return promise__; } auto PWebTransportChild::SendCreateSendGroup(const uint64_t& groupId) -> bool { UniquePtr msg__ = PWebTransport::Msg_CreateSendGroup(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), groupId); // Sentinel = 'groupId' ((&(writer__)))->WriteSentinel(197722843); if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PWebTransport::Msg_CreateSendGroup", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PWebTransportChild::SendOutgoingDatagram( mozilla::Span data, const TimeStamp& expirationTime, const uint64_t& sendGroupId, const int64_t& sendOrder, mozilla::ipc::ResolveCallback&& aResolve, mozilla::ipc::RejectCallback&& aReject) -> void { UniquePtr msg__ = PWebTransport::Msg_OutgoingDatagram(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), data); // Sentinel = 'data' ((&(writer__)))->WriteSentinel(67109275); IPC::WriteParam((&(writer__)), expirationTime); // Sentinel = 'expirationTime' ((&(writer__)))->WriteSentinel(743769555); IPC::WriteParam((&(writer__)), sendGroupId); // Sentinel = 'sendGroupId' ((&(writer__)))->WriteSentinel(449709157); IPC::WriteParam((&(writer__)), sendOrder); // Sentinel = 'sendOrder' ((&(writer__)))->WriteSentinel(307299239); if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PWebTransport::Msg_OutgoingDatagram", OTHER); IPC::Message::seqno_t seqno__ = 0; if (ChannelSend(std::move(msg__), (&(seqno__)))) { mAsyncCallbacks.AddCallback(seqno__, PWebTransport::Reply_OutgoingDatagram__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable { auto maybe__response = IPC::ReadParam(aReader); if (!maybe__response) { (aReader)->FatalError("Error deserializing 'nsresult'"); return MsgValueError; } auto& response = *maybe__response; // Sentinel = 'response' if ((!((aReader)->ReadSentinel(260965232)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'"); return MsgValueError; } aReader->EndRead(); resolve(std::move(response)); return MsgProcessed; }, std::move(aReject)); } else { aReject(::mozilla::ipc::ResponseRejectReason::SendError); } return; } auto PWebTransportChild::SendOutgoingDatagram( mozilla::Span data, const TimeStamp& expirationTime, const uint64_t& sendGroupId, const int64_t& sendOrder) -> RefPtr { RefPtr::Private> promise__ = new MozPromise::Private(__func__); promise__->UseDirectTaskDispatch(__func__); SendOutgoingDatagram(std::forward>(data), std::forward(expirationTime), std::forward(sendGroupId), std::forward(sendOrder), [promise__](nsresult&& aValue) { promise__->Resolve(std::move(aValue), __func__); }, [promise__](ResponseRejectReason&& aReason) { promise__->Reject(std::move(aReason), __func__); }); return promise__; } auto PWebTransportChild::SendGetMaxDatagramSize( mozilla::ipc::ResolveCallback&& aResolve, mozilla::ipc::RejectCallback&& aReject) -> void { UniquePtr msg__ = PWebTransport::Msg_GetMaxDatagramSize(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PWebTransport::Msg_GetMaxDatagramSize", OTHER); IPC::Message::seqno_t seqno__ = 0; if (ChannelSend(std::move(msg__), (&(seqno__)))) { mAsyncCallbacks.AddCallback(seqno__, PWebTransport::Reply_GetMaxDatagramSize__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable { auto maybe__maxDatagramSize = IPC::ReadParam(aReader); if (!maybe__maxDatagramSize) { (aReader)->FatalError("Error deserializing 'uint64_t'"); return MsgValueError; } auto& maxDatagramSize = *maybe__maxDatagramSize; // Sentinel = 'maxDatagramSize' if ((!((aReader)->ReadSentinel(801179139)))) { mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'"); return MsgValueError; } aReader->EndRead(); resolve(std::move(maxDatagramSize)); return MsgProcessed; }, std::move(aReject)); } else { aReject(::mozilla::ipc::ResponseRejectReason::SendError); } return; } auto PWebTransportChild::SendGetMaxDatagramSize() -> RefPtr { RefPtr::Private> promise__ = new MozPromise::Private(__func__); promise__->UseDirectTaskDispatch(__func__); SendGetMaxDatagramSize([promise__](uint64_t&& aValue) { promise__->Resolve(std::move(aValue), __func__); }, [promise__](ResponseRejectReason&& aReason) { promise__->Reject(std::move(aReason), __func__); }); return promise__; } auto PWebTransportChild::SendGetHttpChannelID( mozilla::ipc::ResolveCallback&& aResolve, mozilla::ipc::RejectCallback&& aReject) -> void { UniquePtr msg__ = PWebTransport::Msg_GetHttpChannelID(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PWebTransport::Msg_GetHttpChannelID", OTHER); IPC::Message::seqno_t seqno__ = 0; if (ChannelSend(std::move(msg__), (&(seqno__)))) { mAsyncCallbacks.AddCallback(seqno__, PWebTransport::Reply_GetHttpChannelID__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable { auto maybe__httpChannelID = IPC::ReadParam(aReader); if (!maybe__httpChannelID) { (aReader)->FatalError("Error deserializing 'uint64_t'"); return MsgValueError; } auto& httpChannelID = *maybe__httpChannelID; // Sentinel = 'httpChannelID' if ((!((aReader)->ReadSentinel(617284871)))) { mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'"); return MsgValueError; } aReader->EndRead(); resolve(std::move(httpChannelID)); return MsgProcessed; }, std::move(aReject)); } else { aReject(::mozilla::ipc::ResponseRejectReason::SendError); } return; } auto PWebTransportChild::SendGetHttpChannelID() -> RefPtr { RefPtr::Private> promise__ = new MozPromise::Private(__func__); promise__->UseDirectTaskDispatch(__func__); SendGetHttpChannelID([promise__](uint64_t&& aValue) { promise__->Resolve(std::move(aValue), __func__); }, [promise__](ResponseRejectReason&& aReason) { promise__->Reject(std::move(aReason), __func__); }); return promise__; } auto PWebTransportChild::SendSetSendOrder( const uint64_t& streamId, const int64_t& sendOrder) -> bool { UniquePtr msg__ = PWebTransport::Msg_SetSendOrder(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), streamId); // Sentinel = 'streamId' ((&(writer__)))->WriteSentinel(254935866); IPC::WriteParam((&(writer__)), sendOrder); // Sentinel = 'sendOrder' ((&(writer__)))->WriteSentinel(307299239); if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PWebTransport::Msg_SetSendOrder", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PWebTransportChild::SendSetSendGroup( const uint64_t& streamId, const uint64_t& groupId) -> bool { UniquePtr msg__ = PWebTransport::Msg_SetSendGroup(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), streamId); // Sentinel = 'streamId' ((&(writer__)))->WriteSentinel(254935866); IPC::WriteParam((&(writer__)), groupId); // Sentinel = 'groupId' ((&(writer__)))->WriteSentinel(197722843); if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PWebTransport::Msg_SetSendGroup", OTHER); bool sendok__ = ChannelSend(std::move(msg__)); return sendok__; } auto PWebTransportChild::SendExportKeyingMaterial( mozilla::Span label, const mozilla::Maybe>& context, mozilla::ipc::ResolveCallback>&& aResolve, mozilla::ipc::RejectCallback&& aReject) -> void { UniquePtr msg__ = PWebTransport::Msg_ExportKeyingMaterial(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; IPC::WriteParam((&(writer__)), label); // Sentinel = 'label' ((&(writer__)))->WriteSentinel(100729345); IPC::WriteParam((&(writer__)), context); // Sentinel = 'context' ((&(writer__)))->WriteSentinel(199164678); if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PWebTransport::Msg_ExportKeyingMaterial", OTHER); IPC::Message::seqno_t seqno__ = 0; if (ChannelSend(std::move(msg__), (&(seqno__)))) { mAsyncCallbacks.AddCallback(seqno__, PWebTransport::Reply_ExportKeyingMaterial__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable { auto maybe__keyingMaterial = IPC::ReadParam>(aReader); if (!maybe__keyingMaterial) { (aReader)->FatalError("Error deserializing 'uint8_t[]'"); return MsgValueError; } auto& keyingMaterial = *maybe__keyingMaterial; // Sentinel = 'keyingMaterial' if ((!((aReader)->ReadSentinel(722732471)))) { mozilla::ipc::SentinelReadError("Error deserializing 'uint8_t[]'"); return MsgValueError; } aReader->EndRead(); resolve(std::move(keyingMaterial)); return MsgProcessed; }, std::move(aReject)); } else { aReject(::mozilla::ipc::ResponseRejectReason::SendError); } return; } auto PWebTransportChild::SendExportKeyingMaterial( mozilla::Span label, const mozilla::Maybe>& context) -> RefPtr { RefPtr, ResponseRejectReason, true>::Private> promise__ = new MozPromise, ResponseRejectReason, true>::Private(__func__); promise__->UseDirectTaskDispatch(__func__); SendExportKeyingMaterial(std::forward>(label), std::forward>&>(context), [promise__](nsTArray&& aValue) { promise__->Resolve(std::move(aValue), __func__); }, [promise__](ResponseRejectReason&& aReason) { promise__->Reject(std::move(aReason), __func__); }); return promise__; } auto PWebTransportChild::SendGetStats( mozilla::ipc::ResolveCallback>&& aResolve, mozilla::ipc::RejectCallback&& aReject) -> void { UniquePtr msg__ = PWebTransport::Msg_GetStats(MSG_ROUTING_CONTROL); IPC::MessageWriter writer__{ (*(msg__)), this}; if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending ", msg__->type(), mozilla::ipc::MessageDirection::eSending); } AUTO_PROFILER_LABEL("PWebTransport::Msg_GetStats", OTHER); IPC::Message::seqno_t seqno__ = 0; if (ChannelSend(std::move(msg__), (&(seqno__)))) { mAsyncCallbacks.AddCallback(seqno__, PWebTransport::Reply_GetStats__ID, [resolve=std::move(aResolve)](IPC::MessageReader* aReader) mutable { auto maybe__stats = IPC::ReadParam>(aReader); if (!maybe__stats) { (aReader)->FatalError("Error deserializing 'WebTransportStatsData?'"); return MsgValueError; } auto& stats = *maybe__stats; // Sentinel = 'stats' if ((!((aReader)->ReadSentinel(110232112)))) { mozilla::ipc::SentinelReadError("Error deserializing 'WebTransportStatsData?'"); return MsgValueError; } aReader->EndRead(); resolve(std::move(stats)); return MsgProcessed; }, std::move(aReject)); } else { aReject(::mozilla::ipc::ResponseRejectReason::SendError); } return; } auto PWebTransportChild::SendGetStats() -> RefPtr { RefPtr, ResponseRejectReason, true>::Private> promise__ = new MozPromise, ResponseRejectReason, true>::Private(__func__); promise__->UseDirectTaskDispatch(__func__); SendGetStats([promise__](mozilla::Maybe&& aValue) { promise__->Resolve(std::move(aValue), __func__); }, [promise__](ResponseRejectReason&& aReason) { promise__->Reject(std::move(aReason), __func__); }); return promise__; } auto PWebTransportChild::DeallocManagee( mozilla::ipc::ProtocolId aProtocolId, IProtocol* aListener) -> void { FatalError("unreached"); return; } auto PWebTransportChild::OnMessageReceived(const Message& msg__) -> PWebTransportChild::Result { if (!CanSend()) { if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Ignored message for dead actor", (&(msg__))->type(), mozilla::ipc::MessageDirection::eSending); } return MsgProcessed; } switch (msg__.type()) { case PWebTransport::Reply_Close__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebTransport::Msg_Close", OTHER); return mAsyncCallbacks.GotReply(this, msg__); } case PWebTransport::Reply_CreateUnidirectionalStream__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebTransport::Msg_CreateUnidirectionalStream", OTHER); return mAsyncCallbacks.GotReply(this, msg__); } case PWebTransport::Reply_CreateBidirectionalStream__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebTransport::Msg_CreateBidirectionalStream", OTHER); return mAsyncCallbacks.GotReply(this, msg__); } case PWebTransport::Reply_OutgoingDatagram__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebTransport::Msg_OutgoingDatagram", OTHER); return mAsyncCallbacks.GotReply(this, msg__); } case PWebTransport::Reply_GetMaxDatagramSize__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebTransport::Msg_GetMaxDatagramSize", OTHER); return mAsyncCallbacks.GotReply(this, msg__); } case PWebTransport::Reply_GetHttpChannelID__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebTransport::Msg_GetHttpChannelID", OTHER); return mAsyncCallbacks.GotReply(this, msg__); } case PWebTransport::Reply_ExportKeyingMaterial__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebTransport::Msg_ExportKeyingMaterial", OTHER); return mAsyncCallbacks.GotReply(this, msg__); } case PWebTransport::Reply_GetStats__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebTransport::Msg_GetStats", OTHER); return mAsyncCallbacks.GotReply(this, msg__); } case PWebTransport::Msg_IncomingUnidirectionalStream__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebTransport::Msg_IncomingUnidirectionalStream", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__streamId = IPC::ReadParam((&(reader__))); if (!maybe__streamId) { FatalError("Error deserializing 'uint64_t'"); return MsgValueError; } auto& streamId = *maybe__streamId; // Sentinel = 'streamId' if ((!(((&(reader__)))->ReadSentinel(254935866)))) { mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'"); return MsgValueError; } auto maybe__receive = IPC::ReadParam>((&(reader__))); if (!maybe__receive) { FatalError("Error deserializing 'DataPipeReceiver'"); return MsgValueError; } auto& receive = *maybe__receive; // Sentinel = 'receive' if ((!(((&(reader__)))->ReadSentinel(194118372)))) { mozilla::ipc::SentinelReadError("Error deserializing 'DataPipeReceiver'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::WebTransportChild*>(this))->RecvIncomingUnidirectionalStream(std::move(streamId), receive); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PWebTransport::Msg_IncomingBidirectionalStream__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebTransport::Msg_IncomingBidirectionalStream", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__streamId = IPC::ReadParam((&(reader__))); if (!maybe__streamId) { FatalError("Error deserializing 'uint64_t'"); return MsgValueError; } auto& streamId = *maybe__streamId; // Sentinel = 'streamId' if ((!(((&(reader__)))->ReadSentinel(254935866)))) { mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'"); return MsgValueError; } auto maybe__receive = IPC::ReadParam>((&(reader__))); if (!maybe__receive) { FatalError("Error deserializing 'DataPipeReceiver'"); return MsgValueError; } auto& receive = *maybe__receive; // Sentinel = 'receive' if ((!(((&(reader__)))->ReadSentinel(194118372)))) { mozilla::ipc::SentinelReadError("Error deserializing 'DataPipeReceiver'"); return MsgValueError; } auto maybe__send = IPC::ReadParam>((&(reader__))); if (!maybe__send) { FatalError("Error deserializing 'DataPipeSender'"); return MsgValueError; } auto& send = *maybe__send; // Sentinel = 'send' if ((!(((&(reader__)))->ReadSentinel(71238059)))) { mozilla::ipc::SentinelReadError("Error deserializing 'DataPipeSender'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::WebTransportChild*>(this))->RecvIncomingBidirectionalStream(std::move(streamId), receive, send); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PWebTransport::Msg_IncomingDatagram__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebTransport::Msg_IncomingDatagram", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__data = IPC::ReadParam>((&(reader__))); if (!maybe__data) { FatalError("Error deserializing 'uint8_t[]'"); return MsgValueError; } auto& data = *maybe__data; // Sentinel = 'data' if ((!(((&(reader__)))->ReadSentinel(67109275)))) { mozilla::ipc::SentinelReadError("Error deserializing 'uint8_t[]'"); return MsgValueError; } auto maybe__receivedTime = IPC::ReadParam((&(reader__))); if (!maybe__receivedTime) { FatalError("Error deserializing 'TimeStamp'"); return MsgValueError; } auto& receivedTime = *maybe__receivedTime; // Sentinel = 'receivedTime' if ((!(((&(reader__)))->ReadSentinel(532939991)))) { mozilla::ipc::SentinelReadError("Error deserializing 'TimeStamp'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::WebTransportChild*>(this))->RecvIncomingDatagram(std::move(data), std::move(receivedTime)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PWebTransport::Msg_NegotiatedProtocol__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebTransport::Msg_NegotiatedProtocol", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__subprotocol = IPC::ReadParam((&(reader__))); if (!maybe__subprotocol) { FatalError("Error deserializing 'nsCString'"); return MsgValueError; } auto& subprotocol = *maybe__subprotocol; // Sentinel = 'subprotocol' if ((!(((&(reader__)))->ReadSentinel(480969917)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::WebTransportChild*>(this))->RecvNegotiatedProtocol(std::move(subprotocol)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PWebTransport::Msg_Draining__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebTransport::Msg_Draining", OTHER); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::WebTransportChild*>(this))->RecvDraining(); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PWebTransport::Msg_RemoteClosed__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebTransport::Msg_RemoteClosed", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__cleanly = IPC::ReadParam((&(reader__))); if (!maybe__cleanly) { FatalError("Error deserializing 'bool'"); return MsgValueError; } auto& cleanly = *maybe__cleanly; // Sentinel = 'cleanly' if ((!(((&(reader__)))->ReadSentinel(190579433)))) { mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); return MsgValueError; } auto maybe__code = IPC::ReadParam((&(reader__))); if (!maybe__code) { FatalError("Error deserializing 'uint32_t'"); return MsgValueError; } auto& code = *maybe__code; // Sentinel = 'code' if ((!(((&(reader__)))->ReadSentinel(67764636)))) { mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); return MsgValueError; } auto maybe__reason = IPC::ReadParam((&(reader__))); if (!maybe__reason) { FatalError("Error deserializing 'nsCString'"); return MsgValueError; } auto& reason = *maybe__reason; // Sentinel = 'reason' if ((!(((&(reader__)))->ReadSentinel(148112009)))) { mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'"); return MsgValueError; } auto maybe__stats = IPC::ReadParam>((&(reader__))); if (!maybe__stats) { FatalError("Error deserializing 'WebTransportStatsData?'"); return MsgValueError; } auto& stats = *maybe__stats; // Sentinel = 'stats' if ((!(((&(reader__)))->ReadSentinel(110232112)))) { mozilla::ipc::SentinelReadError("Error deserializing 'WebTransportStatsData?'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::WebTransportChild*>(this))->RecvRemoteClosed(std::move(cleanly), std::move(code), std::move(reason), std::move(stats)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PWebTransport::Msg_OnStreamResetOrStopSending__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebTransport::Msg_OnStreamResetOrStopSending", OTHER); IPC::MessageReader reader__{ msg__, this}; auto maybe__streamId = IPC::ReadParam((&(reader__))); if (!maybe__streamId) { FatalError("Error deserializing 'uint64_t'"); return MsgValueError; } auto& streamId = *maybe__streamId; // Sentinel = 'streamId' if ((!(((&(reader__)))->ReadSentinel(254935866)))) { mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'"); return MsgValueError; } auto maybe__error = IPC::ReadParam((&(reader__))); if (!maybe__error) { FatalError("Error deserializing 'StreamResetOrStopSendingError'"); return MsgValueError; } auto& error = *maybe__error; // Sentinel = 'error' if ((!(((&(reader__)))->ReadSentinel(107741739)))) { mozilla::ipc::SentinelReadError("Error deserializing 'StreamResetOrStopSendingError'"); return MsgValueError; } reader__.EndRead(); mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::WebTransportChild*>(this))->RecvOnStreamResetOrStopSending(std::move(streamId), std::move(error)); if ((!(__ok))) { mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); // Error handled in mozilla::ipc::IPCResult return MsgProcessingError; } return MsgProcessed; } case PWebTransport::Msg_CloseAll__ID: { if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", this->ToplevelProtocol()->OtherPidMaybeInvalid(), "Received ", (&(msg__))->type(), mozilla::ipc::MessageDirection::eReceiving); } AUTO_PROFILER_LABEL("PWebTransport::Msg_CloseAll", OTHER); mozilla::ipc::ActorId id__ = MSG_ROUTING_CONTROL; UniquePtr reply__(PWebTransport::Reply_CloseAll(id__)); reply__->set_seqno(msg__.seqno()); RefPtr resolver__ = new mozilla::ipc::IPDLResolverInner(std::move(reply__), this); CloseAllResolver resolver = [resolver__ = std::move(resolver__)](const nsresult& aParam) { resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) { IPC::MessageWriter writer__(*reply__, self__); IPC::WriteParam((&(writer__)), aParam); // Sentinel = 'rv' ((&(writer__)))->WriteSentinel(22806761); if (mozilla::ipc::LoggingEnabledFor("PWebTransport", mozilla::ipc::ChildSide)) { mozilla::ipc::LogMessageForProtocol( "PWebTransportChild", self__->ToplevelProtocol()->OtherPidMaybeInvalid(), "Sending reply ", reply__->type(), mozilla::ipc::MessageDirection::eSending); } }); }; mozilla::ipc::IPCResult __ok = (static_cast<::mozilla::dom::WebTransportChild*>(this))->RecvCloseAll(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; 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 PWebTransportChild::OnMessageReceived( const Message& msg__, UniquePtr& reply__) -> PWebTransportChild::Result { if (!CanSend()) { return MsgDropped; } MOZ_ASSERT_UNREACHABLE("message protocol not supported"); return MsgNotKnown; } } // namespace dom } // namespace mozilla