#include "components/permissions/permission_auditing_service.h"
#include "utility"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/task/sequenced_task_runner.h"
#include "components/permissions/permission_auditing_database.h"
namespace {
constexpr base::TimeDelta kUsageSessionMaxAge = …;
constexpr base::TimeDelta kUsageSessionCullingInterval = …;
}
namespace permissions {
PermissionAuditingService::PermissionAuditingService(
scoped_refptr<base::SequencedTaskRunner> backend_task_runner)
: … { … }
PermissionAuditingService::~PermissionAuditingService() { … }
void PermissionAuditingService::Init(const base::FilePath& database_path) { … }
void PermissionAuditingService::StartPeriodicCullingOfExpiredSessions() { … }
void PermissionAuditingService::StorePermissionUsage(
const PermissionUsageSession& session) { … }
void PermissionAuditingService::GetPermissionUsageHistory(
ContentSettingsType type,
const url::Origin& origin,
base::Time start_time,
PermissionUsageHistoryCallback result_callback) { … }
void PermissionAuditingService::GetLastPermissionUsageTime(
ContentSettingsType type,
const url::Origin& origin,
LastPermissionUsageTimeCallback result_callback) { … }
void PermissionAuditingService::UpdateEndTime(ContentSettingsType type,
const url::Origin& origin,
base::Time start_time,
base::Time new_end_time) { … }
void PermissionAuditingService::DeleteSessionsBetween(base::Time start,
base::Time end) { … }
void PermissionAuditingService::ExpireOldSessions() { … }
base::TimeDelta PermissionAuditingService::GetUsageSessionMaxAge() { … }
base::TimeDelta PermissionAuditingService::GetUsageSessionCullingInterval() { … }
}