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

Unified Diff: sync/test/fake_server/unique_client_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/unique_client_entity.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/test/fake_server/unique_client_entity.cc
diff --git a/sync/test/fake_server/unique_client_entity.cc b/sync/test/fake_server/unique_client_entity.cc
index 11b37d585b657f46bd41e5ad3934e9bae19eae29..3170cc1a511f7aa9c9bef2b9b74dc0cf8de62086 100644
--- a/sync/test/fake_server/unique_client_entity.cc
+++ b/sync/test/fake_server/unique_client_entity.cc
@@ -68,19 +68,16 @@ string UniqueClientEntity::GetParentId() const {
return FakeServerEntity::GetTopLevelId(model_type_);
}
-sync_pb::SyncEntity* UniqueClientEntity::SerializeAsProto() {
- sync_pb::SyncEntity* sync_entity = new sync_pb::SyncEntity();
- FakeServerEntity::SerializeBaseProtoFields(sync_entity);
+void UniqueClientEntity::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(GetParentId());
- sync_entity->set_client_defined_unique_tag(client_defined_unique_tag_);
- sync_entity->set_ctime(creation_time_);
- sync_entity->set_mtime(last_modified_time_);
-
- return sync_entity;
+ proto->set_parent_id_string(GetParentId());
+ proto->set_client_defined_unique_tag(client_defined_unique_tag_);
+ proto->set_ctime(creation_time_);
+ proto->set_mtime(last_modified_time_);
}
bool UniqueClientEntity::IsDeleted() const {
« no previous file with comments | « sync/test/fake_server/unique_client_entity.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698