#ifdef UNSAFE_BUFFERS_BUILD
#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 …;
const char* const kCounterNames[] = …;
static_assert …;
}
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 { … }
int Stats::GetStatsBucket(int32_t size) { … }
int Stats::GetRatio(Counters hit, Counters miss) const { … }
}