Copy as Markdown
Other Tools
//
// Automatically generated by ipdlc.
// Edit at your own risk
//
#include "mozilla/PClipboardContentAnalysisChild.h"
#include "mozilla/ClipboardContentAnalysisChild.h"
#include "mozilla/GfxMessageUtils.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/ProfilerMarkers.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 PClipboardContentAnalysisChild::ProcessingError(
Result aCode,
const char* aReason) -> void
{
}
auto PClipboardContentAnalysisChild::ShouldContinueFromReplyTimeout() -> bool
{
return true;
}
MOZ_IMPLICIT PClipboardContentAnalysisChild::PClipboardContentAnalysisChild() :
mozilla::ipc::IToplevelProtocol("PClipboardContentAnalysisChild", kProtocolId, mozilla::ipc::ChildSide)
{
MOZ_COUNT_CTOR(PClipboardContentAnalysisChild);
}
PClipboardContentAnalysisChild::~PClipboardContentAnalysisChild()
{
MOZ_COUNT_DTOR(PClipboardContentAnalysisChild);
}
auto PClipboardContentAnalysisChild::ActorAlloc() -> void
{
MOZ_RELEASE_ASSERT(XRE_IsContentProcess(), "Invalid process for `PClipboardContentAnalysisChild'");
AddRef();
}
auto PClipboardContentAnalysisChild::ActorDealloc() -> void
{
Release();
}
auto PClipboardContentAnalysisChild::ManagedProtocolIds() const -> mozilla::Span<mozilla::ipc::ProtocolId const>
{
return {};
}
auto PClipboardContentAnalysisChild::GetManagedActors(mozilla::ipc::ProtocolId aProtocol) -> UntypedManagedContainer*
{
switch (aProtocol) {
default:
return nullptr;
}
}
auto PClipboardContentAnalysisChild::SendGetClipboard(
mozilla::Span<nsCString const> aTypes,
const ClipboardType& aWhichClipboard,
const uint64_t& aRequestingWindowContextId,
IPCTransferableDataOrError* transferableDataOrError) -> bool
{
UniquePtr<IPC::Message> msg__ = PClipboardContentAnalysis::Msg_GetClipboard(MSG_ROUTING_CONTROL);
IPC::MessageWriter writer__{
(*(msg__)),
this};
IPC::WriteParam((&(writer__)), aTypes);
// Sentinel = 'aTypes'
((&(writer__)))->WriteSentinel(140575351);
IPC::WriteParam((&(writer__)), aWhichClipboard);
// Sentinel = 'aWhichClipboard'
((&(writer__)))->WriteSentinel(776996325);
IPC::WriteParam((&(writer__)), aRequestingWindowContextId);
// Sentinel = 'aRequestingWindowContextId'
((&(writer__)))->WriteSentinel(2397309587);
UniquePtr<Message> reply__;
if (mozilla::ipc::LoggingEnabledFor("PClipboardContentAnalysis", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PClipboardContentAnalysisChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Sending ",
msg__->type(),
mozilla::ipc::MessageDirection::eSending);
}
AUTO_PROFILER_LABEL("PClipboardContentAnalysis::Msg_GetClipboard", OTHER);
bool sendok__ = false;
{
AUTO_PROFILER_TRACING_MARKER("Sync IPC", "PClipboardContentAnalysis::Msg_GetClipboard", IPC);
sendok__ = ChannelSend(std::move(msg__), (&(reply__)));
}
if ((!(sendok__))) {
return false;
}
if (mozilla::ipc::LoggingEnabledFor("PClipboardContentAnalysis", mozilla::ipc::ChildSide)) {
mozilla::ipc::LogMessageForProtocol(
"PClipboardContentAnalysisChild",
this->ToplevelProtocol()->OtherPidMaybeInvalid(),
"Received reply ",
reply__->type(),
mozilla::ipc::MessageDirection::eReceiving);
}
IPC::MessageReader reader__{
(*(reply__)),
this};
auto maybe__transferableDataOrError__reply = IPC::ReadParam<IPCTransferableDataOrError>((&(reader__)));
if (!maybe__transferableDataOrError__reply) {
FatalError("Error deserializing 'IPCTransferableDataOrError'");
return false;
}
auto& transferableDataOrError__reply = *maybe__transferableDataOrError__reply;
// Sentinel = 'transferableDataOrError'
if ((!(((&(reader__)))->ReadSentinel(1880557887)))) {
mozilla::ipc::SentinelReadError("Error deserializing 'IPCTransferableDataOrError'");
return false;
}
(*(transferableDataOrError)) = std::move(transferableDataOrError__reply);
reader__.EndRead();
return true;
}
auto PClipboardContentAnalysisChild::DeallocManagee(
int32_t aProtocolId,
IProtocol* aListener) -> void
{
FatalError("unreached");
return;
}
auto PClipboardContentAnalysisChild::OnMessageReceived(const Message& msg__) -> PClipboardContentAnalysisChild::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 PClipboardContentAnalysisChild::OnMessageReceived(
const Message& msg__,
UniquePtr<Message>& reply__) -> PClipboardContentAnalysisChild::Result
{
return MsgNotKnown;
}
} // namespace mozilla
namespace IPC {
auto ParamTraits<::mozilla::PClipboardContentAnalysisChild*>::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::PClipboardContentAnalysisChild*>::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::PClipboardContentAnalysisChild*>(actor.ref());
}
return {};
}
} // namespace IPC