| 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 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_LOOPBACK_SERVER_PERSISTENT_TOMBSTONE_ENTITY_
H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_LOOPBACK_SERVER_PERSISTENT_TOMBSTONE_ENTITY_
H_ |
| 6 #define COMPONENTS_SYNC_ENGINE_IMPL_LOOPBACK_SERVER_PERSISTENT_TOMBSTONE_ENTITY_
H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_LOOPBACK_SERVER_PERSISTENT_TOMBSTONE_ENTITY_
H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "components/sync/base/model_type.h" | 11 #include "components/sync/base/model_type.h" |
| 12 #include "components/sync/engine_impl/loopback_server/loopback_server_entity.h" | 12 #include "components/sync/engine_impl/loopback_server/loopback_server_entity.h" |
| 13 #include "components/sync/protocol/sync.pb.h" | 13 #include "components/sync/protocol/sync.pb.h" |
| 14 | 14 |
| 15 namespace syncer { | 15 namespace syncer { |
| 16 | 16 |
| 17 // A Sync entity that represents a deleted item. | 17 // A Sync entity that represents a deleted item. |
| 18 class PersistentTombstoneEntity : public LoopbackServerEntity { | 18 class PersistentTombstoneEntity : public LoopbackServerEntity { |
| 19 public: | 19 public: |
| 20 ~PersistentTombstoneEntity() override; | 20 ~PersistentTombstoneEntity() override; |
| 21 | 21 |
| 22 // Factory function for PersistentTombstoneEntity. | 22 // Factory function for PersistentTombstoneEntity. |
| 23 static std::unique_ptr<LoopbackServerEntity> CreateFromEntity( | 23 static std::unique_ptr<LoopbackServerEntity> Create( |
| 24 const sync_pb::SyncEntity& id); | 24 const sync_pb::SyncEntity& id); |
| 25 | 25 |
| 26 static std::unique_ptr<LoopbackServerEntity> CreateNew( | |
| 27 const std::string& id, | |
| 28 const std::string& client_defined_unique_tag); | |
| 29 | |
| 30 // LoopbackServerEntity implementation. | 26 // LoopbackServerEntity implementation. |
| 31 bool RequiresParentId() const override; | 27 bool RequiresParentId() const override; |
| 32 std::string GetParentId() const override; | 28 std::string GetParentId() const override; |
| 33 void SerializeAsProto(sync_pb::SyncEntity* proto) const override; | 29 void SerializeAsProto(sync_pb::SyncEntity* proto) const override; |
| 34 bool IsDeleted() const override; | 30 bool IsDeleted() const override; |
| 35 sync_pb::LoopbackServerEntity_Type GetLoopbackServerEntityType() | 31 sync_pb::LoopbackServerEntity_Type GetLoopbackServerEntityType() |
| 36 const override; | 32 const override; |
| 37 | 33 |
| 38 private: | 34 private: |
| 39 PersistentTombstoneEntity(const std::string& id, | 35 PersistentTombstoneEntity(const std::string& id, |
| 40 int64_t version, | 36 int64_t version, |
| 41 const syncer::ModelType& model_type, | 37 const syncer::ModelType& model_type); |
| 42 const std::string& client_defined_unique_tag); | |
| 43 | |
| 44 // The tag for this entity. | |
| 45 const std::string client_defined_unique_tag_; | |
| 46 }; | 38 }; |
| 47 | 39 |
| 48 } // namespace syncer | 40 } // namespace syncer |
| 49 | 41 |
| 50 #endif // COMPONENTS_SYNC_ENGINE_IMPL_LOOPBACK_SERVER_PERSISTENT_TOMBSTONE_ENTI
TY_H_ | 42 #endif // COMPONENTS_SYNC_ENGINE_IMPL_LOOPBACK_SERVER_PERSISTENT_TOMBSTONE_ENTI
TY_H_ |
| OLD | NEW |