chromium/net/base/io_buffer.cc

// Copyright 2011 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40284755): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif

#include "net/base/io_buffer.h"

#include <utility>

#include "base/check_op.h"
#include "base/containers/heap_array.h"
#include "base/numerics/safe_math.h"

namespace net {

// TODO(eroman): IOBuffer is being converted to require buffer sizes and offsets
// be specified as "size_t" rather than "int" (crbug.com/488553). To facilitate
// this move (since LOTS of code needs to be updated), this function ensures
// that sizes can be safely converted to an "int" without truncation. The
// assert ensures calling this with an "int" argument is also safe.
void IOBuffer::AssertValidBufferSize(size_t size) {}

IOBuffer::IOBuffer() = default;

IOBuffer::IOBuffer(base::span<char> data)
    :{}

IOBuffer::IOBuffer(base::span<uint8_t> data)
    :{}

IOBuffer::~IOBuffer() = default;

IOBufferWithSize::IOBufferWithSize() = default;

IOBufferWithSize::IOBufferWithSize(size_t buffer_size) {}

IOBufferWithSize::~IOBufferWithSize() {}

StringIOBuffer::StringIOBuffer(std::string s) :{}

StringIOBuffer::~StringIOBuffer() {}

DrainableIOBuffer::DrainableIOBuffer(scoped_refptr<IOBuffer> base, size_t size)
    :{}

void DrainableIOBuffer::DidConsume(int bytes) {}

int DrainableIOBuffer::BytesRemaining() const {}

// Returns the number of consumed bytes.
int DrainableIOBuffer::BytesConsumed() const {}

void DrainableIOBuffer::SetOffset(int bytes) {}

DrainableIOBuffer::~DrainableIOBuffer() {}

GrowableIOBuffer::GrowableIOBuffer() = default;

void GrowableIOBuffer::SetCapacity(int capacity) {}

void GrowableIOBuffer::set_offset(int offset) {}

int GrowableIOBuffer::RemainingCapacity() {}

base::span<uint8_t> GrowableIOBuffer::everything() {}

base::span<const uint8_t> GrowableIOBuffer::everything() const {}

base::span<uint8_t> GrowableIOBuffer::span_before_offset() {}

base::span<const uint8_t> GrowableIOBuffer::span_before_offset() const {}

GrowableIOBuffer::~GrowableIOBuffer() {}

PickledIOBuffer::PickledIOBuffer() = default;

void PickledIOBuffer::Done() {}

PickledIOBuffer::~PickledIOBuffer() {}

WrappedIOBuffer::WrappedIOBuffer(base::span<const char> data)
    :{}

WrappedIOBuffer::WrappedIOBuffer(base::span<const uint8_t> data)
    :{}

WrappedIOBuffer::~WrappedIOBuffer() = default;

}  // namespace net