#include "components/history/core/browser/sync/history_sync_metadata_database.h"
#include <memory>
#include "base/logging.h"
#include "base/numerics/byte_conversions.h"
#include "base/time/time.h"
#include "components/sync/model/metadata_batch.h"
#include "components/sync/protocol/entity_metadata.pb.h"
#include "sql/meta_table.h"
#include "sql/statement.h"
namespace history {
namespace {
const char kHistoryDataTypeStateKey[] = …;
}
HistorySyncMetadataDatabase::HistorySyncMetadataDatabase(
sql::Database* db,
sql::MetaTable* meta_table)
: … { … }
HistorySyncMetadataDatabase::~HistorySyncMetadataDatabase() = default;
bool HistorySyncMetadataDatabase::Init() { … }
bool HistorySyncMetadataDatabase::GetAllSyncMetadata(
syncer::MetadataBatch* metadata_batch) { … }
bool HistorySyncMetadataDatabase::ClearAllEntityMetadata() { … }
bool HistorySyncMetadataDatabase::UpdateEntityMetadata(
syncer::DataType data_type,
const std::string& storage_key,
const sync_pb::EntityMetadata& metadata) { … }
bool HistorySyncMetadataDatabase::ClearEntityMetadata(
syncer::DataType data_type,
const std::string& storage_key) { … }
bool HistorySyncMetadataDatabase::UpdateDataTypeState(
syncer::DataType data_type,
const sync_pb::DataTypeState& data_type_state) { … }
bool HistorySyncMetadataDatabase::ClearDataTypeState(
syncer::DataType data_type) { … }
uint64_t HistorySyncMetadataDatabase::StorageKeyToMicrosSinceWindowsEpoch(
const std::string& storage_key) { … }
std::string HistorySyncMetadataDatabase::StorageKeyFromMicrosSinceWindowsEpoch(
uint64_t micros) { … }
base::Time HistorySyncMetadataDatabase::StorageKeyToVisitTime(
const std::string& storage_key) { … }
std::string HistorySyncMetadataDatabase::StorageKeyFromVisitTime(
base::Time visit_time) { … }
bool HistorySyncMetadataDatabase::GetAllEntityMetadata(
syncer::MetadataBatch* metadata_batch) { … }
bool HistorySyncMetadataDatabase::GetDataTypeState(
sync_pb::DataTypeState* state) { … }
}