| 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 "components/sync/engine_impl/loopback_server/loopback_server_entity.h" | 5 #include "components/sync/engine_impl/loopback_server/loopback_server_entity.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 entity.entity().id_string(), entity.entity().version(), | 58 entity.entity().id_string(), entity.entity().version(), |
| 59 syncer::GetModelType(entity.entity()), entity.entity().name(), | 59 syncer::GetModelType(entity.entity()), entity.entity().name(), |
| 60 entity.entity().parent_id_string(), | 60 entity.entity().parent_id_string(), |
| 61 entity.entity().server_defined_unique_tag(), | 61 entity.entity().server_defined_unique_tag(), |
| 62 entity.entity().specifics()); | 62 entity.entity().specifics()); |
| 63 case sync_pb::LoopbackServerEntity_Type_BOOKMARK: | 63 case sync_pb::LoopbackServerEntity_Type_BOOKMARK: |
| 64 return PersistentBookmarkEntity::CreateFromEntity(entity.entity()); | 64 return PersistentBookmarkEntity::CreateFromEntity(entity.entity()); |
| 65 case sync_pb::LoopbackServerEntity_Type_UNIQUE: | 65 case sync_pb::LoopbackServerEntity_Type_UNIQUE: |
| 66 return PersistentUniqueClientEntity::Create(entity.entity()); | 66 return PersistentUniqueClientEntity::Create(entity.entity()); |
| 67 case sync_pb::LoopbackServerEntity_Type_UNKNOWN: | 67 case sync_pb::LoopbackServerEntity_Type_UNKNOWN: |
| 68 CHECK(false) << "Unknown type encountered"; | 68 // Unknown type encountered |
| 69 CHECK(false); |
| 69 return std::unique_ptr<LoopbackServerEntity>(nullptr); | 70 return std::unique_ptr<LoopbackServerEntity>(nullptr); |
| 70 } | 71 } |
| 71 NOTREACHED(); | 72 NOTREACHED(); |
| 72 return std::unique_ptr<LoopbackServerEntity>(nullptr); | 73 return std::unique_ptr<LoopbackServerEntity>(nullptr); |
| 73 } | 74 } |
| 74 | 75 |
| 75 const std::string& LoopbackServerEntity::GetId() const { | 76 const std::string& LoopbackServerEntity::GetId() const { |
| 76 return id_; | 77 return id_; |
| 77 } | 78 } |
| 78 | 79 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 176 } |
| 176 | 177 |
| 177 void LoopbackServerEntity::SerializeAsLoopbackServerEntity( | 178 void LoopbackServerEntity::SerializeAsLoopbackServerEntity( |
| 178 sync_pb::LoopbackServerEntity* entity) const { | 179 sync_pb::LoopbackServerEntity* entity) const { |
| 179 entity->set_type(GetLoopbackServerEntityType()); | 180 entity->set_type(GetLoopbackServerEntityType()); |
| 180 entity->set_model_type(static_cast<int64_t>(GetModelType())); | 181 entity->set_model_type(static_cast<int64_t>(GetModelType())); |
| 181 SerializeAsProto(entity->mutable_entity()); | 182 SerializeAsProto(entity->mutable_entity()); |
| 182 } | 183 } |
| 183 | 184 |
| 184 } // namespace syncer | 185 } // namespace syncer |
| OLD | NEW |