#include "content/browser/media/media_license_manager.h"
#include <memory>
#include <utility>
#include <vector>
#include "base/containers/flat_map.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback_forward.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/not_fatal_until.h"
#include "base/sequence_checker.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "components/services/storage/public/cpp/buckets/bucket_locator.h"
#include "components/services/storage/public/cpp/buckets/constants.h"
#include "components/services/storage/public/cpp/constants.h"
#include "content/browser/media/media_license_database.h"
#include "content/browser/media/media_license_storage_host.h"
#include "media/cdm/cdm_type.h"
#include "sql/database.h"
#include "sql/sqlite_result_code.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "third_party/blink/public/mojom/quota/quota_types.mojom-shared.h"
#include "url/origin.h"
namespace content {
MediaLicenseStorageHostOpenError;
namespace {
scoped_refptr<base::SequencedTaskRunner> CreateDatabaseTaskRunner() { … }
}
MediaLicenseManager::MediaLicenseManager(
bool in_memory,
scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy,
scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy)
: … { … }
MediaLicenseManager::~MediaLicenseManager() = default;
void MediaLicenseManager::OpenCdmStorage(
const CdmStorageBindingContext& binding_context,
mojo::PendingReceiver<media::mojom::CdmStorage> receiver) { … }
void MediaLicenseManager::DidGetBucket(
const blink::StorageKey& storage_key,
storage::QuotaErrorOr<storage::BucketInfo> result) { … }
void MediaLicenseManager::DeleteBucketData(
const storage::BucketLocator& bucket,
storage::mojom::QuotaClient::DeleteBucketDataCallback callback) { … }
void MediaLicenseManager::DidDeleteBucketData(
storage::mojom::QuotaClient::DeleteBucketDataCallback callback,
bool success) { … }
base::FilePath MediaLicenseManager::GetDatabasePath(
const storage::BucketLocator& bucket_locator) { … }
void MediaLicenseManager::OnHostReceiverDisconnect(
MediaLicenseStorageHost* host,
base::PassKey<MediaLicenseStorageHost> pass_key) { … }
}