chromium/components/sync/model/blocking_data_type_store_impl.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/sync/model/blocking_data_type_store_impl.h"

#include <optional>
#include <utility>

#include "base/check_op.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/strcat.h"
#include "components/sync/model/data_type_store_backend.h"
#include "components/sync/model/metadata_batch.h"
#include "components/sync/model/model_error.h"
#include "components/sync/protocol/data_type_state.pb.h"
#include "components/sync/protocol/entity_metadata.pb.h"
#include "third_party/leveldatabase/src/include/leveldb/env.h"
#include "third_party/leveldatabase/src/include/leveldb/write_batch.h"

namespace syncer {

namespace {

// Used for data and metadata explicitly linked to a server-side account. Note
// that this prefix is used *before* the datatype's root tag, which also means
// it shouldn't be a substring or superstring of root tags. Conveniently, root
// tags are guaranteed to be lowercase.
const char kAccountStoragePrefix[] =;

// Key prefix for data/metadata records.
const char kDataPrefix[] =;
const char kMetadataPrefix[] =;

// Key for global metadata record.
const char kGlobalMetadataKey[] =;

class LevelDbMetadataChangeList : public MetadataChangeList {};

class LevelDbWriteBatch : public BlockingDataTypeStoreImpl::WriteBatch {};

std::string GetStorageTypePrefix(StorageType storage_type) {}

}  // namespace

// Formats key prefix for data records of |data_type| using |storage_type|.
std::string FormatDataPrefix(DataType data_type, StorageType storage_type) {}

// Formats key prefix for metadata records of |data_type| using |storage_type|.
std::string FormatMetaPrefix(DataType data_type, StorageType storage_type) {}

// Formats key for global metadata record of |data_type| using |storage_type|.
std::string FormatGlobalMetadataKey(DataType data_type,
                                    StorageType storage_type) {}

BlockingDataTypeStoreImpl::BlockingDataTypeStoreImpl(
    DataType data_type,
    StorageType storage_type,
    scoped_refptr<DataTypeStoreBackend> backend)
    :{}

BlockingDataTypeStoreImpl::~BlockingDataTypeStoreImpl() {}

std::optional<ModelError> BlockingDataTypeStoreImpl::ReadData(
    const IdList& id_list,
    RecordList* data_records,
    IdList* missing_id_list) {}

std::optional<ModelError> BlockingDataTypeStoreImpl::ReadAllData(
    RecordList* data_records) {}

std::optional<ModelError> BlockingDataTypeStoreImpl::ReadAllMetadata(
    MetadataBatch* metadata_batch) {}

std::unique_ptr<BlockingDataTypeStoreImpl::WriteBatch>
BlockingDataTypeStoreImpl::CreateWriteBatch() {}

std::optional<ModelError> BlockingDataTypeStoreImpl::CommitWriteBatch(
    std::unique_ptr<WriteBatch> write_batch) {}

std::optional<ModelError>
BlockingDataTypeStoreImpl::DeleteAllDataAndMetadata() {}

// static
std::unique_ptr<BlockingDataTypeStoreImpl::WriteBatch>
BlockingDataTypeStoreImpl::CreateWriteBatch(DataType data_type,
                                            StorageType storage_type) {}

// static
std::string BlockingDataTypeStoreImpl::FormatPrefixForDataTypeAndStorageType(
    DataType data_type,
    StorageType storage_type) {}

}  // namespace syncer