#include "storage/browser/file_system/quota/quota_backend_impl.h"
#include <stdint.h>
#include <algorithm>
#include <string>
#include <utility>
#include "base/check_op.h"
#include "base/files/file_error_or.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/numerics/safe_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/types/expected_macros.h"
#include "storage/browser/file_system/file_system_usage_cache.h"
#include "storage/browser/file_system/file_system_util.h"
#include "storage/browser/quota/quota_client_type.h"
#include "storage/browser/quota/quota_manager_proxy.h"
#include "storage/common/file_system/file_system_util.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "url/origin.h"
namespace storage {
QuotaBackendImpl::QuotaBackendImpl(
scoped_refptr<base::SequencedTaskRunner> file_task_runner,
ObfuscatedFileUtil* obfuscated_file_util,
FileSystemUsageCache* file_system_usage_cache,
scoped_refptr<QuotaManagerProxy> quota_manager_proxy)
: … { … }
QuotaBackendImpl::~QuotaBackendImpl() = default;
void QuotaBackendImpl::ReserveQuota(const url::Origin& origin,
FileSystemType type,
int64_t delta,
ReserveQuotaCallback callback) { … }
void QuotaBackendImpl::ReleaseReservedQuota(const url::Origin& origin,
FileSystemType type,
int64_t size) { … }
void QuotaBackendImpl::CommitQuotaUsage(const url::Origin& origin,
FileSystemType type,
int64_t delta) { … }
void QuotaBackendImpl::IncrementDirtyCount(const url::Origin& origin,
FileSystemType type) { … }
void QuotaBackendImpl::DecrementDirtyCount(const url::Origin& origin,
FileSystemType type) { … }
void QuotaBackendImpl::DidGetUsageAndQuotaForReserveQuota(
const QuotaReservationInfo& info,
ReserveQuotaCallback callback,
blink::mojom::QuotaStatusCode status,
int64_t usage,
int64_t quota) { … }
void QuotaBackendImpl::ReserveQuotaInternal(const QuotaReservationInfo& info) { … }
base::FileErrorOr<base::FilePath> QuotaBackendImpl::GetUsageCachePath(
const url::Origin& origin,
FileSystemType type) { … }
QuotaBackendImpl::QuotaReservationInfo::QuotaReservationInfo(
const url::Origin& origin,
FileSystemType type,
int64_t delta)
: … { … }
QuotaBackendImpl::QuotaReservationInfo::~QuotaReservationInfo() = default;
}