| 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_TEST_FAKE_SERVER_TOMBSTONE_ENTITY_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_NET_LOOPBACK_SERVER_TOMBSTONE_ENTITY_H_ |
| 6 #define COMPONENTS_SYNC_TEST_FAKE_SERVER_TOMBSTONE_ENTITY_H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_NET_LOOPBACK_SERVER_TOMBSTONE_ENTITY_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "components/sync/base/model_type.h" | 11 #include "components/sync/base/model_type.h" |
| 12 #include "components/sync/engine_impl/net/loopback_server/loopback_server_entity
.h" |
| 11 #include "components/sync/protocol/sync.pb.h" | 13 #include "components/sync/protocol/sync.pb.h" |
| 12 #include "components/sync/test/fake_server/fake_server_entity.h" | |
| 13 | 14 |
| 14 namespace fake_server { | 15 namespace syncer { |
| 15 | 16 |
| 16 // A Sync entity that represents a deleted item. | 17 // A Sync entity that represents a deleted item. |
| 17 class TombstoneEntity : public FakeServerEntity { | 18 class TombstoneEntity : public LoopbackServerEntity { |
| 18 public: | 19 public: |
| 19 ~TombstoneEntity() override; | 20 ~TombstoneEntity() override; |
| 20 | 21 |
| 21 // Factory function for TombstoneEntity. | 22 // Factory function for TombstoneEntity. |
| 22 static std::unique_ptr<FakeServerEntity> Create( | 23 static std::unique_ptr<LoopbackServerEntity> Create( |
| 23 const std::string& id, | 24 const sync_pb::SyncEntity& id); |
| 24 const std::string& client_defined_unique_tag); | |
| 25 | 25 |
| 26 // FakeServerEntity implementation. | 26 // LoopbackServerEntity implementation. |
| 27 bool RequiresParentId() const override; | 27 bool RequiresParentId() const override; |
| 28 std::string GetParentId() const override; | 28 std::string GetParentId() const override; |
| 29 void SerializeAsProto(sync_pb::SyncEntity* proto) const override; | 29 void SerializeAsProto(sync_pb::SyncEntity* proto) const override; |
| 30 bool IsDeleted() const override; | 30 bool IsDeleted() const override; |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 TombstoneEntity(const std::string& id, | 33 TombstoneEntity(const std::string& id, |
| 34 const std::string& client_defined_unique_tag, | 34 int64_t version, |
| 35 const syncer::ModelType& model_type); | 35 const syncer::ModelType& model_type); |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 } // namespace fake_server | 38 } // namespace syncer |
| 39 | 39 |
| 40 #endif // COMPONENTS_SYNC_TEST_FAKE_SERVER_TOMBSTONE_ENTITY_H_ | 40 #endif // COMPONENTS_SYNC_ENGINE_IMPL_NET_LOOPBACK_SERVER_TOMBSTONE_ENTITY_H_ |
| OLD | NEW |