#include "content/browser/buckets/bucket_manager_host.h"
#include "base/containers/contains.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/ranges/algorithm.h"
#include "base/task/sequenced_task_runner.h"
#include "base/types/pass_key.h"
#include "components/services/storage/public/cpp/buckets/bucket_info.h"
#include "content/browser/buckets/bucket_host.h"
#include "content/browser/buckets/bucket_manager.h"
#include "content/browser/buckets/bucket_utils.h"
#include "content/browser/storage_partition_impl.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "third_party/blink/public/common/permissions/permission_utils.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
namespace content {
enum class DurabilityMetric { … };
enum class PersistenceMetric { … };
BucketManagerHost::BucketManagerHost(BucketManager* manager,
const blink::StorageKey& storage_key)
: … { … }
BucketManagerHost::~BucketManagerHost() = default;
void BucketManagerHost::BindReceiver(
mojo::PendingReceiver<blink::mojom::BucketManagerHost> receiver,
base::WeakPtr<BucketContext> context) { … }
void BucketManagerHost::OpenBucket(const std::string& name,
blink::mojom::BucketPoliciesPtr policies,
OpenBucketCallback callback) { … }
void BucketManagerHost::GetBucketForDevtools(
const std::string& name,
mojo::PendingReceiver<blink::mojom::BucketHost> receiver) { … }
void BucketManagerHost::Keys(KeysCallback callback) { … }
void BucketManagerHost::DeleteBucket(const std::string& name,
DeleteBucketCallback callback) { … }
void BucketManagerHost::RemoveBucketHost(storage::BucketId id) { … }
StoragePartitionImpl* BucketManagerHost::GetStoragePartition() { … }
storage::QuotaManagerProxy* BucketManagerHost::GetQuotaManagerProxy() { … }
void BucketManagerHost::OnReceiverDisconnect() { … }
void BucketManagerHost::DidGetBucket(
base::WeakPtr<BucketContext> bucket_context,
OpenBucketCallback callback,
storage::QuotaErrorOr<storage::BucketInfo> result) { … }
void BucketManagerHost::DidGetBucketForDevtools(
base::WeakPtr<BucketContext> bucket_context,
mojo::PendingReceiver<blink::mojom::BucketHost> receiver,
storage::QuotaErrorOr<storage::BucketInfo> result) { … }
void BucketManagerHost::DidGetBuckets(
KeysCallback callback,
storage::QuotaErrorOr<std::set<storage::BucketInfo>> buckets) { … }
void BucketManagerHost::DidDeleteBucket(const std::string& bucket_name,
DeleteBucketCallback callback,
blink::mojom::QuotaStatusCode status) { … }
}