| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/sync/engine_impl/loopback_server/persistent_tombstone_entit
y.h" | 5 #include "components/sync/engine_impl/loopback_server/persistent_tombstone_entit
y.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "components/sync/base/model_type.h" | 10 #include "components/sync/base/model_type.h" |
| 11 #include "components/sync/engine_impl/loopback_server/loopback_server_entity.h" | 11 #include "components/sync/engine_impl/loopback_server/loopback_server_entity.h" |
| 12 #include "components/sync/protocol/sync.pb.h" | 12 #include "components/sync/protocol/sync.pb.h" |
| 13 | 13 |
| 14 using std::string; | 14 using std::string; |
| 15 | 15 |
| 16 using syncer::ModelType; | 16 using syncer::ModelType; |
| 17 | 17 |
| 18 namespace syncer { | 18 namespace syncer { |
| 19 | 19 |
| 20 PersistentTombstoneEntity::~PersistentTombstoneEntity() {} | 20 PersistentTombstoneEntity::~PersistentTombstoneEntity() {} |
| 21 | 21 |
| 22 // static | 22 // static |
| 23 std::unique_ptr<LoopbackServerEntity> PersistentTombstoneEntity::Create( | 23 std::unique_ptr<LoopbackServerEntity> PersistentTombstoneEntity::Create( |
| 24 const sync_pb::SyncEntity& entity) { | 24 const sync_pb::SyncEntity& entity) { |
| 25 const ModelType model_type = GetModelTypeFromId(entity.id_string()); | 25 const ModelType model_type = GetModelTypeFromId(entity.id_string()); |
| 26 CHECK_NE(model_type, syncer::UNSPECIFIED) << "Invalid ID was given: " | 26 // Invalid ID was given. |
| 27 << entity.id_string(); | 27 CHECK_NE(model_type, syncer::UNSPECIFIED); |
| 28 return std::unique_ptr<LoopbackServerEntity>(new PersistentTombstoneEntity( | 28 return std::unique_ptr<LoopbackServerEntity>(new PersistentTombstoneEntity( |
| 29 entity.id_string(), entity.version(), model_type)); | 29 entity.id_string(), entity.version(), model_type)); |
| 30 } | 30 } |
| 31 | 31 |
| 32 PersistentTombstoneEntity::PersistentTombstoneEntity( | 32 PersistentTombstoneEntity::PersistentTombstoneEntity( |
| 33 const string& id, | 33 const string& id, |
| 34 int64_t version, | 34 int64_t version, |
| 35 const ModelType& model_type) | 35 const ModelType& model_type) |
| 36 : LoopbackServerEntity(id, model_type, version, string()) { | 36 : LoopbackServerEntity(id, model_type, version, string()) { |
| 37 sync_pb::EntitySpecifics specifics; | 37 sync_pb::EntitySpecifics specifics; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 55 bool PersistentTombstoneEntity::IsDeleted() const { | 55 bool PersistentTombstoneEntity::IsDeleted() const { |
| 56 return true; | 56 return true; |
| 57 } | 57 } |
| 58 | 58 |
| 59 sync_pb::LoopbackServerEntity_Type | 59 sync_pb::LoopbackServerEntity_Type |
| 60 PersistentTombstoneEntity::GetLoopbackServerEntityType() const { | 60 PersistentTombstoneEntity::GetLoopbackServerEntityType() const { |
| 61 return sync_pb::LoopbackServerEntity_Type_TOMBSTONE; | 61 return sync_pb::LoopbackServerEntity_Type_TOMBSTONE; |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace syncer | 64 } // namespace syncer |
| OLD | NEW |