#include "components/history/core/browser/top_sites_database.h"
#include <stddef.h>
#include <stdint.h>
#include <tuple>
#include <utility>
#include "base/check.h"
#include "base/check_op.h"
#include "base/debug/dump_without_crashing.h"
#include "base/feature_list.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/sequence_checker.h"
#include "components/history/core/browser/features.h"
#include "components/history/core/browser/history_types.h"
#include "components/history/core/browser/top_sites.h"
#include "sql/database.h"
#include "sql/meta_table.h"
#include "sql/recovery.h"
#include "sql/statement.h"
#include "sql/transaction.h"
namespace history {
namespace {
static const int kVersionNumber = …;
static const int kDeprecatedVersionNumber = …;
static const int kRankOfNewURL = …;
bool InitTables(sql::Database* db) { … }
void FixTopSitesTable(sql::Database& db) { … }
}
void TopSitesDatabase::DatabaseErrorCallback(const base::FilePath& db_path,
int extended_error,
sql::Statement* stmt) { … }
const int TopSitesDatabase::kRankOfNonExistingURL = …;
TopSitesDatabase::TopSitesDatabase() { … }
TopSitesDatabase::~TopSitesDatabase() { … }
bool TopSitesDatabase::Init(const base::FilePath& db_name) { … }
bool TopSitesDatabase::UpgradeToVersion5(sql::MetaTable& meta_table) { … }
bool TopSitesDatabase::InitImpl(const base::FilePath& db_name) { … }
void TopSitesDatabase::ApplyDelta(const TopSitesDelta& delta) { … }
MostVisitedURLList TopSitesDatabase::GetSites() { … }
void TopSitesDatabase::SetSiteNoTransaction(const MostVisitedURL& url,
int new_rank) { … }
void TopSitesDatabase::AddSite(const MostVisitedURL& url, int new_rank) { … }
bool TopSitesDatabase::UpdateSite(const MostVisitedURL& url) { … }
int TopSitesDatabase::GetURLRank(const MostVisitedURL& url) { … }
void TopSitesDatabase::UpdateSiteRankNoTransaction(const MostVisitedURL& url,
int new_rank) { … }
bool TopSitesDatabase::RemoveURLNoTransaction(const MostVisitedURL& url) { … }
sql::Database* TopSitesDatabase::db_for_testing() { … }
int TopSitesDatabase::GetURLRankForTesting(const MostVisitedURL& url) { … }
bool TopSitesDatabase::RemoveURLNoTransactionForTesting(
const MostVisitedURL& url) { … }
}