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

Unified Diff: sync/test/fake_server/bookmark_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/bookmark_entity.h ('k') | sync/test/fake_server/fake_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/test/fake_server/bookmark_entity.cc
diff --git a/sync/test/fake_server/bookmark_entity.cc b/sync/test/fake_server/bookmark_entity.cc
index ae7a3b53ef714c5cd74226f3f0ac7e29d312b004..92b7847de7db53b8111eae186e56e87bcaa7f3b3 100644
--- a/sync/test/fake_server/bookmark_entity.cc
+++ b/sync/test/fake_server/bookmark_entity.cc
@@ -108,25 +108,21 @@ string BookmarkEntity::GetParentId() const {
return parent_id_;
}
-sync_pb::SyncEntity* BookmarkEntity::SerializeAsProto() {
- sync_pb::SyncEntity* sync_entity = new sync_pb::SyncEntity();
- FakeServerEntity::SerializeBaseProtoFields(sync_entity);
+void BookmarkEntity::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_originator_cache_guid(originator_cache_guid_);
- sync_entity->set_originator_client_item_id(originator_client_item_id_);
+ proto->set_originator_cache_guid(originator_cache_guid_);
+ proto->set_originator_client_item_id(originator_client_item_id_);
- sync_entity->set_parent_id_string(parent_id_);
- sync_entity->set_ctime(creation_time_);
- sync_entity->set_mtime(last_modified_time_);
+ proto->set_parent_id_string(parent_id_);
+ proto->set_ctime(creation_time_);
+ proto->set_mtime(last_modified_time_);
- sync_pb::UniquePosition* unique_position =
- sync_entity->mutable_unique_position();
+ sync_pb::UniquePosition* unique_position = proto->mutable_unique_position();
unique_position->CopyFrom(unique_position_);
-
- return sync_entity;
}
bool BookmarkEntity::IsDeleted() const {
« no previous file with comments | « sync/test/fake_server/bookmark_entity.h ('k') | sync/test/fake_server/fake_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698