chromium/components/sync/model/data_type_store_backend.cc

// Copyright 2015 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/data_type_store_backend.h"

#include <memory>

#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/strcat.h"
#include "base/task/sequenced_task_runner.h"
#include "components/sync/protocol/data_type_store_schema_descriptor.pb.h"
#include "third_party/leveldatabase/env_chromium.h"
#include "third_party/leveldatabase/leveldb_chrome.h"
#include "third_party/leveldatabase/src/include/leveldb/db.h"
#include "third_party/leveldatabase/src/include/leveldb/iterator.h"
#include "third_party/leveldatabase/src/include/leveldb/options.h"
#include "third_party/leveldatabase/src/include/leveldb/slice.h"
#include "third_party/leveldatabase/src/include/leveldb/status.h"
#include "third_party/leveldatabase/src/include/leveldb/write_batch.h"

DataTypeStoreSchemaDescriptor;

namespace syncer {

const int64_t kInvalidSchemaVersion =;
const int64_t DataTypeStoreBackend::kLatestSchemaVersion =;
const char DataTypeStoreBackend::kDBSchemaDescriptorRecordId[] =;

namespace {

void LogDbStatusByCallingSiteIfNeeded(const std::string& calling_site,
                                      leveldb::Status status) {}

}  // namespace

DataTypeStoreBackend::CustomOnTaskRunnerDeleter::CustomOnTaskRunnerDeleter(
    scoped_refptr<base::SequencedTaskRunner> task_runner)
    :{}

DataTypeStoreBackend::CustomOnTaskRunnerDeleter::CustomOnTaskRunnerDeleter(
    CustomOnTaskRunnerDeleter&&) = default;

DataTypeStoreBackend::CustomOnTaskRunnerDeleter&
DataTypeStoreBackend::CustomOnTaskRunnerDeleter::operator=(
    CustomOnTaskRunnerDeleter&&) = default;

DataTypeStoreBackend::CustomOnTaskRunnerDeleter::~CustomOnTaskRunnerDeleter() =
    default;

// static
scoped_refptr<DataTypeStoreBackend>
DataTypeStoreBackend::CreateInMemoryForTest() {}

// static
scoped_refptr<DataTypeStoreBackend>
DataTypeStoreBackend::CreateUninitialized() {}

// This is a refcounted class and the destructor is safe on any sequence and
// hence DCHECK_CALLED_ON_VALID_SEQUENCE is omitted. Note that blocking
// operations in leveldb's DBImpl::~DBImpl are posted to the backend sequence
// due to the custom deleter used for |db_|.
DataTypeStoreBackend::~DataTypeStoreBackend() = default;

std::optional<ModelError> DataTypeStoreBackend::Init(
    const base::FilePath& path,
    const std::vector<std::pair<std::string, std::string>>&
        prefixes_to_update) {}

bool DataTypeStoreBackend::IsInitialized() const {}

DataTypeStoreBackend::DataTypeStoreBackend(std::unique_ptr<leveldb::Env> env)
    :{}

leveldb::Status DataTypeStoreBackend::OpenDatabase(const std::string& path,
                                                   leveldb::Env* env) {}

leveldb::Status DataTypeStoreBackend::DestroyDatabase(const std::string& path,
                                                      leveldb::Env* env) {}

std::optional<ModelError> DataTypeStoreBackend::ReadRecordsWithPrefix(
    const std::string& prefix,
    const DataTypeStore::IdList& id_list,
    DataTypeStore::RecordList* record_list,
    DataTypeStore::IdList* missing_id_list) {}

std::optional<ModelError> DataTypeStoreBackend::ReadAllRecordsWithPrefix(
    const std::string& prefix,
    DataTypeStore::RecordList* record_list) {}

std::optional<ModelError> DataTypeStoreBackend::WriteModifications(
    std::unique_ptr<leveldb::WriteBatch> write_batch) {}

std::optional<ModelError> DataTypeStoreBackend::DeleteDataAndMetadataForPrefix(
    const std::string& prefix) {}

std::optional<ModelError> DataTypeStoreBackend::MigrateForTest(
    int64_t current_version,
    int64_t desired_version) {}

int64_t DataTypeStoreBackend::GetStoreVersionForTest() {}

int64_t DataTypeStoreBackend::GetStoreVersion() {}

std::optional<ModelError> DataTypeStoreBackend::Migrate(
    int64_t current_version,
    int64_t desired_version) {}

bool DataTypeStoreBackend::Migrate0To1() {}

std::optional<ModelError> DataTypeStoreBackend::UpdateDataPrefix(
    const std::string& old_prefix,
    const std::string& new_prefix) {}

}  // namespace syncer