chromium/mojo/public/cpp/base/big_buffer.cc

// Copyright 2018 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/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "mojo/public/cpp/base/big_buffer.h"

#include "base/check.h"
#include "base/containers/heap_array.h"
#include "base/notreached.h"
#include "base/ranges/algorithm.h"

namespace mojo_base {

namespace internal {

BigBufferSharedMemoryRegion::BigBufferSharedMemoryRegion() :{}

BigBufferSharedMemoryRegion::BigBufferSharedMemoryRegion(
    mojo::ScopedSharedBufferHandle buffer_handle,
    size_t size)
    :{}

BigBufferSharedMemoryRegion::BigBufferSharedMemoryRegion(
    BigBufferSharedMemoryRegion&& other) = default;

BigBufferSharedMemoryRegion::~BigBufferSharedMemoryRegion() = default;

BigBufferSharedMemoryRegion& BigBufferSharedMemoryRegion::operator=(
    BigBufferSharedMemoryRegion&& other) = default;

mojo::ScopedSharedBufferHandle BigBufferSharedMemoryRegion::TakeBufferHandle() {}

}  // namespace internal

namespace {

void TryCreateSharedMemory(
    size_t size,
    BigBuffer::StorageType* storage_type,
    std::optional<internal::BigBufferSharedMemoryRegion>* shared_memory) {}

}  // namespace

// static
constexpr size_t BigBuffer::kMaxInlineBytes;

BigBuffer::BigBuffer() :{}

BigBuffer::BigBuffer(BigBuffer&& other)
    :{}

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

BigBuffer::BigBuffer(const std::vector<uint8_t>& data)
    :{}

BigBuffer::BigBuffer(internal::BigBufferSharedMemoryRegion shared_memory)
    :{}

BigBuffer::BigBuffer(size_t size) {}

BigBuffer::~BigBuffer() = default;

BigBuffer& BigBuffer::operator=(BigBuffer&& other) {}

BigBuffer BigBuffer::Clone() const {}

uint8_t* BigBuffer::data() {}

const uint8_t* BigBuffer::data() const {}

size_t BigBuffer::size() const {}

BigBufferView::BigBufferView() = default;

BigBufferView::BigBufferView(BigBufferView&& other) = default;

BigBufferView::BigBufferView(base::span<const uint8_t> bytes) {}

BigBufferView::~BigBufferView() = default;

BigBufferView& BigBufferView::operator=(BigBufferView&& other) = default;

void BigBufferView::SetBytes(base::span<const uint8_t> bytes) {}

void BigBufferView::SetSharedMemory(
    internal::BigBufferSharedMemoryRegion shared_memory) {}

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

// static
BigBuffer BigBufferView::ToBigBuffer(BigBufferView view) {}

// static
BigBufferView BigBufferView::CreateInvalidForTest() {}

}  // namespace mojo_base