#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/disk_cache/blockfile/eviction.h"
#include <stdint.h>
#include <limits>
#include "base/check_op.h"
#include "base/compiler_specific.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/strings/string_util.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "net/base/tracing.h"
#include "net/disk_cache/blockfile/backend_impl.h"
#include "net/disk_cache/blockfile/disk_format.h"
#include "net/disk_cache/blockfile/entry_impl.h"
#include "net/disk_cache/blockfile/experiments.h"
Time;
TimeTicks;
namespace {
const int kCleanUpMargin = …;
const int kHighUse = …;
const int kTargetTime = …;
const int kMaxDelayedTrims = …;
int LowWaterAdjust(int high_water) { … }
bool FallingBehind(int current_size, int max_size) { … }
}
namespace disk_cache {
Eviction::Eviction() = default;
Eviction::~Eviction() = default;
void Eviction::Init(BackendImpl* backend) { … }
void Eviction::Stop() { … }
void Eviction::TrimCache(bool empty) { … }
void Eviction::UpdateRank(EntryImpl* entry, bool modified) { … }
void Eviction::OnOpenEntry(EntryImpl* entry) { … }
void Eviction::OnCreateEntry(EntryImpl* entry) { … }
void Eviction::OnDoomEntry(EntryImpl* entry) { … }
void Eviction::OnDestroyEntry(EntryImpl* entry) { … }
void Eviction::SetTestMode() { … }
void Eviction::TrimDeletedList(bool empty) { … }
void Eviction::PostDelayedTrim() { … }
void Eviction::DelayedTrim() { … }
bool Eviction::ShouldTrim() { … }
bool Eviction::ShouldTrimDeleted() { … }
void Eviction::ReportTrimTimes(EntryImpl* entry) { … }
Rankings::List Eviction::GetListForEntry(EntryImpl* entry) { … }
bool Eviction::EvictEntry(CacheRankingsBlock* node, bool empty,
Rankings::List list) { … }
void Eviction::TrimCacheV2(bool empty) { … }
void Eviction::UpdateRankV2(EntryImpl* entry, bool modified) { … }
void Eviction::OnOpenEntryV2(EntryImpl* entry) { … }
void Eviction::OnCreateEntryV2(EntryImpl* entry) { … }
void Eviction::OnDoomEntryV2(EntryImpl* entry) { … }
void Eviction::OnDestroyEntryV2(EntryImpl* entry) { … }
Rankings::List Eviction::GetListForEntryV2(EntryImpl* entry) { … }
void Eviction::TrimDeleted(bool empty) { … }
bool Eviction::RemoveDeletedNode(CacheRankingsBlock* node) { … }
bool Eviction::NodeIsOldEnough(CacheRankingsBlock* node, int list) { … }
int Eviction::SelectListByLength(Rankings::ScopedRankingsBlock* next) { … }
}