#include "quiche/quic/core/quic_stream_sequencer_buffer.h"
#include <algorithm>
#include <cstddef>
#include <memory>
#include <string>
#include <utility>
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "quiche/quic/core/quic_constants.h"
#include "quiche/quic/core/quic_interval.h"
#include "quiche/quic/platform/api/quic_bug_tracker.h"
#include "quiche/quic/platform/api/quic_flag_utils.h"
#include "quiche/quic/platform/api/quic_flags.h"
#include "quiche/quic/platform/api/quic_logging.h"
namespace quic {
namespace {
size_t CalculateBlockCount(size_t max_capacity_bytes) { … }
const size_t kMaxNumDataIntervalsAllowed = …;
constexpr size_t kInitialBlockCount = …;
constexpr int kBlocksGrowthFactor = …;
}
QuicStreamSequencerBuffer::QuicStreamSequencerBuffer(size_t max_capacity_bytes)
: … { … }
QuicStreamSequencerBuffer::~QuicStreamSequencerBuffer() { … }
void QuicStreamSequencerBuffer::Clear() { … }
bool QuicStreamSequencerBuffer::RetireBlock(size_t index) { … }
void QuicStreamSequencerBuffer::MaybeAddMoreBlocks(
QuicStreamOffset next_expected_byte) { … }
QuicErrorCode QuicStreamSequencerBuffer::OnStreamData(
QuicStreamOffset starting_offset, absl::string_view data,
size_t* const bytes_buffered, std::string* error_details) { … }
bool QuicStreamSequencerBuffer::CopyStreamData(QuicStreamOffset offset,
absl::string_view data,
size_t* bytes_copy,
std::string* error_details) { … }
QuicErrorCode QuicStreamSequencerBuffer::Readv(const iovec* dest_iov,
size_t dest_count,
size_t* bytes_read,
std::string* error_details) { … }
int QuicStreamSequencerBuffer::GetReadableRegions(struct iovec* iov,
int iov_len) const { … }
bool QuicStreamSequencerBuffer::GetReadableRegion(iovec* iov) const { … }
bool QuicStreamSequencerBuffer::PeekRegion(QuicStreamOffset offset,
iovec* iov) const { … }
bool QuicStreamSequencerBuffer::MarkConsumed(size_t bytes_consumed) { … }
size_t QuicStreamSequencerBuffer::FlushBufferedFrames() { … }
void QuicStreamSequencerBuffer::ReleaseWholeBuffer() { … }
size_t QuicStreamSequencerBuffer::ReadableBytes() const { … }
bool QuicStreamSequencerBuffer::HasBytesToRead() const { … }
QuicStreamOffset QuicStreamSequencerBuffer::BytesConsumed() const { … }
size_t QuicStreamSequencerBuffer::BytesBuffered() const { … }
size_t QuicStreamSequencerBuffer::GetBlockIndex(QuicStreamOffset offset) const { … }
size_t QuicStreamSequencerBuffer::GetInBlockOffset(
QuicStreamOffset offset) const { … }
size_t QuicStreamSequencerBuffer::ReadOffset() const { … }
size_t QuicStreamSequencerBuffer::NextBlockToRead() const { … }
bool QuicStreamSequencerBuffer::RetireBlockIfEmpty(size_t block_index) { … }
bool QuicStreamSequencerBuffer::Empty() const { … }
size_t QuicStreamSequencerBuffer::GetBlockCapacity(size_t block_index) const { … }
std::string QuicStreamSequencerBuffer::ReceivedFramesDebugString() const { … }
QuicStreamOffset QuicStreamSequencerBuffer::FirstMissingByte() const { … }
QuicStreamOffset QuicStreamSequencerBuffer::NextExpectedByte() const { … }
}