#include "components/autofill/core/browser/webdata/autocomplete/autocomplete_sync_bridge.h"
#include <algorithm>
#include <memory>
#include <optional>
#include <set>
#include <unordered_set>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/escape.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "components/autofill/core/browser/proto/autofill_sync.pb.h"
#include "components/autofill/core/browser/webdata/autofill_sync_metadata_table.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/sync/base/deletion_origin.h"
#include "components/sync/model/client_tag_based_data_type_processor.h"
#include "components/sync/model/data_type_local_change_processor.h"
#include "components/sync/model/mutable_data_batch.h"
#include "components/sync/model/sync_metadata_store_change_list.h"
#include "components/sync/protocol/entity_data.h"
AutofillSpecifics;
ClientTagBasedDataTypeProcessor;
DataTypeLocalChangeProcessor;
DataTypeSyncBridge;
EntityChange;
EntityChangeList;
EntityData;
MetadataChangeList;
ModelError;
MutableDataBatch;
namespace autofill {
namespace {
const char kAutocompleteEntryNamespaceTag[] = …;
const char kAutocompleteTagDelimiter[] = …;
#undef RETURN_IF_ERROR
#define RETURN_IF_ERROR(x) …
void* AutocompleteSyncBridgeUserDataKey() { … }
std::string EscapeIdentifiers(const AutofillSpecifics& specifics) { … }
std::unique_ptr<EntityData> CreateEntityData(const AutocompleteEntry& entry) { … }
std::string BuildSerializedStorageKey(const std::string& name,
const std::string& value) { … }
std::string GetStorageKeyFromModel(const AutocompleteKey& key) { … }
AutocompleteEntry MergeEntryDates(const AutocompleteEntry& entry1,
const AutocompleteEntry& entry2) { … }
bool ParseStorageKey(const std::string& storage_key, AutocompleteKey* out_key) { … }
AutocompleteEntry CreateAutocompleteEntry(
const AutofillSpecifics& autofill_specifics) { … }
class SyncDifferenceTracker { … };
}
void AutocompleteSyncBridge::CreateForWebDataServiceAndBackend(
AutofillWebDataService* web_data_service,
AutofillWebDataBackend* web_data_backend) { … }
DataTypeSyncBridge* AutocompleteSyncBridge::FromWebDataService(
AutofillWebDataService* web_data_service) { … }
AutocompleteSyncBridge::AutocompleteSyncBridge(
AutofillWebDataBackend* backend,
std::unique_ptr<DataTypeLocalChangeProcessor> change_processor)
: … { … }
AutocompleteSyncBridge::~AutocompleteSyncBridge() { … }
std::unique_ptr<MetadataChangeList>
AutocompleteSyncBridge::CreateMetadataChangeList() { … }
std::optional<syncer::ModelError> AutocompleteSyncBridge::MergeFullSyncData(
std::unique_ptr<MetadataChangeList> metadata_change_list,
EntityChangeList entity_data) { … }
std::optional<ModelError> AutocompleteSyncBridge::ApplyIncrementalSyncChanges(
std::unique_ptr<MetadataChangeList> metadata_change_list,
EntityChangeList entity_changes) { … }
std::unique_ptr<syncer::DataBatch>
AutocompleteSyncBridge::AutocompleteSyncBridge::GetDataForCommit(
StorageKeyList storage_keys) { … }
std::unique_ptr<syncer::DataBatch>
AutocompleteSyncBridge::GetAllDataForDebugging() { … }
void AutocompleteSyncBridge::ActOnLocalChanges(
const AutocompleteChangeList& changes) { … }
void AutocompleteSyncBridge::LoadMetadata() { … }
std::string AutocompleteSyncBridge::GetClientTag(
const EntityData& entity_data) { … }
std::string AutocompleteSyncBridge::GetStorageKey(
const EntityData& entity_data) { … }
void AutocompleteSyncBridge::AutocompleteEntriesChanged(
const AutocompleteChangeList& changes) { … }
AutocompleteTable* AutocompleteSyncBridge::GetAutocompleteTable() { … }
AutofillSyncMetadataTable* AutocompleteSyncBridge::GetSyncMetadataStore() { … }
}