Index: components/sync/engine_impl/loopback_server/persistent_tombstone_entity.cc |
diff --git a/components/sync/engine_impl/loopback_server/persistent_tombstone_entity.cc b/components/sync/engine_impl/loopback_server/persistent_tombstone_entity.cc |
index a32b134c0720f4287ffc6e5407eea9c69851b6b6..ba9b486b373ac525ebaff7a395726008fbdb336f 100644 |
--- a/components/sync/engine_impl/loopback_server/persistent_tombstone_entity.cc |
+++ b/components/sync/engine_impl/loopback_server/persistent_tombstone_entity.cc |
@@ -19,14 +19,28 @@ std::unique_ptr<LoopbackServerEntity> PersistentTombstoneEntity::Create( |
CHECK_NE(model_type, syncer::UNSPECIFIED) << "Invalid ID was given: " |
<< entity.id_string(); |
return std::unique_ptr<LoopbackServerEntity>(new PersistentTombstoneEntity( |
- entity.id_string(), entity.version(), model_type)); |
+ entity.id_string(), entity.version(), model_type, |
+ entity.client_defined_unique_tag())); |
+} |
+ |
+// static |
+std::unique_ptr<LoopbackServerEntity> |
+PersistentTombstoneEntity::CreateForInjection( |
+ const std::string& id, |
+ const std::string& client_defined_unique_tag) { |
+ const ModelType model_type = GetModelTypeFromId(id); |
+ CHECK_NE(model_type, syncer::UNSPECIFIED) << "Invalid ID was given: " << id; |
+ return std::unique_ptr<LoopbackServerEntity>(new PersistentTombstoneEntity( |
+ id, 0, model_type, client_defined_unique_tag)); |
} |
PersistentTombstoneEntity::PersistentTombstoneEntity( |
const string& id, |
int64_t version, |
- const ModelType& model_type) |
- : LoopbackServerEntity(id, model_type, version, string()) { |
+ const ModelType& model_type, |
+ const std::string& client_defined_unique_tag) |
+ : LoopbackServerEntity(id, model_type, version, string()), |
+ client_defined_unique_tag_(client_defined_unique_tag) { |
sync_pb::EntitySpecifics specifics; |
AddDefaultFieldValue(model_type, &specifics); |
SetSpecifics(specifics); |
@@ -43,6 +57,7 @@ string PersistentTombstoneEntity::GetParentId() const { |
void PersistentTombstoneEntity::SerializeAsProto( |
sync_pb::SyncEntity* proto) const { |
LoopbackServerEntity::SerializeBaseProtoFields(proto); |
+ proto->set_client_defined_unique_tag(client_defined_unique_tag_); |
} |
bool PersistentTombstoneEntity::IsDeleted() const { |