#include "components/sync/model/data_type_store_impl.h"
#include <map>
#include <optional>
#include <utility>
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/task/sequenced_task_runner.h"
#include "base/trace_event/trace_event.h"
#include "components/sync/model/blocking_data_type_store_impl.h"
#include "components/sync/model/metadata_batch.h"
#include "components/sync/model/model_error.h"
namespace syncer {
namespace {
std::optional<ModelError> ReadAllDataAndPreprocessOnBackendSequence(
BlockingDataTypeStoreImpl* blocking_store,
DataTypeStore::PreprocessCallback preprocess_on_backend_sequence_callback) { … }
}
DataTypeStoreImpl::DataTypeStoreImpl(
DataType data_type,
StorageType storage_type,
std::unique_ptr<BlockingDataTypeStoreImpl, base::OnTaskRunnerDeleter>
backend_store,
scoped_refptr<base::SequencedTaskRunner> backend_task_runner)
: … { … }
DataTypeStoreImpl::~DataTypeStoreImpl() { … }
void DataTypeStoreImpl::ReadData(const IdList& id_list,
ReadDataCallback callback) { … }
void DataTypeStoreImpl::ReadDataDone(ReadDataCallback callback,
std::unique_ptr<RecordList> record_list,
std::unique_ptr<IdList> missing_id_list,
const std::optional<ModelError>& error) { … }
void DataTypeStoreImpl::ReadAllData(ReadAllDataCallback callback) { … }
void DataTypeStoreImpl::ReadAllDataDone(
ReadAllDataCallback callback,
std::unique_ptr<RecordList> record_list,
const std::optional<ModelError>& error) { … }
void DataTypeStoreImpl::ReadAllMetadata(ReadMetadataCallback callback) { … }
void DataTypeStoreImpl::ReadAllMetadataDone(
ReadMetadataCallback callback,
std::unique_ptr<MetadataBatch> metadata_batch,
const std::optional<ModelError>& error) { … }
void DataTypeStoreImpl::ReadAllDataAndMetadata(
ReadAllDataAndMetadataCallback callback) { … }
void DataTypeStoreImpl::ReadMetadataAfterReadAllDataDone(
ReadAllDataAndMetadataCallback callback,
const std::optional<ModelError>& error,
std::unique_ptr<RecordList> record_list) { … }
void DataTypeStoreImpl::ReadAllDataAndMetadataDone(
ReadAllDataAndMetadataCallback callback,
std::unique_ptr<RecordList> record_list,
const std::optional<ModelError>& error,
std::unique_ptr<MetadataBatch> metadata_batch) { … }
void DataTypeStoreImpl::ReadAllDataAndPreprocess(
PreprocessCallback preprocess_on_backend_sequence_callback,
CallbackWithResult completion_on_frontend_sequence_callback) { … }
void DataTypeStoreImpl::ReadAllDataAndPreprocessDone(
CallbackWithResult callback,
const std::optional<ModelError>& error) { … }
void DataTypeStoreImpl::DeleteAllDataAndMetadata(CallbackWithResult callback) { … }
std::unique_ptr<DataTypeStore::WriteBatch>
DataTypeStoreImpl::CreateWriteBatch() { … }
void DataTypeStoreImpl::CommitWriteBatch(
std::unique_ptr<WriteBatch> write_batch,
CallbackWithResult callback) { … }
void DataTypeStoreImpl::WriteModificationsDone(
CallbackWithResult callback,
const std::optional<ModelError>& error) { … }
}