#include "content/browser/media/media_license_database.h"
#include "base/files/file.h"
#include "base/files/file_util.h"
#include "base/metrics/histogram_functions.h"
#include "sql/database.h"
#include "sql/meta_table.h"
#include "sql/sqlite_result_code_values.h"
#include "sql/statement.h"
namespace content {
MediaLicenseStorageHostOpenError;
namespace {
static const int kVersionNumber = …;
const char kUmaPrefix[] = …;
const char kUmaPrefixWithPeriod[] = …;
}
MediaLicenseDatabase::MediaLicenseDatabase(const base::FilePath& path)
: … { … }
MediaLicenseDatabase::~MediaLicenseDatabase() = default;
MediaLicenseStorageHostOpenError MediaLicenseDatabase::OpenFile(
const media::CdmType& cdm_type,
const std::string& file_name) { … }
std::optional<std::vector<uint8_t>> MediaLicenseDatabase::ReadFile(
const media::CdmType& cdm_type,
const std::string& file_name) { … }
bool MediaLicenseDatabase::WriteFile(const media::CdmType& cdm_type,
const std::string& file_name,
const std::vector<uint8_t>& data) { … }
bool MediaLicenseDatabase::DeleteFile(const media::CdmType& cdm_type,
const std::string& file_name) { … }
bool MediaLicenseDatabase::ClearDatabase() { … }
uint64_t MediaLicenseDatabase::GetDatabaseSize() { … }
MediaLicenseStorageHostOpenError MediaLicenseDatabase::OpenDatabase(
bool is_retry) { … }
void MediaLicenseDatabase::OnDatabaseError(int error, sql::Statement* stmt) { … }
}