#include "components/sync_bookmarks/parent_guid_preprocessing.h"
#include <memory>
#include <string_view>
#include <unordered_map>
#include "base/check.h"
#include "base/memory/raw_ptr.h"
#include "base/uuid.h"
#include "components/bookmarks/browser/bookmark_node.h"
#include "components/bookmarks/browser/bookmark_uuids.h"
#include "components/sync/protocol/bookmark_specifics.pb.h"
#include "components/sync/protocol/data_type_state.pb.h"
#include "components/sync/protocol/entity_specifics.pb.h"
#include "components/sync_bookmarks/synced_bookmark_tracker.h"
#include "components/sync_bookmarks/synced_bookmark_tracker_entity.h"
namespace sync_bookmarks {
namespace {
const char kBookmarkBarTag[] = …;
const char kMobileBookmarksTag[] = …;
const char kOtherBookmarksTag[] = …;
const char kInvalidParentGuid[] = …;
bool NeedsParentGuidInSpecifics(const syncer::UpdateResponseData& update) { … }
base::Uuid TryGetParentGuidFromTracker(
const SyncedBookmarkTracker* tracker,
const syncer::UpdateResponseData& update) { … }
std::string_view GetGuidForEntity(const syncer::EntityData& entity) { … }
class LazySyncIdToGuidMapInUpdates { … };
base::Uuid GetParentGuidForUpdate(
const syncer::UpdateResponseData& update,
const SyncedBookmarkTracker* tracker,
LazySyncIdToGuidMapInUpdates* sync_id_to_guid_map_in_updates) { … }
void PopulateParentGuidInSpecificsWithTracker(
const SyncedBookmarkTracker* tracker,
syncer::UpdateResponseDataList* updates) { … }
}
void PopulateParentGuidInSpecifics(const SyncedBookmarkTracker* tracker,
syncer::UpdateResponseDataList* updates) { … }
std::string GetGuidForSyncIdInUpdatesForTesting(
const syncer::UpdateResponseDataList& updates,
const std::string& sync_id) { … }
}