Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: components/sync/engine_impl/loopback_server/persistent_tombstone_entity.cc

Issue 2938553003: Revert of [sync] Replace FakeServer's implementation with LoopbackServer invocations. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 f1e3c5aff66da6c03ba28e6601202eba188f0049..a32b134c0720f4287ffc6e5407eea9c69851b6b6 100644
--- a/components/sync/engine_impl/loopback_server/persistent_tombstone_entity.cc
+++ b/components/sync/engine_impl/loopback_server/persistent_tombstone_entity.cc
@@ -13,33 +13,20 @@
PersistentTombstoneEntity::~PersistentTombstoneEntity() {}
// static
-std::unique_ptr<LoopbackServerEntity>
-PersistentTombstoneEntity::CreateFromEntity(const sync_pb::SyncEntity& entity) {
+std::unique_ptr<LoopbackServerEntity> PersistentTombstoneEntity::Create(
+ const sync_pb::SyncEntity& entity) {
const ModelType model_type = GetModelTypeFromId(entity.id_string());
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.client_defined_unique_tag()));
-}
-
-// static
-std::unique_ptr<LoopbackServerEntity> PersistentTombstoneEntity::CreateNew(
- 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));
+ entity.id_string(), entity.version(), model_type));
}
PersistentTombstoneEntity::PersistentTombstoneEntity(
const string& id,
int64_t version,
- 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) {
+ const ModelType& model_type)
+ : LoopbackServerEntity(id, model_type, version, string()) {
sync_pb::EntitySpecifics specifics;
AddDefaultFieldValue(model_type, &specifics);
SetSpecifics(specifics);
@@ -56,8 +43,6 @@
void PersistentTombstoneEntity::SerializeAsProto(
sync_pb::SyncEntity* proto) const {
LoopbackServerEntity::SerializeBaseProtoFields(proto);
- if (!client_defined_unique_tag_.empty())
- proto->set_client_defined_unique_tag(client_defined_unique_tag_);
}
bool PersistentTombstoneEntity::IsDeleted() const {

Powered by Google App Engine
This is Rietveld 408576698