//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/PSerialManagerParent.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/dom/SerialManagerParent.h"
#include "mozilla/dom/SerialPortIPCTypes.h"
#include "mozilla/dom/PWindowGlobalParent.h"
#include "mozilla/dom/PSerialPortParent.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 PSerialManagerParent::PSerialManagerParent() :
mozilla::ipc::IRefCountedProtocol(kProtocolId, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PSerialManagerParent);
}
PSerialManagerParent::~PSerialManagerParent()
{
MOZ_COUNT_DTOR(PSerialManagerParent);
}
auto PSerialManagerParent::ActorAlloc() -> void
{
AddRef();
}
auto PSerialManagerParent::ActorDealloc() -> void
{
Release();
}
auto PSerialManagerParent::Manager() const -> PWindowGlobalParent*
{
return static_cast<PWindowGlobalParent*>(IProtocol::Manager());
}
auto PSerialManagerParent::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PSerialManagerParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PSerialManagerParent::RejectPendingResponses(ResponseRejectReason aReason) -> void
{
mAsyncCallbacks.RejectPendingResponses(aReason);
}
auto PSerialManagerParent::Send__delete__(PSerialManagerParent* actor) -> bool
{
if (!actor || !actor->CanSend()) {
NS_WARNING("Attempt to __delete__ missing or closed actor");
return false;
}
UniquePtr<IPC::Message> msg__ = PSerialManager::Msg___delete__((actor)->Id());
IPC::MessageWriter writer__{
(*(msg__)),
actor};
if (mozilla::ipc::LoggingEnabledFor("PSerialManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSerialManagerParent",
actor->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PSerialManager::Msg___delete__", OTHER);
bool sendok__ = (actor)->ChannelSend(std::move(msg__));
actor->ActorDisconnected(Deletion);
return sendok__;
}
auto PSerialManagerParent::DeallocManagee(
mozilla::ipc::ProtocolId aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PSerialManagerParent::OnMessageReceived(const Message& msg__) -> PSerialManagerParent::Result
{
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 PSerialManager::Msg_GetAvailablePorts__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSerialManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSerialManagerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSerialManager::Msg_GetAvailablePorts", OTHER);
mozilla::ipc::ActorId id__ = Id();
UniquePtr<IPC::Message> reply__(PSerialManager::Reply_GetAvailablePorts(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
GetAvailablePortsResolver resolver = [resolver__ = std::move(resolver__)](mozilla::Span<IPCSerialPortInfo const> aParam) {
resolver__->Resolve([&] (IPC::Message* reply__, IProtocol* self__) {
IPC::MessageWriter writer__(*reply__, self__);
IPC::WriteParam((&(writer__)), aParam);
// Sentinel = 'ports'
((&(writer__)))->WriteSentinel(111280697);
if (mozilla::ipc::LoggingEnabledFor("PSerialManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSerialManagerParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (static_cast<SerialManagerParent*>(this))->RecvGetAvailablePorts(std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PSerialManager::Msg_CreatePort__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSerialManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSerialManagerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSerialManager::Msg_CreatePort", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__portId = IPC::ReadParam<nsString>((&(reader__)));
if (!maybe__portId) {
FatalError("Error deserializing 'nsString'");
return MsgValueError;
}
auto& portId = *maybe__portId;
// Sentinel = 'portId'
if ((!(((&(reader__)))->ReadSentinel(149619315)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
return MsgValueError;
}
auto maybe__parentEndpoint = IPC::ReadParam<Endpoint<::mozilla::dom::PSerialPortParent>>((&(reader__)));
if (!maybe__parentEndpoint) {
FatalError("Error deserializing 'Endpoint<::mozilla::dom::PSerialPortParent>'");
return MsgValueError;
}
auto& parentEndpoint = *maybe__parentEndpoint;
// Sentinel = 'parentEndpoint'
if ((!(((&(reader__)))->ReadSentinel(723715532)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'Endpoint<::mozilla::dom::PSerialPortParent>'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<SerialManagerParent*>(this))->RecvCreatePort(std::move(portId), std::move(parentEndpoint));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PSerialManager::Msg_SimulateDeviceConnection__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSerialManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSerialManagerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSerialManager::Msg_SimulateDeviceConnection", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__deviceId = IPC::ReadParam<nsString>((&(reader__)));
if (!maybe__deviceId) {
FatalError("Error deserializing 'nsString'");
return MsgValueError;
}
auto& deviceId = *maybe__deviceId;
// Sentinel = 'deviceId'
if ((!(((&(reader__)))->ReadSentinel(242025246)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
return MsgValueError;
}
auto maybe__devicePath = IPC::ReadParam<nsString>((&(reader__)));
if (!maybe__devicePath) {
FatalError("Error deserializing 'nsString'");
return MsgValueError;
}
auto& devicePath = *maybe__devicePath;
// Sentinel = 'devicePath'
if ((!(((&(reader__)))->ReadSentinel(369886206)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
return MsgValueError;
}
auto maybe__vendorId = IPC::ReadParam<uint16_t>((&(reader__)));
if (!maybe__vendorId) {
FatalError("Error deserializing 'uint16_t'");
return MsgValueError;
}
auto& vendorId = *maybe__vendorId;
// Sentinel = 'vendorId'
if ((!(((&(reader__)))->ReadSentinel(252379964)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint16_t'");
return MsgValueError;
}
auto maybe__productId = IPC::ReadParam<uint16_t>((&(reader__)));
if (!maybe__productId) {
FatalError("Error deserializing 'uint16_t'");
return MsgValueError;
}
auto& productId = *maybe__productId;
// Sentinel = 'productId'
if ((!(((&(reader__)))->ReadSentinel(319882159)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint16_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::ActorId id__ = Id();
UniquePtr<IPC::Message> reply__(PSerialManager::Reply_SimulateDeviceConnection(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
SimulateDeviceConnectionResolver 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("PSerialManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSerialManagerParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (static_cast<SerialManagerParent*>(this))->RecvSimulateDeviceConnection(std::move(deviceId), std::move(devicePath), std::move(vendorId), std::move(productId), std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PSerialManager::Msg_SimulateDeviceDisconnection__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSerialManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSerialManagerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSerialManager::Msg_SimulateDeviceDisconnection", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__deviceId = IPC::ReadParam<nsString>((&(reader__)));
if (!maybe__deviceId) {
FatalError("Error deserializing 'nsString'");
return MsgValueError;
}
auto& deviceId = *maybe__deviceId;
// Sentinel = 'deviceId'
if ((!(((&(reader__)))->ReadSentinel(242025246)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::ActorId id__ = Id();
UniquePtr<IPC::Message> reply__(PSerialManager::Reply_SimulateDeviceDisconnection(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
SimulateDeviceDisconnectionResolver 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("PSerialManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSerialManagerParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (static_cast<SerialManagerParent*>(this))->RecvSimulateDeviceDisconnection(std::move(deviceId), std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PSerialManager::Msg_RemoveAllMockDevices__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSerialManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSerialManagerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSerialManager::Msg_RemoveAllMockDevices", OTHER);
mozilla::ipc::ActorId id__ = Id();
UniquePtr<IPC::Message> reply__(PSerialManager::Reply_RemoveAllMockDevices(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
RemoveAllMockDevicesResolver 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("PSerialManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSerialManagerParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (static_cast<SerialManagerParent*>(this))->RecvRemoveAllMockDevices(std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PSerialManager::Msg_ResetToDefaultMockDevices__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PSerialManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSerialManagerParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PSerialManager::Msg_ResetToDefaultMockDevices", OTHER);
mozilla::ipc::ActorId id__ = Id();
UniquePtr<IPC::Message> reply__(PSerialManager::Reply_ResetToDefaultMockDevices(id__));
reply__->set_seqno(msg__.seqno());
RefPtr<mozilla::ipc::IPDLResolverInner> resolver__ =
new mozilla::ipc::IPDLResolverInner(std::move(reply__), this);
ResetToDefaultMockDevicesResolver 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("PSerialManager", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PSerialManagerParent",
self__->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
});
};
mozilla::ipc::IPCResult __ok = (static_cast<SerialManagerParent*>(this))->RecvResetToDefaultMockDevices(std::move(resolver));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PSerialManager::Reply___delete____ID:
{
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PSerialManagerParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PSerialManagerParent::Result
{
return MsgNotKnown;
}
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::PSerialManagerParent*>::Write(
IPC::MessageWriter* aWriter,
const paramType& aVar) -> void
{
IPC::WriteParam(aWriter, static_cast<mozilla::ipc::IProtocol*>(aVar));
// Sentinel = 'PSerialManager'
(aWriter)->WriteSentinel(665191788);
}
auto ParamTraits<::mozilla::dom::PSerialManagerParent*>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
auto maybe__actor = IPC::ReadParam<mozilla::ipc::IProtocol*>(aReader);
if (!maybe__actor) {
aReader->FatalError("Error deserializing managed PSerialManager actor");
return {};
}
auto& actor = *maybe__actor;
// Sentinel = 'PSerialManager'
if ((!((aReader)->ReadSentinel(665191788)))) {
mozilla::ipc::SentinelReadError("Error deserializing managed PSerialManager actor");
return {};
}
if (actor && actor->GetProtocolId() != PSerialManagerMsgStart) {
aReader->FatalError("Unexpected actor type (expected PSerialManager)");
return {};
}
return static_cast<::mozilla::dom::PSerialManagerParent*>(actor);
}
} // namespace IPC