Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/PClipboardContentAnalysisParent.h"
#include "mozilla/ClipboardContentAnalysisParent.h"
#include "mozilla/GfxMessageUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/dom/PermissionMessageUtils.h"
#include "mozilla/ipc/BigBuffer.h"
#include "mozilla/widget/WidgetMessageUtils.h"
#include "nsIPrincipal.h"
#include "nsIReferrerInfo.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 {
auto PClipboardContentAnalysisParent::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PClipboardContentAnalysisParent::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PClipboardContentAnalysisParent::PClipboardContentAnalysisParent() :
mozilla::ipc::IToplevelProtocol("PClipboardContentAnalysisParent", kProtocolId, mozilla::ipc::ParentSide)
{
MOZ_COUNT_CTOR(PClipboardContentAnalysisParent);
}
PClipboardContentAnalysisParent::~PClipboardContentAnalysisParent()
{
MOZ_COUNT_DTOR(PClipboardContentAnalysisParent);
}
auto PClipboardContentAnalysisParent::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsParentProcess(), "Invalid process for `PClipboardContentAnalysisParent'");
AddRef();
}
auto PClipboardContentAnalysisParent::ActorDealloc() -> void
{
Release();
}
auto PClipboardContentAnalysisParent::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PClipboardContentAnalysisParent::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PClipboardContentAnalysisParent::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PClipboardContentAnalysisParent::OnMessageReceived(const Message& msg__) -> PClipboardContentAnalysisParent::Result
{
switch (msg__.type()) {
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 PClipboardContentAnalysisParent::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PClipboardContentAnalysisParent::Result
{
switch (msg__.type()) {
case PClipboardContentAnalysis::Msg_GetClipboard__ID:
{
if (mozilla::ipc::LoggingEnabledFor("PClipboardContentAnalysis", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PClipboardContentAnalysisParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received ",
(&(msg__))->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
AUTO_PROFILER_LABEL("PClipboardContentAnalysis::Msg_GetClipboard", OTHER);
IPC::MessageReader reader__{
msg__,
this};
auto maybe__aTypes = IPC::ReadParam<nsTArray<nsCString>>((&(reader__)));
if (!maybe__aTypes) {
FatalError("Error deserializing 'nsCString[]'");
return MsgValueError;
}
auto& aTypes = *maybe__aTypes;
// Sentinel = 'aTypes'
if ((!(((&(reader__)))->ReadSentinel(140575351)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'nsCString[]'");
return MsgValueError;
}
auto maybe__aWhichClipboard = IPC::ReadParam<ClipboardType>((&(reader__)));
if (!maybe__aWhichClipboard) {
FatalError("Error deserializing 'ClipboardType'");
return MsgValueError;
}
auto& aWhichClipboard = *maybe__aWhichClipboard;
// Sentinel = 'aWhichClipboard'
if ((!(((&(reader__)))->ReadSentinel(776996325)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'ClipboardType'");
return MsgValueError;
}
auto maybe__aRequestingWindowContextId = IPC::ReadParam<uint64_t>((&(reader__)));
if (!maybe__aRequestingWindowContextId) {
FatalError("Error deserializing 'uint64_t'");
return MsgValueError;
}
auto& aRequestingWindowContextId = *maybe__aRequestingWindowContextId;
// Sentinel = 'aRequestingWindowContextId'
if ((!(((&(reader__)))->ReadSentinel(2397309587)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
return MsgValueError;
}
reader__.EndRead();
int32_t id__ = MSG_ROUTING_CONTROL;
IPCTransferableDataOrError transferableDataOrError{};
mozilla::ipc::IPCResult __ok = (static_cast<ClipboardContentAnalysisParent*>(this))->RecvGetClipboard(std::move(aTypes), std::move(aWhichClipboard), std::move(aRequestingWindowContextId), (&(transferableDataOrError)));
if ((!(__ok))) {
mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
// Error handled in mozilla::ipc::IPCResult
return MsgProcessingError;
}
reply__ = PClipboardContentAnalysis::Reply_GetClipboard(id__);
IPC::MessageWriter writer__{
(*(reply__)),
this};
IPC::WriteParam((&(writer__)), std::move(transferableDataOrError));
// Sentinel = 'transferableDataOrError'
((&(writer__)))->WriteSentinel(1880557887);
if (mozilla::ipc::LoggingEnabledFor("PClipboardContentAnalysis", mozilla::ipc::ParentSide)) {
mozilla::ipc::LogMessageForProtocol(
"PClipboardContentAnalysisParent",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eSending);
}
return MsgProcessed;
}
default:
return MsgNotKnown;
}
}
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::PClipboardContentAnalysisParent*>::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::PClipboardContentAnalysisParent*>::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, "PClipboardContentAnalysis", PClipboardContentAnalysisMsgStart);
if (actor.isSome()) {
return static_cast<::mozilla::PClipboardContentAnalysisParent*>(actor.ref());
}
return {};
}
} // namespace IPC