#include "storage/browser/file_system/file_system_quota_client.h"
#include <numeric>
#include <string>
#include <utility>
#include <vector>
#include "base/barrier_callback.h"
#include "base/barrier_closure.h"
#include "base/check.h"
#include "base/containers/span.h"
#include "base/files/file.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/sequence_checker.h"
#include "base/task/sequenced_task_runner.h"
#include "components/services/storage/public/cpp/buckets/bucket_locator.h"
#include "mojo/public/cpp/bindings/callback_helpers.h"
#include "storage/browser/file_system/file_system_backend.h"
#include "storage/browser/file_system/file_system_context.h"
#include "storage/common/file_system/file_system_types.h"
#include "storage/common/file_system/file_system_util.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "third_party/blink/public/mojom/quota/quota_types.mojom.h"
namespace storage {
namespace {
static const FileSystemType kTemporaryAndPersistent[] = …;
static const FileSystemType kSyncable[] = …;
template <typename T>
std::vector<T> MergeWithoutDuplicates(const std::vector<std::vector<T>>& tss) { … }
base::span<const FileSystemType> QuotaStorageTypeToFileSystemTypes(
blink::mojom::StorageType storage_type) { … }
std::vector<blink::StorageKey> GetStorageKeysForTypeOnFileTaskRunner(
FileSystemContext* context,
FileSystemType type) { … }
blink::mojom::QuotaStatusCode DeleteBucketOnFileTaskRunner(
FileSystemContext* context,
const BucketLocator& bucket_locator,
FileSystemType type) { … }
void PerformStorageCleanupOnFileTaskRunner(FileSystemContext* context,
FileSystemType type) { … }
}
FileSystemQuotaClient::FileSystemQuotaClient(
FileSystemContext* file_system_context)
: … { … }
FileSystemQuotaClient::~FileSystemQuotaClient() { … }
void FileSystemQuotaClient::GetBucketUsage(const BucketLocator& bucket,
GetBucketUsageCallback callback) { … }
void FileSystemQuotaClient::GetStorageKeysForType(
blink::mojom::StorageType storage_type,
GetStorageKeysForTypeCallback callback) { … }
void FileSystemQuotaClient::DeleteBucketData(
const BucketLocator& bucket,
DeleteBucketDataCallback callback) { … }
void FileSystemQuotaClient::PerformStorageCleanup(
blink::mojom::StorageType type,
PerformStorageCleanupCallback callback) { … }
base::SequencedTaskRunner* FileSystemQuotaClient::file_task_runner() const { … }
}