Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/PWebTransportChild.h"
#include "mozilla/ProfilerLabels.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<mozilla::ipc::ProtocolId const>
{
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) -> bool
{
UniquePtr<IPC::Message> 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);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWebTransportChild::SendCreateUnidirectionalStream(
const mozilla::Maybe<int64_t>& sendOrder,
mozilla::ipc::ResolveCallback<UnidirectionalStreamResponse>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PWebTransport::Msg_CreateUnidirectionalStream(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
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_CreateUnidirectionalStream", OTHER);
int32_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<UnidirectionalStreamResponse>(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 mozilla::Maybe<int64_t>& sendOrder) -> RefPtr<CreateUnidirectionalStreamPromise>
{
RefPtr<MozPromise<UnidirectionalStreamResponse, ResponseRejectReason, true>::Private> promise__ = new MozPromise<UnidirectionalStreamResponse, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendCreateUnidirectionalStream(std::move(sendOrder), [promise__](UnidirectionalStreamResponse&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PWebTransportChild::SendCreateBidirectionalStream(
const mozilla::Maybe<int64_t>& sendOrder,
mozilla::ipc::ResolveCallback<BidirectionalStreamResponse>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> msg__ = PWebTransport::Msg_CreateBidirectionalStream(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
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_CreateBidirectionalStream", OTHER);
int32_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<BidirectionalStreamResponse>(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 mozilla::Maybe<int64_t>& sendOrder) -> RefPtr<CreateBidirectionalStreamPromise>
{
RefPtr<MozPromise<BidirectionalStreamResponse, ResponseRejectReason, true>::Private> promise__ = new MozPromise<BidirectionalStreamResponse, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendCreateBidirectionalStream(std::move(sendOrder), [promise__](BidirectionalStreamResponse&& aValue) {
promise__->Resolve(std::move(aValue), __func__);
}, [promise__](ResponseRejectReason&& aReason) {
promise__->Reject(std::move(aReason), __func__);
});
return promise__;
}
auto PWebTransportChild::SendOutgoingDatagram(
mozilla::Span<uint8_t const> data,
const TimeStamp& expirationTime,
mozilla::ipc::ResolveCallback<nsresult>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> 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);
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);
int32_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<nsresult>(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<uint8_t const> data,
const TimeStamp& expirationTime) -> RefPtr<OutgoingDatagramPromise>
{
RefPtr<MozPromise<nsresult, ResponseRejectReason, true>::Private> promise__ = new MozPromise<nsresult, ResponseRejectReason, true>::Private(__func__);
promise__->UseDirectTaskDispatch(__func__);
SendOutgoingDatagram(std::move(data), std::move(expirationTime), [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<uint64_t>&& aResolve,
mozilla::ipc::RejectCallback&& aReject) -> void
{
UniquePtr<IPC::Message> 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);
int32_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<uint64_t>(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<GetMaxDatagramSizePromise>
{
RefPtr<MozPromise<uint64_t, ResponseRejectReason, true>::Private> promise__ = new MozPromise<uint64_t, ResponseRejectReason, true>::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::SendSetSendOrder(
const uint64_t& streamId,
const mozilla::Maybe<int64_t>& sendOrder) -> bool
{
UniquePtr<IPC::Message> 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::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PWebTransportChild::OnMessageReceived(const Message& msg__) -> PWebTransportChild::Result
{
switch (msg__.type()) {
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::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<uint64_t>((&(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<RefPtr<DataPipeReceiver>>((&(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<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<uint64_t>((&(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<RefPtr<DataPipeReceiver>>((&(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<RefPtr<DataPipeSender>>((&(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<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<nsTArray<uint8_t>>((&(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<TimeStamp>((&(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<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_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<bool>((&(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<uint32_t>((&(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<nsCString>((&(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;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WebTransportChild*>(this))->RecvRemoteClosed(std::move(cleanly), std::move(code), std::move(reason));
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<uint64_t>((&(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<StreamResetOrStopSendingError>((&(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<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);
int32_t id__ = MSG_ROUTING_CONTROL;
UniquePtr<IPC::Message> reply__(PWebTransport::Reply_CloseAll(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> 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<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<Message>& reply__) -> PWebTransportChild::Result
{
MOZ_ASSERT_UNREACHABLE("message protocol not supported");
return MsgNotKnown;
}
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::PWebTransportChild*>::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::dom::PWebTransportChild*>::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, "PWebTransport", PWebTransportMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::dom::PWebTransportChild*>(actor.ref());
}
return {};
}
} // namespace IPC