#include "content/browser/media/cdm_file_impl.h"
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/string_util.h"
#include "content/browser/media/cdm_storage_manager.h"
#include "content/browser/media/media_license_storage_host.h"
#include "media/cdm/cdm_helpers.h"
#include "media/cdm/cdm_type.h"
#include "media/mojo/mojom/cdm_storage.mojom.h"
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "storage/browser/quota/quota_manager.h"
#include "storage/common/file_system/file_system_types.h"
namespace content {
namespace {
const char kTemporaryFilePrefix = …;
const size_t kFileNameMaxLength = …;
const char kReadFile[] = …;
const char kWriteFile[] = …;
const char kDeleteFile[] = …;
}
bool CdmFileImpl::IsValidName(const std::string& name) { … }
CdmFileImpl::CdmFileImpl(
MediaLicenseStorageHost* host,
const media::CdmType& cdm_type,
const std::string& file_name,
mojo::PendingAssociatedReceiver<media::mojom::CdmFile> pending_receiver)
: … { … }
CdmFileImpl::CdmFileImpl(
CdmStorageManager* manager,
const blink::StorageKey& storage_key,
const media::CdmType& cdm_type,
const std::string& file_name,
mojo::PendingAssociatedReceiver<media::mojom::CdmFile> pending_receiver)
: … { … }
CdmFileImpl::~CdmFileImpl() { … }
void CdmFileImpl::Read(ReadCallback callback) { … }
void CdmFileImpl::DidRead(std::optional<std::vector<uint8_t>> data) { … }
void CdmFileImpl::Write(const std::vector<uint8_t>& data,
WriteCallback callback) { … }
void CdmFileImpl::ReportFileOperationUMA(bool success,
const std::string& operation) { … }
void CdmFileImpl::DidWrite(bool success) { … }
void CdmFileImpl::DeleteFile() { … }
void CdmFileImpl::DidDeleteFile(bool success) { … }
void CdmFileImpl::OnReceiverDisconnect() { … }
}