| 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 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_LOOPBACK_SERVER_PERSISTENT_UNIQUE_CLIENT_ENT
ITY_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_LOOPBACK_SERVER_PERSISTENT_UNIQUE_CLIENT_ENT
ITY_H_ |
| 6 #define COMPONENTS_SYNC_ENGINE_IMPL_LOOPBACK_SERVER_PERSISTENT_UNIQUE_CLIENT_ENT
ITY_H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_LOOPBACK_SERVER_PERSISTENT_UNIQUE_CLIENT_ENT
ITY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 int64_t version, | 32 int64_t version, |
| 33 const std::string& name, | 33 const std::string& name, |
| 34 const std::string& client_defined_unique_tag, | 34 const std::string& client_defined_unique_tag, |
| 35 const sync_pb::EntitySpecifics& specifics, | 35 const sync_pb::EntitySpecifics& specifics, |
| 36 int64_t creation_time, | 36 int64_t creation_time, |
| 37 int64_t last_modified_time); | 37 int64_t last_modified_time); |
| 38 | 38 |
| 39 ~PersistentUniqueClientEntity() override; | 39 ~PersistentUniqueClientEntity() override; |
| 40 | 40 |
| 41 // Factory function for creating a PersistentUniqueClientEntity. | 41 // Factory function for creating a PersistentUniqueClientEntity. |
| 42 static std::unique_ptr<LoopbackServerEntity> CreateFromEntity( | 42 static std::unique_ptr<LoopbackServerEntity> Create( |
| 43 const sync_pb::SyncEntity& client_entity); | 43 const sync_pb::SyncEntity& client_entity); |
| 44 | 44 |
| 45 // Factory function for creating a PersistentUniqueClientEntity for use in the | |
| 46 // FakeServer injection API. | |
| 47 static std::unique_ptr<LoopbackServerEntity> CreateFromEntitySpecifics( | |
| 48 const std::string& name, | |
| 49 const sync_pb::EntitySpecifics& entity_specifics); | |
| 50 | |
| 51 // Derives an ID from a unique client tagged entity. | 45 // Derives an ID from a unique client tagged entity. |
| 52 static std::string EffectiveIdForClientTaggedEntity( | 46 static std::string EffectiveIdForClientTaggedEntity( |
| 53 const sync_pb::SyncEntity& entity); | 47 const sync_pb::SyncEntity& entity); |
| 54 | 48 |
| 55 // LoopbackServerEntity implementation. | 49 // LoopbackServerEntity implementation. |
| 56 bool RequiresParentId() const override; | 50 bool RequiresParentId() const override; |
| 57 std::string GetParentId() const override; | 51 std::string GetParentId() const override; |
| 58 void SerializeAsProto(sync_pb::SyncEntity* proto) const override; | 52 void SerializeAsProto(sync_pb::SyncEntity* proto) const override; |
| 59 sync_pb::LoopbackServerEntity_Type GetLoopbackServerEntityType() | 53 sync_pb::LoopbackServerEntity_Type GetLoopbackServerEntityType() |
| 60 const override; | 54 const override; |
| 61 | 55 |
| 62 private: | 56 private: |
| 63 // These member values have equivalent fields in SyncEntity. | 57 // These member values have equivalent fields in SyncEntity. |
| 64 std::string client_defined_unique_tag_; | 58 std::string client_defined_unique_tag_; |
| 65 int64_t creation_time_; | 59 int64_t creation_time_; |
| 66 int64_t last_modified_time_; | 60 int64_t last_modified_time_; |
| 67 }; | 61 }; |
| 68 | 62 |
| 69 } // namespace syncer | 63 } // namespace syncer |
| 70 | 64 |
| 71 #endif // COMPONENTS_SYNC_ENGINE_IMPL_LOOPBACK_SERVER_PERSISTENT_UNIQUE_CLIENT_
ENTITY_H_ | 65 #endif // COMPONENTS_SYNC_ENGINE_IMPL_LOOPBACK_SERVER_PERSISTENT_UNIQUE_CLIENT_
ENTITY_H_ |
| OLD | NEW |