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

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

Issue 1866243002: Convert //sync from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
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 #include "sync/test/fake_server/tombstone_entity.h" 5 #include "sync/test/fake_server/tombstone_entity.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "sync/internal_api/public/base/model_type.h" 9 #include "sync/internal_api/public/base/model_type.h"
10 #include "sync/protocol/sync.pb.h" 10 #include "sync/protocol/sync.pb.h"
11 #include "sync/test/fake_server/fake_server_entity.h" 11 #include "sync/test/fake_server/fake_server_entity.h"
12 12
13 using std::string; 13 using std::string;
14 14
15 using syncer::ModelType; 15 using syncer::ModelType;
16 16
17 namespace fake_server { 17 namespace fake_server {
18 18
19 TombstoneEntity::~TombstoneEntity() { } 19 TombstoneEntity::~TombstoneEntity() { }
20 20
21 // static 21 // static
22 scoped_ptr<FakeServerEntity> TombstoneEntity::Create(const string& id) { 22 std::unique_ptr<FakeServerEntity> TombstoneEntity::Create(const string& id) {
23 const ModelType model_type = GetModelTypeFromId(id); 23 const ModelType model_type = GetModelTypeFromId(id);
24 CHECK_NE(model_type, syncer::UNSPECIFIED) << "Invalid ID was given: " << id; 24 CHECK_NE(model_type, syncer::UNSPECIFIED) << "Invalid ID was given: " << id;
25 return scoped_ptr<FakeServerEntity>(new TombstoneEntity(id, model_type)); 25 return std::unique_ptr<FakeServerEntity>(new TombstoneEntity(id, model_type));
26 } 26 }
27 27
28 TombstoneEntity::TombstoneEntity(const string& id, 28 TombstoneEntity::TombstoneEntity(const string& id,
29 const ModelType& model_type) 29 const ModelType& model_type)
30 : FakeServerEntity(id, model_type, 0, string()) { 30 : FakeServerEntity(id, model_type, 0, string()) {
31 sync_pb::EntitySpecifics specifics; 31 sync_pb::EntitySpecifics specifics;
32 AddDefaultFieldValue(model_type, &specifics); 32 AddDefaultFieldValue(model_type, &specifics);
33 SetSpecifics(specifics); 33 SetSpecifics(specifics);
34 } 34 }
35 35
36 bool TombstoneEntity::RequiresParentId() const { 36 bool TombstoneEntity::RequiresParentId() const {
37 return false; 37 return false;
38 } 38 }
39 39
40 string TombstoneEntity::GetParentId() const { 40 string TombstoneEntity::GetParentId() const {
41 return string(); 41 return string();
42 } 42 }
43 43
44 void TombstoneEntity::SerializeAsProto(sync_pb::SyncEntity* proto) const { 44 void TombstoneEntity::SerializeAsProto(sync_pb::SyncEntity* proto) const {
45 FakeServerEntity::SerializeBaseProtoFields(proto); 45 FakeServerEntity::SerializeBaseProtoFields(proto);
46 } 46 }
47 47
48 bool TombstoneEntity::IsDeleted() const { 48 bool TombstoneEntity::IsDeleted() const {
49 return true; 49 return true;
50 } 50 }
51 51
52 } // namespace fake_server 52 } // namespace fake_server
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698