Copy as Markdown

Other Tools

//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/dom/PWindowsLocationParent.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/dom/WindowsLocationParent.h"
#include "nsGeoPositionIPCSerialiser.h"
#include "mozilla/dom/PWindowsUtilsParent.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 PWindowsLocationParent::PWindowsLocationParent() :
mozilla::ipc::IRefCountedProtocol(PWindowsLocationMsgStart, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PWindowsLocationParent);
}
PWindowsLocationParent::~PWindowsLocationParent()
{
MOZ_COUNT_DTOR(PWindowsLocationParent);
}
auto PWindowsLocationParent::ActorAlloc() -> void
{
AddRef();
}
auto PWindowsLocationParent::ActorDealloc() -> void
{
Release();
}
auto PWindowsLocationParent::Manager() const -> PWindowsUtilsParent*
{
return static_cast<PWindowsUtilsParent*>(IProtocol::Manager());
}
auto PWindowsLocationParent::AllManagedActorsCount() const -> uint32_t
{
uint32_t total = 0;
return total;
}
auto PWindowsLocationParent::SendStartup() -> bool
{
UniquePtr<IPC::Message> msg__ = PWindowsLocation::Msg_Startup(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PWindowsLocation", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWindowsLocationParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWindowsLocation::Msg_Startup", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWindowsLocationParent::SendRegisterForReport() -> bool
{
UniquePtr<IPC::Message> msg__ = PWindowsLocation::Msg_RegisterForReport(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PWindowsLocation", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWindowsLocationParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWindowsLocation::Msg_RegisterForReport", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWindowsLocationParent::SendUnregisterForReport() -> bool
{
UniquePtr<IPC::Message> msg__ = PWindowsLocation::Msg_UnregisterForReport(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
if (mozilla::ipc::LoggingEnabledFor("PWindowsLocation", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWindowsLocationParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWindowsLocation::Msg_UnregisterForReport", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWindowsLocationParent::SendSetHighAccuracy(const bool& aEnable) -> bool
{
UniquePtr<IPC::Message> msg__ = PWindowsLocation::Msg_SetHighAccuracy(Id());
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aEnable);
// Sentinel = 'aEnable'
((&(writer__)))->WriteSentinel(173605545);
if (mozilla::ipc::LoggingEnabledFor("PWindowsLocation", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWindowsLocationParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWindowsLocation::Msg_SetHighAccuracy", OTHER);
bool sendok__ = ChannelSend(std::move(msg__));
return sendok__;
}
auto PWindowsLocationParent::Send__delete__(PWindowsLocationParent* actor) -> bool
{
if (!actor || !actor->CanSend()) {
NS_WARNING("Attempt to __delete__ missing or closed actor");
return false;
}
UniquePtr<IPC::Message> msg__ = PWindowsLocation::Msg___delete__((actor)->Id());
IPC::MessageWriter writer__{
(*(msg__)),
actor};
if (mozilla::ipc::LoggingEnabledFor("PWindowsLocation", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWindowsLocationParent",
actor->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PWindowsLocation::Msg___delete__", OTHER);
bool sendok__ = (actor)->ChannelSend(std::move(msg__));
actor->ActorDisconnected(Deletion);
return sendok__;
}
auto PWindowsLocationParent::RemoveManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PWindowsLocationParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PWindowsLocationParent::OnMessageReceived(const Message& msg__) -> PWindowsLocationParent::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 PWindowsLocation::Reply___delete____ID:
{
return MsgProcessed;
}
case PWindowsLocation::Msg_Update__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWindowsLocation", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWindowsLocationParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWindowsLocation::Msg_Update", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aPosition = IPC::ReadParam<RefPtr<nsIDOMGeoPosition>>((&(reader__)));
if (!maybe__aPosition) {
FatalError("Error deserializing 'nsIDOMGeoPosition'");
return MsgValueError;
}
auto& aPosition = *maybe__aPosition;
// Sentinel = 'aPosition'
if ((!(((&(reader__)))->ReadSentinel(303104951)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsIDOMGeoPosition'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WindowsLocationParent*>(this))->RecvUpdate(aPosition);
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
case PWindowsLocation::Msg_Failed__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PWindowsLocation", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PWindowsLocationParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PWindowsLocation::Msg_Failed", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aError = IPC::ReadParam<uint16_t>((&(reader__)));
if (!maybe__aError) {
FatalError("Error deserializing 'uint16_t'");
return MsgValueError;
}
auto& aError = *maybe__aError;
// Sentinel = 'aError'
if ((!(((&(reader__)))->ReadSentinel(135463532)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint16_t'");
return MsgValueError;
}
reader__.EndRead();
mozilla::ipc::IPCResult __ok = (static_cast<WindowsLocationParent*>(this))->RecvFailed(std::move(aError));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
auto PWindowsLocationParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PWindowsLocationParent::Result
{
MOZ_ASSERT_UNREACHABLE("message protocol not supported");
return MsgNotKnown;
}
auto PWindowsLocationParent::DoomSubtree() -> void
{
SetDoomed();
}
auto PWindowsLocationParent::PeekManagedActor() -> IProtocol*
{
return nullptr;
}
} // namespace dom
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::dom::PWindowsLocationParent*>::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::PWindowsLocationParent*>::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, "PWindowsLocation", PWindowsLocationMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::dom::PWindowsLocationParent*>(actor.ref());
}
return {};
}
} // namespace IPC