#include "components/power_bookmarks/storage/power_bookmark_sync_bridge.h"
#include <memory>
#include <set>
#include <string>
#include <utility>
#include <vector>
#include "components/power_bookmarks/common/power.h"
#include "components/power_bookmarks/storage/power_bookmark_sync_metadata_database.h"
#include "components/sync/base/deletion_origin.h"
#include "components/sync/model/data_type_local_change_processor.h"
#include "components/sync/model/in_memory_metadata_change_list.h"
#include "components/sync/model/metadata_batch.h"
#include "components/sync/model/metadata_change_list.h"
#include "components/sync/model/mutable_data_batch.h"
#include "components/sync/model/sync_metadata_store_change_list.h"
namespace power_bookmarks {
namespace {
std::unique_ptr<syncer::DataBatch> ConvertPowersToSyncData(
const std::vector<std::unique_ptr<Power>>& powers) { … }
}
PowerBookmarkSyncBridge::PowerBookmarkSyncBridge(
PowerBookmarkSyncMetadataDatabase* meta_db,
Delegate* delegate,
std::unique_ptr<syncer::DataTypeLocalChangeProcessor> change_processor)
: … { … }
PowerBookmarkSyncBridge::~PowerBookmarkSyncBridge() = default;
void PowerBookmarkSyncBridge::Init() { … }
std::unique_ptr<syncer::MetadataChangeList>
PowerBookmarkSyncBridge::CreateMetadataChangeList() { … }
std::optional<syncer::ModelError> PowerBookmarkSyncBridge::MergeFullSyncData(
std::unique_ptr<syncer::MetadataChangeList> metadata_change_list,
syncer::EntityChangeList entity_changes) { … }
std::optional<syncer::ModelError>
PowerBookmarkSyncBridge::ApplyIncrementalSyncChanges(
std::unique_ptr<syncer::MetadataChangeList> metadata_change_list,
syncer::EntityChangeList entity_changes) { … }
std::string PowerBookmarkSyncBridge::GetStorageKey(
const syncer::EntityData& entity_data) { … }
std::string PowerBookmarkSyncBridge::GetClientTag(
const syncer::EntityData& entity_data) { … }
std::unique_ptr<syncer::DataBatch> PowerBookmarkSyncBridge::GetDataForCommit(
StorageKeyList storage_keys) { … }
std::unique_ptr<syncer::DataBatch>
PowerBookmarkSyncBridge::GetAllDataForDebugging() { … }
void PowerBookmarkSyncBridge::SendPowerToSync(const Power& power) { … }
void PowerBookmarkSyncBridge::NotifySyncForDeletion(const std::string& guid) { … }
std::unique_ptr<syncer::MetadataChangeList>
PowerBookmarkSyncBridge::CreateMetadataChangeListInTransaction() { … }
std::optional<syncer::ModelError> PowerBookmarkSyncBridge::ApplyChanges(
std::unique_ptr<syncer::MetadataChangeList> metadata_change_list,
syncer::EntityChangeList& entity_changes,
bool is_initial_merge) { … }
void PowerBookmarkSyncBridge::ReportError(const syncer::ModelError& error) { … }
}