Commit f3f5aa89 authored by Mohamed Amir Yosef's avatar Mohamed Amir Yosef Committed by Commit Bot

[Sync::USS] Adapt uss_migrator to support migrating bookmarks

uss migrator code is responsible for copying data from directory and
delivering to the USS framework.

It was not ready to migrate bookmarks because many fields that are
relevant only for bookmarks were not migrated. (such as parent_id)

This CL fixes that.

Bug: 516866
Change-Id: I8613ababd595a5de5f74e2c47a59b3d0141159d5
Reviewed-on: https://chromium-review.googlesource.com/1162226Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580834}
parent 0c3db1ae
......@@ -42,6 +42,12 @@ bool ExtractSyncEntity(ReadTransaction* trans,
entity->set_name(entry.GetServerNonUniqueName());
entity->set_deleted(entry.GetServerIsDel());
entity->set_client_defined_unique_tag(entry.GetUniqueClientTag());
// Required fields for bookmarks only.
entity->set_folder(entry.GetServerIsDir());
entity->set_parent_id_string(entry.GetServerParentId().GetServerId());
*entity->mutable_unique_position() =
entry.GetServerUniquePosition().ToProto();
entity->set_server_defined_unique_tag(entry.GetUniqueServerTag());
// It looks like there are fancy other ways to get e.g. passwords specifics
// out of Entry. Do we need to special-case them when we ship those types?
......@@ -61,7 +67,6 @@ bool MigrateDirectoryDataWithBatchSize(ModelType type,
UserShare* user_share,
ModelTypeWorker* worker,
int batch_size) {
DCHECK_NE(BOOKMARKS, type);
DCHECK_NE(PASSWORDS, type);
ReadTransaction trans(FROM_HERE, user_share);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment