#include "content/browser/browsing_topics/browsing_topics_site_data_storage.h"
#include "base/files/file_util.h"
#include "base/metrics/histogram_functions.h"
#include "sql/database.h"
#include "sql/recovery.h"
#include "sql/statement.h"
#include "sql/transaction.h"
#include "third_party/blink/public/common/features.h"
namespace content {
namespace {
const int kCurrentVersionNumber = …;
void RecordInitializationStatus(bool successful) { … }
}
BrowsingTopicsSiteDataStorage::BrowsingTopicsSiteDataStorage(
const base::FilePath& path_to_database)
: … { … }
BrowsingTopicsSiteDataStorage::~BrowsingTopicsSiteDataStorage() { … }
void BrowsingTopicsSiteDataStorage::ExpireDataBefore(base::Time end_time) { … }
void BrowsingTopicsSiteDataStorage::ClearContextDomain(
const browsing_topics::HashedDomain& hashed_context_domain) { … }
browsing_topics::ApiUsageContextQueryResult
BrowsingTopicsSiteDataStorage::GetBrowsingTopicsApiUsage(base::Time begin_time,
base::Time end_time) { … }
void BrowsingTopicsSiteDataStorage::OnBrowsingTopicsApiUsed(
const browsing_topics::HashedHost& hashed_main_frame_host,
const browsing_topics::HashedDomain& hashed_context_domain,
const std::string& context_domain,
base::Time time) { … }
std::map<browsing_topics::HashedDomain, std::string>
BrowsingTopicsSiteDataStorage::GetContextDomainsFromHashedContextDomains(
const std::set<browsing_topics::HashedDomain>& hashed_context_domains) { … }
bool BrowsingTopicsSiteDataStorage::LazyInit() { … }
bool BrowsingTopicsSiteDataStorage::InitializeTables() { … }
bool BrowsingTopicsSiteDataStorage::CreateSchema() { … }
void BrowsingTopicsSiteDataStorage::HandleInitializationFailure() { … }
void BrowsingTopicsSiteDataStorage::DatabaseErrorCallback(
int extended_error,
sql::Statement* stmt) { … }
}