#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "ui/gfx/x/xproto_types.h"
#include <xcb/xcbext.h>
#include "base/memory/scoped_refptr.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/xproto_internal.h"
namespace x11 {
namespace {
constexpr uint8_t kResponseTypeReply = …;
struct ReplyHeader { … };
}
ThrowAwaySizeRefCountedMemory::ThrowAwaySizeRefCountedMemory(
std::vector<uint8_t> data)
: … { … }
ThrowAwaySizeRefCountedMemory::~ThrowAwaySizeRefCountedMemory() = default;
void* ThrowAwaySizeRefCountedMemory::data() { … }
const void* ThrowAwaySizeRefCountedMemory::data() const { … }
SizedRefCountedMemory::SizedRefCountedMemory(
scoped_refptr<UnsizedRefCountedMemory> mem,
size_t size)
: … { … }
SizedRefCountedMemory::~SizedRefCountedMemory() = default;
base::span<const uint8_t> SizedRefCountedMemory::AsSpan() const { … }
ReadBuffer::ReadBuffer(scoped_refptr<UnsizedRefCountedMemory> data,
bool setup_message)
: … { … }
ReadBuffer::ReadBuffer(ReadBuffer&&) = default;
ReadBuffer::~ReadBuffer() = default;
scoped_refptr<UnsizedRefCountedMemory> ReadBuffer::ReadAndAdvance(
size_t length) { … }
int ReadBuffer::TakeFd() { … }
WriteBuffer::WriteBuffer() = default;
WriteBuffer::WriteBuffer(WriteBuffer&&) = default;
WriteBuffer::~WriteBuffer() = default;
void WriteBuffer::AppendBuffer(scoped_refptr<UnsizedRefCountedMemory> buffer,
size_t size) { … }
void WriteBuffer::AppendSizedBuffer(
scoped_refptr<base::RefCountedMemory> buffer) { … }
base::span<base::span<uint8_t>> WriteBuffer::GetBuffers() { … }
void WriteBuffer::OffsetFirstBuffer(size_t offset) { … }
void WriteBuffer::AppendCurrentBuffer() { … }
}