#include "chrome/browser/extensions/api/storage/sync_storage_backend.h"
#include <memory>
#include <utility>
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "chrome/browser/extensions/api/storage/settings_sync_processor.h"
#include "chrome/browser/extensions/api/storage/settings_sync_util.h"
#include "chrome/browser/extensions/api/storage/syncable_settings_storage.h"
#include "components/sync/model/sync_change_processor.h"
#include "extensions/browser/api/storage/backend_task_runner.h"
#include "extensions/browser/api/storage/value_store_util.h"
#include "extensions/common/extension_id.h"
namespace extensions {
namespace {
void AddAllSyncData(const ExtensionId& extension_id,
const base::Value::Dict& src,
syncer::DataType type,
syncer::SyncDataList* dst) { … }
base::Value::Dict EmptyDict() { … }
value_store_util::ModelType ToFactoryModelType(syncer::DataType sync_type) { … }
}
SyncStorageBackend::SyncStorageBackend(
scoped_refptr<value_store::ValueStoreFactory> storage_factory,
const SettingsStorageQuotaEnforcer::Limits& quota,
SequenceBoundSettingsChangedCallback observer,
syncer::DataType sync_type,
const syncer::SyncableService::StartSyncFlare& flare)
: … { … }
SyncStorageBackend::~SyncStorageBackend() { … }
value_store::ValueStore* SyncStorageBackend::GetStorage(
const ExtensionId& extension_id) { … }
SyncableSettingsStorage* SyncStorageBackend::GetOrCreateStorageWithSyncData(
const ExtensionId& extension_id,
base::Value::Dict sync_data) const { … }
void SyncStorageBackend::DeleteStorage(const ExtensionId& extension_id) { … }
void SyncStorageBackend::WaitUntilReadyToSync(base::OnceClosure done) { … }
syncer::SyncDataList SyncStorageBackend::GetAllSyncDataForTesting(
syncer::DataType type) const { … }
std::optional<syncer::ModelError> SyncStorageBackend::MergeDataAndStartSyncing(
syncer::DataType type,
const syncer::SyncDataList& initial_sync_data,
std::unique_ptr<syncer::SyncChangeProcessor> sync_processor) { … }
std::optional<syncer::ModelError> SyncStorageBackend::ProcessSyncChanges(
const base::Location& from_here,
const syncer::SyncChangeList& sync_changes) { … }
base::WeakPtr<syncer::SyncableService> SyncStorageBackend::AsWeakPtr() { … }
void SyncStorageBackend::StopSyncing(syncer::DataType type) { … }
std::unique_ptr<SettingsSyncProcessor>
SyncStorageBackend::CreateSettingsSyncProcessor(
const ExtensionId& extension_id) const { … }
}