chromium/components/sync/model/data_type_store_with_in_memory_cache.cc

// Copyright 2024 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_with_in_memory_cache.h"

#include <utility>

#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "components/sync/model/in_memory_metadata_change_list.h"
#include "components/sync/model/metadata_batch.h"
#include "components/sync/protocol/cookie_specifics.pb.h"
#include "components/sync/protocol/security_event_specifics.pb.h"
#include "components/sync/protocol/user_event_specifics.pb.h"

namespace syncer {

// static
template <typename Entry>
void DataTypeStoreWithInMemoryCache<Entry>::CreateAndLoad(
    OnceDataTypeStoreFactory store_factory,
    DataType type,
    CreateCallback callback) {}

template <typename Entry>
DataTypeStoreWithInMemoryCache<Entry>::DataTypeStoreWithInMemoryCache(
    std::unique_ptr<DataTypeStore> underlying_store,
    std::unique_ptr<DataTypeStoreBase::RecordList> data_records)
    :{}

template <typename Entry>
DataTypeStoreWithInMemoryCache<Entry>::~DataTypeStoreWithInMemoryCache() =
    default;

template <typename Entry>
std::unique_ptr<typename DataTypeStoreWithInMemoryCache<Entry>::WriteBatch>
DataTypeStoreWithInMemoryCache<Entry>::CreateWriteBatch() {}

template <typename Entry>
void DataTypeStoreWithInMemoryCache<Entry>::CommitWriteBatch(
    std::unique_ptr<WriteBatch> write_batch,
    CallbackWithResult callback) {}

template <typename Entry>
void DataTypeStoreWithInMemoryCache<Entry>::DeleteAllDataAndMetadata(
    CallbackWithResult callback) {}

// static
template <typename Entry>
std::unique_ptr<DataTypeStore>
DataTypeStoreWithInMemoryCache<Entry>::ExtractUnderlyingStoreForTest(
    std::unique_ptr<DataTypeStoreWithInMemoryCache> store) {}

template <typename Entry>
DataTypeStoreWithInMemoryCache<Entry>::WriteBatchImpl::WriteBatchImpl(
    std::unique_ptr<DataTypeStoreBase::WriteBatch> underlying_batch)
    :{}

template <typename Entry>
DataTypeStoreWithInMemoryCache<Entry>::WriteBatchImpl::~WriteBatchImpl() =
    default;

// static
template <typename Entry>
std::unique_ptr<DataTypeStoreBase::WriteBatch>
DataTypeStoreWithInMemoryCache<Entry>::WriteBatchImpl::ExtractUnderlying(
    std::unique_ptr<WriteBatchImpl> wrapper) {}

template <typename Entry>
void DataTypeStoreWithInMemoryCache<Entry>::WriteBatchImpl::WriteData(
    const std::string& id,
    Entry value) {}

template <typename Entry>
void DataTypeStoreWithInMemoryCache<Entry>::WriteBatchImpl::DeleteData(
    const std::string& id) {}

template <typename Entry>
MetadataChangeList*
DataTypeStoreWithInMemoryCache<Entry>::WriteBatchImpl::GetMetadataChangeList() {}

template <typename Entry>
void DataTypeStoreWithInMemoryCache<Entry>::WriteBatchImpl::
    TakeMetadataChangesFrom(std::unique_ptr<MetadataChangeList> mcl) {}

template <typename Entry>
std::map<std::string, std::optional<Entry>>
DataTypeStoreWithInMemoryCache<Entry>::WriteBatchImpl::ExtractChanges() {}

// Explicit instantiations for all required entry types.
template class DataTypeStoreWithInMemoryCache<sync_pb::CookieSpecifics>;
template class DataTypeStoreWithInMemoryCache<sync_pb::SecurityEventSpecifics>;
template class DataTypeStoreWithInMemoryCache<sync_pb::UserConsentSpecifics>;
template class DataTypeStoreWithInMemoryCache<sync_pb::UserEventSpecifics>;

}  // namespace syncer