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

Unified Diff: sync/test/fake_server/permanent_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, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/test/fake_server/permanent_entity.h ('k') | sync/test/fake_server/tombstone_entity.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/test/fake_server/permanent_entity.cc
diff --git a/sync/test/fake_server/permanent_entity.cc b/sync/test/fake_server/permanent_entity.cc
index 5b1631cabf86d78e5e03e33eb76474df9b908ba5..da5443963b9a3c82c30d75a07b0c1b5cdb88019d 100644
--- a/sync/test/fake_server/permanent_entity.cc
+++ b/sync/test/fake_server/permanent_entity.cc
@@ -98,17 +98,14 @@ string PermanentEntity::GetParentId() const {
return parent_id_;
}
-sync_pb::SyncEntity* PermanentEntity::SerializeAsProto() {
- sync_pb::SyncEntity* sync_entity = new sync_pb::SyncEntity();
- FakeServerEntity::SerializeBaseProtoFields(sync_entity);
+void PermanentEntity::SerializeAsProto(sync_pb::SyncEntity* proto) {
+ FakeServerEntity::SerializeBaseProtoFields(proto);
- sync_pb::EntitySpecifics* specifics = sync_entity->mutable_specifics();
+ sync_pb::EntitySpecifics* specifics = proto->mutable_specifics();
specifics->CopyFrom(specifics_);
- sync_entity->set_parent_id_string(parent_id_);
- sync_entity->set_server_defined_unique_tag(server_defined_unique_tag_);
-
- return sync_entity;
+ proto->set_parent_id_string(parent_id_);
+ proto->set_server_defined_unique_tag(server_defined_unique_tag_);
}
bool PermanentEntity::IsDeleted() const {
« no previous file with comments | « sync/test/fake_server/permanent_entity.h ('k') | sync/test/fake_server/tombstone_entity.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698