Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: sync/test/fake_server/tombstone_entity.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sync/test/fake_server/tombstone_entity.h ('k') | sync/test/fake_server/unique_client_entity.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "sync/test/fake_server/tombstone_entity.h"
6
7 #include <string>
8
9 #include "sync/internal_api/public/base/model_type.h"
10 #include "sync/protocol/sync.pb.h"
11 #include "sync/test/fake_server/fake_server_entity.h"
12
13 using std::string;
14
15 using syncer::ModelType;
16
17 namespace fake_server {
18
19 TombstoneEntity::~TombstoneEntity() { }
20
21 // static
22 std::unique_ptr<FakeServerEntity> TombstoneEntity::Create(const string& id) {
23 const ModelType model_type = GetModelTypeFromId(id);
24 CHECK_NE(model_type, syncer::UNSPECIFIED) << "Invalid ID was given: " << id;
25 return std::unique_ptr<FakeServerEntity>(new TombstoneEntity(id, model_type));
26 }
27
28 TombstoneEntity::TombstoneEntity(const string& id,
29 const ModelType& model_type)
30 : FakeServerEntity(id, model_type, 0, string()) {
31 sync_pb::EntitySpecifics specifics;
32 AddDefaultFieldValue(model_type, &specifics);
33 SetSpecifics(specifics);
34 }
35
36 bool TombstoneEntity::RequiresParentId() const {
37 return false;
38 }
39
40 string TombstoneEntity::GetParentId() const {
41 return string();
42 }
43
44 void TombstoneEntity::SerializeAsProto(sync_pb::SyncEntity* proto) const {
45 FakeServerEntity::SerializeBaseProtoFields(proto);
46 }
47
48 bool TombstoneEntity::IsDeleted() const {
49 return true;
50 }
51
52 } // namespace fake_server
OLDNEW
« no previous file with comments | « sync/test/fake_server/tombstone_entity.h ('k') | sync/test/fake_server/unique_client_entity.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698