[SyncFS] Build indexes from FileTracker entries on disk.
[chromium-blink-merge.git] / sync / test / fake_server / tombstone_entity.cc
blobe68deb3ebb9b12b8547b5af753f0b7565e3c9472
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
3 // found in the LICENSE file.
5 #include "sync/test/fake_server/tombstone_entity.h"
7 #include <string>
9 #include "base/basictypes.h"
10 #include "sync/internal_api/public/base/model_type.h"
11 #include "sync/protocol/sync.pb.h"
12 #include "sync/test/fake_server/fake_server_entity.h"
14 using std::string;
16 using syncer::ModelType;
18 namespace fake_server {
20 TombstoneEntity::~TombstoneEntity() { }
22 // static
23 FakeServerEntity* TombstoneEntity::Create(const string& id) {
24 return new TombstoneEntity(id, GetModelTypeFromId(id));
27 TombstoneEntity::TombstoneEntity(const string& id,
28 const ModelType& model_type)
29 : FakeServerEntity(id, model_type, 0, string()) { }
31 string TombstoneEntity::GetParentId() const {
32 return string();
35 sync_pb::SyncEntity* TombstoneEntity::SerializeAsProto() {
36 sync_pb::SyncEntity* sync_entity = new sync_pb::SyncEntity();
37 FakeServerEntity::SerializeBaseProtoFields(sync_entity);
39 sync_pb::EntitySpecifics* specifics = sync_entity->mutable_specifics();
40 AddDefaultFieldValue(FakeServerEntity::GetModelType(), specifics);
42 return sync_entity;
45 bool TombstoneEntity::IsDeleted() const {
46 return true;
49 bool TombstoneEntity::IsFolder() const {
50 return false;
53 } // namespace fake_server