chromium/net/disk_cache/blockfile/stats.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/disk_cache/blockfile/stats.h"

#include <bit>
#include <cstdint>

#include "base/check.h"
#include "base/format_macros.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"

namespace {

const int32_t kDiskSignature =;

struct OnDiskStats {};
static_assert;

// WARNING: Add new stats only at the end, or change LoadStats().
const char* const kCounterNames[] =;
static_assert;

}  // namespace

namespace disk_cache {

bool VerifyStats(OnDiskStats* stats) {}

Stats::Stats() = default;

Stats::~Stats() = default;

bool Stats::Init(void* data, int num_bytes, Addr address) {}

void Stats::InitSizeHistogram() {}

int Stats::StorageSize() {}

void Stats::ModifyStorageStats(int32_t old_size, int32_t new_size) {}

void Stats::OnEvent(Counters an_event) {}

void Stats::SetCounter(Counters counter, int64_t value) {}

int64_t Stats::GetCounter(Counters counter) const {}

void Stats::GetItems(StatsItems* items) {}

void Stats::ResetRatios() {}

int Stats::GetLargeEntriesSize() {}

int Stats::SerializeStats(void* data, int num_bytes, Addr* address) {}

int Stats::GetBucketRange(size_t i) const {}

// The array will be filled this way:
//  index      size
//    0       [0, 1024)
//    1    [1024, 2048)
//    2    [2048, 4096)
//    3      [4K, 6K)
//      ...
//   10     [18K, 20K)
//   11     [20K, 24K)
//   12     [24k, 28K)
//      ...
//   15     [36k, 40K)
//   16     [40k, 64K)
//   17     [64K, 128K)
//   18    [128K, 256K)
//      ...
//   23      [4M, 8M)
//   24      [8M, 16M)
//   25     [16M, 32M)
//   26     [32M, 64M)
//   27     [64M, ...)
int Stats::GetStatsBucket(int32_t size) {}

int Stats::GetRatio(Counters hit, Counters miss) const {}

}  // namespace disk_cache