| Index: components/sync/engine_impl/net/loopback_server/tombstone_entity.cc
|
| diff --git a/components/sync/test/fake_server/tombstone_entity.cc b/components/sync/engine_impl/net/loopback_server/tombstone_entity.cc
|
| similarity index 50%
|
| copy from components/sync/test/fake_server/tombstone_entity.cc
|
| copy to components/sync/engine_impl/net/loopback_server/tombstone_entity.cc
|
| index 5da2feaea28b2927ef6d8875b76478cb13b0a2da..31f36d3fae3624394585ebf20a805762631a1260 100644
|
| --- a/components/sync/test/fake_server/tombstone_entity.cc
|
| +++ b/components/sync/engine_impl/net/loopback_server/tombstone_entity.cc
|
| @@ -2,36 +2,37 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "components/sync/test/fake_server/tombstone_entity.h"
|
| +#include "components/sync/engine_impl/net/loopback_server/tombstone_entity.h"
|
|
|
| +#include <memory>
|
| #include <string>
|
|
|
| #include "components/sync/base/model_type.h"
|
| +#include "components/sync/engine_impl/net/loopback_server/loopback_server_entity.h"
|
| #include "components/sync/protocol/sync.pb.h"
|
| -#include "components/sync/test/fake_server/fake_server_entity.h"
|
|
|
| using std::string;
|
|
|
| using syncer::ModelType;
|
|
|
| -namespace fake_server {
|
| +namespace syncer {
|
|
|
| -TombstoneEntity::~TombstoneEntity() {}
|
| +TombstoneEntity::~TombstoneEntity() { }
|
|
|
| // static
|
| -std::unique_ptr<FakeServerEntity> TombstoneEntity::Create(
|
| - const string& id,
|
| - const 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<FakeServerEntity>(
|
| - new TombstoneEntity(id, client_defined_unique_tag, model_type));
|
| +std::unique_ptr<LoopbackServerEntity> TombstoneEntity::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 TombstoneEntity(entity.id_string(), entity.version(), model_type));
|
| }
|
|
|
| TombstoneEntity::TombstoneEntity(const string& id,
|
| - const string& client_defined_unique_tag,
|
| + int64_t version,
|
| const ModelType& model_type)
|
| - : FakeServerEntity(id, client_defined_unique_tag, model_type, 0, string()) {
|
| + : LoopbackServerEntity(id, model_type, version, string()) {
|
| sync_pb::EntitySpecifics specifics;
|
| AddDefaultFieldValue(model_type, &specifics);
|
| SetSpecifics(specifics);
|
| @@ -46,11 +47,11 @@ string TombstoneEntity::GetParentId() const {
|
| }
|
|
|
| void TombstoneEntity::SerializeAsProto(sync_pb::SyncEntity* proto) const {
|
| - FakeServerEntity::SerializeBaseProtoFields(proto);
|
| + LoopbackServerEntity::SerializeBaseProtoFields(proto);
|
| }
|
|
|
| bool TombstoneEntity::IsDeleted() const {
|
| return true;
|
| }
|
|
|
| -} // namespace fake_server
|
| +} // namespace syncer
|
|
|