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

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

Issue 600083003: Fix memory leak in Sync FakeServerEntity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 6 years, 2 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
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 "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "sync/internal_api/public/base/model_type.h" 10 #include "sync/internal_api/public/base/model_type.h"
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 TombstoneEntity::TombstoneEntity(const string& id, 27 TombstoneEntity::TombstoneEntity(const string& id,
28 const ModelType& model_type) 28 const ModelType& model_type)
29 : FakeServerEntity(id, model_type, 0, string()) { } 29 : FakeServerEntity(id, model_type, 0, string()) { }
30 30
31 string TombstoneEntity::GetParentId() const { 31 string TombstoneEntity::GetParentId() const {
32 return string(); 32 return string();
33 } 33 }
34 34
35 sync_pb::SyncEntity* TombstoneEntity::SerializeAsProto() { 35 void TombstoneEntity::SerializeAsProto(sync_pb::SyncEntity* proto) {
36 sync_pb::SyncEntity* sync_entity = new sync_pb::SyncEntity(); 36 FakeServerEntity::SerializeBaseProtoFields(proto);
37 FakeServerEntity::SerializeBaseProtoFields(sync_entity);
38 37
39 sync_pb::EntitySpecifics* specifics = sync_entity->mutable_specifics(); 38 sync_pb::EntitySpecifics* specifics = proto->mutable_specifics();
40 AddDefaultFieldValue(FakeServerEntity::GetModelType(), specifics); 39 AddDefaultFieldValue(FakeServerEntity::GetModelType(), specifics);
41
42 return sync_entity;
43 } 40 }
44 41
45 bool TombstoneEntity::IsDeleted() const { 42 bool TombstoneEntity::IsDeleted() const {
46 return true; 43 return true;
47 } 44 }
48 45
49 bool TombstoneEntity::IsFolder() const { 46 bool TombstoneEntity::IsFolder() const {
50 return false; 47 return false;
51 } 48 }
52 49
53 } // namespace fake_server 50 } // 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