OLD | NEW |
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/permanent_entity.h" | 5 #include "sync/test/fake_server/permanent_entity.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 const sync_pb::EntitySpecifics& specifics) | 91 const sync_pb::EntitySpecifics& specifics) |
92 : FakeServerEntity(id, model_type, 0, name), | 92 : FakeServerEntity(id, model_type, 0, name), |
93 server_defined_unique_tag_(server_defined_unique_tag), | 93 server_defined_unique_tag_(server_defined_unique_tag), |
94 parent_id_(parent_id), | 94 parent_id_(parent_id), |
95 specifics_(specifics) { } | 95 specifics_(specifics) { } |
96 | 96 |
97 string PermanentEntity::GetParentId() const { | 97 string PermanentEntity::GetParentId() const { |
98 return parent_id_; | 98 return parent_id_; |
99 } | 99 } |
100 | 100 |
101 sync_pb::SyncEntity* PermanentEntity::SerializeAsProto() { | 101 void PermanentEntity::SerializeAsProto(sync_pb::SyncEntity* proto) { |
102 sync_pb::SyncEntity* sync_entity = new sync_pb::SyncEntity(); | 102 FakeServerEntity::SerializeBaseProtoFields(proto); |
103 FakeServerEntity::SerializeBaseProtoFields(sync_entity); | |
104 | 103 |
105 sync_pb::EntitySpecifics* specifics = sync_entity->mutable_specifics(); | 104 sync_pb::EntitySpecifics* specifics = proto->mutable_specifics(); |
106 specifics->CopyFrom(specifics_); | 105 specifics->CopyFrom(specifics_); |
107 | 106 |
108 sync_entity->set_parent_id_string(parent_id_); | 107 proto->set_parent_id_string(parent_id_); |
109 sync_entity->set_server_defined_unique_tag(server_defined_unique_tag_); | 108 proto->set_server_defined_unique_tag(server_defined_unique_tag_); |
110 | |
111 return sync_entity; | |
112 } | 109 } |
113 | 110 |
114 bool PermanentEntity::IsDeleted() const { | 111 bool PermanentEntity::IsDeleted() const { |
115 return false; | 112 return false; |
116 } | 113 } |
117 | 114 |
118 bool PermanentEntity::IsFolder() const { | 115 bool PermanentEntity::IsFolder() const { |
119 return true; | 116 return true; |
120 } | 117 } |
121 | 118 |
122 } // namespace fake_server | 119 } // namespace fake_server |
OLD | NEW |