Index: components/sync/engine_impl/loopback_server/persistent_unique_client_entity.cc |
diff --git a/components/sync/engine_impl/loopback_server/persistent_unique_client_entity.cc b/components/sync/engine_impl/loopback_server/persistent_unique_client_entity.cc |
index 9a2b8725b17d1d4c877cc6e15c0a33f6ad4df74e..1f731e15ba3f9b7f5f847d71dae4ddd5d64d0cb0 100644 |
--- a/components/sync/engine_impl/loopback_server/persistent_unique_client_entity.cc |
+++ b/components/sync/engine_impl/loopback_server/persistent_unique_client_entity.cc |
@@ -5,6 +5,7 @@ |
#include "components/sync/engine_impl/loopback_server/persistent_unique_client_entity.h" |
#include "base/guid.h" |
+#include "components/sync/base/hash_util.h" |
#include "components/sync/engine_impl/loopback_server/persistent_permanent_entity.h" |
#include "components/sync/protocol/sync.pb.h" |
@@ -45,6 +46,20 @@ std::unique_ptr<LoopbackServerEntity> PersistentUniqueClientEntity::Create( |
} |
// static |
+std::unique_ptr<LoopbackServerEntity> |
+PersistentUniqueClientEntity::CreateForInjection( |
+ const string& name, |
+ const sync_pb::EntitySpecifics& entity_specifics) { |
+ ModelType model_type = GetModelTypeFromSpecifics(entity_specifics); |
+ string client_defined_unique_tag = GenerateSyncableHash(model_type, name); |
+ string id = |
+ LoopbackServerEntity::CreateId(model_type, client_defined_unique_tag); |
+ return std::unique_ptr<LoopbackServerEntity>(new PersistentUniqueClientEntity( |
+ id, model_type, 0, name, client_defined_unique_tag, entity_specifics, |
+ 1337, 1337)); |
+} |
+ |
+// static |
std::string PersistentUniqueClientEntity::EffectiveIdForClientTaggedEntity( |
const sync_pb::SyncEntity& entity) { |
return LoopbackServerEntity::CreateId( |