chromium/content/browser/media/cdm_storage_database.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/browser/media/cdm_storage_database.h"

#include <algorithm>

#include "base/files/file.h"
#include "base/files/file_util.h"
#include "base/json/values_util.h"
#include "base/metrics/histogram_functions.h"
#include "sql/statement.h"

namespace content {

namespace {

// This is the version number of the CdmStorageDatabase. We are currently on
// version two since there has been one change to the schema from when it is
// created. Please increment `kVersionNumber` by 1 every time you change the
// schema, and update the cdm_storage_database_unittest.cc code to keep version
// 2's schema to test the transition between v2 and v3, the same way we are
// testing v1 to v2.
// Change to version 2:
// We have introduced file_size and last_modified to the version Schema, to keep
// track of file size and when a file has been touched, whether it be written or
// read.
static const int kVersionNumber =;

const char kUmaPrefix[] =;

const char kDeleteForTimeFrameError[] =;
const char kDeleteForStorageKeyError[] =;
const char kDeleteForFilterError[] =;
const char kDeleteFileError[] =;

static bool DatabaseIsEmpty(sql::Database* db) {}

}  // namespace

CdmStorageDatabase::CdmStorageDatabase(const base::FilePath& path)
    :{}

CdmStorageDatabase::~CdmStorageDatabase() = default;

CdmStorageOpenError CdmStorageDatabase::EnsureOpen() {}

std::optional<std::vector<uint8_t>> CdmStorageDatabase::ReadFile(
    const blink::StorageKey& storage_key,
    const media::CdmType& cdm_type,
    const std::string& file_name) {}

bool CdmStorageDatabase::WriteFile(const blink::StorageKey& storage_key,
                                   const media::CdmType& cdm_type,
                                   const std::string& file_name,
                                   const std::vector<uint8_t>& data) {}

std::optional<uint64_t> CdmStorageDatabase::GetSizeForFile(
    const blink::StorageKey& storage_key,
    const media::CdmType& cdm_type,
    const std::string& file_name) {}

std::optional<uint64_t> CdmStorageDatabase::GetSizeForStorageKey(
    const blink::StorageKey& storage_key,
    const base::Time begin,
    const base::Time end) {}

std::optional<uint64_t> CdmStorageDatabase::GetSizeForTimeFrame(
    const base::Time begin,
    const base::Time end) {}

CdmStorageKeyUsageSize CdmStorageDatabase::GetUsagePerAllStorageKeys(
    const base::Time begin,
    const base::Time end) {}

bool CdmStorageDatabase::DeleteFile(const blink::StorageKey& storage_key,
                                    const media::CdmType& cdm_type,
                                    const std::string& file_name) {}

bool CdmStorageDatabase::DeleteData(
    const StoragePartition::StorageKeyMatcherFunction& storage_key_matcher,
    const blink::StorageKey& storage_key,
    const base::Time begin,
    const base::Time end) {}

bool CdmStorageDatabase::DeleteDataForFilter(
    StoragePartition::StorageKeyMatcherFunction storage_key_matcher,
    const base::Time begin,
    const base::Time end) {}

bool CdmStorageDatabase::DeleteDataForStorageKey(
    const blink::StorageKey& storage_key,
    const base::Time begin,
    const base::Time end) {}

bool CdmStorageDatabase::DeleteDataForTimeFrame(const base::Time begin,
                                                const base::Time end) {}

bool CdmStorageDatabase::ClearDatabase() {}

void CdmStorageDatabase::CloseDatabaseForTesting() {}

bool CdmStorageDatabase::DeleteIfEmptyDatabase(bool last_operation_success) {}

CdmStorageOpenError CdmStorageDatabase::OpenDatabase(bool is_retry) {}

bool CdmStorageDatabase::UpgradeDatabaseSchema(sql::MetaTable* meta_table) {}

void CdmStorageDatabase::OnDatabaseError(int error, sql::Statement* stmt) {}

}  // namespace content