#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/platform/image-decoders/rw_buffer.h"
#include "base/atomic_ref_count.h"
#include "base/check.h"
#include "base/check_op.h"
#include "base/memory/raw_ptr.h"
#include "third_party/blink/renderer/platform/wtf/allocator/partitions.h"
#include <algorithm>
#include <atomic>
#include <new>
namespace blink {
namespace {
static const size_t kMinAllocSize = …;
}
struct RWBuffer::BufferBlock { … };
struct RWBuffer::BufferHead { … };
size_t RWBuffer::ROIter::size() const { … }
RWBuffer::ROIter::ROIter(RWBuffer* rw_buffer, size_t available)
: … { … }
const void* RWBuffer::ROIter::data() const { … }
bool RWBuffer::ROIter::Next() { … }
bool RWBuffer::ROIter::HasNext() const { … }
ROBuffer::ROBuffer(const RWBuffer::BufferHead* head,
size_t available,
const RWBuffer::BufferBlock* tail)
: … { … }
ROBuffer::~ROBuffer() { … }
ROBuffer::Iter::Iter(const ROBuffer* buffer) { … }
ROBuffer::Iter::Iter(const scoped_refptr<ROBuffer>& buffer) { … }
void ROBuffer::Iter::Reset(const ROBuffer* buffer) { … }
const void* ROBuffer::Iter::data() const { … }
size_t ROBuffer::Iter::size() const { … }
bool ROBuffer::Iter::Next() { … }
RWBuffer::RWBuffer(size_t initial_capacity) { … }
RWBuffer::RWBuffer(base::OnceCallback<size_t(void*, size_t)> writer,
size_t initial_capacity) { … }
RWBuffer::~RWBuffer() { … }
void RWBuffer::Append(const void* src, size_t length, size_t reserve) { … }
scoped_refptr<ROBuffer> RWBuffer::MakeROBufferSnapshot() const { … }
bool RWBuffer::HasNoSnapshots() const { … }
void RWBuffer::Validate() const { … }
}