#include "storage/browser/quota/quota_temporary_storage_evictor.h"
#include <stdint.h>
#include <algorithm>
#include "base/auto_reset.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
#include "storage/browser/quota/quota_features.h"
#include "storage/browser/quota/quota_manager_impl.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "third_party/blink/public/mojom/quota/quota_types.mojom.h"
#include "url/gurl.h"
namespace {
constexpr int64_t kMBytes = …;
constexpr double kUsageRatioToStartEviction = …;
constexpr int kThresholdOfErrorsToStopEviction = …;
constexpr int kHistogramReportIntervalMinutes = …;
constexpr double kDiskSpaceShortageAllowanceRatio = …;
void UmaHistogramMbytes(const std::string& name, int sample) { … }
}
namespace storage {
QuotaTemporaryStorageEvictor::QuotaTemporaryStorageEvictor(
QuotaEvictionHandler* quota_eviction_handler,
int64_t interval_ms)
: … { … }
QuotaTemporaryStorageEvictor::~QuotaTemporaryStorageEvictor() { … }
void QuotaTemporaryStorageEvictor::GetStatistics(
std::map<std::string, int64_t>* statistics) { … }
void QuotaTemporaryStorageEvictor::ReportPerRoundHistogram() { … }
void QuotaTemporaryStorageEvictor::ReportPerHourHistogram() { … }
void QuotaTemporaryStorageEvictor::OnEvictionRoundStarted() { … }
void QuotaTemporaryStorageEvictor::OnEvictionRoundFinished() { … }
void QuotaTemporaryStorageEvictor::Start() { … }
void QuotaTemporaryStorageEvictor::StartEvictionTimerWithDelay(
int64_t delay_ms) { … }
void QuotaTemporaryStorageEvictor::ConsiderEviction() { … }
void QuotaTemporaryStorageEvictor::OnEvictedExpiredBuckets(
blink::mojom::QuotaStatusCode status_code) { … }
void QuotaTemporaryStorageEvictor::OnGotEvictionRoundInfo(
blink::mojom::QuotaStatusCode status,
const QuotaSettings& settings,
int64_t available_space,
int64_t total_space,
int64_t current_usage,
bool current_usage_is_complete) { … }
void QuotaTemporaryStorageEvictor::OnGotEvictionBuckets(
const std::set<BucketLocator>& buckets) { … }
void QuotaTemporaryStorageEvictor::OnEvictionComplete(
int expected_evicted_buckets,
int actual_evicted_buckets) { … }
}