#include "components/permissions/permission_auditing_database.h"
#include <algorithm>
#include <iostream>
#include <limits>
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "base/check.h"
#include "base/files/file_path.h"
#include "sql/database.h"
#include "sql/meta_table.h"
#include "sql/statement.h"
#include "sql/transaction.h"
#include "url/gurl.h"
namespace permissions {
namespace {
constexpr int kVersion = …;
constexpr int kCompatibleVersion = …;
}
PermissionAuditingDatabase::PermissionAuditingDatabase() = default;
PermissionAuditingDatabase::~PermissionAuditingDatabase() = default;
bool PermissionAuditingDatabase::Init(const base::FilePath& path) { … }
bool PermissionAuditingDatabase::CreateSchema() { … }
bool PermissionAuditingDatabase::StorePermissionUsage(
const PermissionUsageSession& session) { … }
std::vector<PermissionUsageSession>
PermissionAuditingDatabase::GetPermissionUsageHistory(ContentSettingsType type,
const url::Origin& origin,
base::Time start_time) { … }
std::optional<base::Time>
PermissionAuditingDatabase::GetLastPermissionUsageTime(
ContentSettingsType type,
const url::Origin& origin) { … }
bool PermissionAuditingDatabase::UpdateEndTime(ContentSettingsType type,
const url::Origin& origin,
base::Time start_time,
base::Time new_end_time) { … }
bool PermissionAuditingDatabase::DeleteSessionsBetween(base::Time start_time,
base::Time end_time) { … }
}