| 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 SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_ | 5 #ifndef SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_ |
| 6 #define SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_ | 6 #define SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 int64 last_modified_time); | 36 int64 last_modified_time); |
| 37 | 37 |
| 38 ~UniqueClientEntity() override; | 38 ~UniqueClientEntity() override; |
| 39 | 39 |
| 40 // Factory function for creating a UniqueClientEntity. | 40 // Factory function for creating a UniqueClientEntity. |
| 41 static FakeServerEntity* Create(const sync_pb::SyncEntity& client_entity); | 41 static FakeServerEntity* Create(const sync_pb::SyncEntity& client_entity); |
| 42 | 42 |
| 43 // Factory function for creating a UniqueClientEntity for use in the | 43 // Factory function for creating a UniqueClientEntity for use in the |
| 44 // FakeServer injection API. | 44 // FakeServer injection API. |
| 45 static scoped_ptr<FakeServerEntity> CreateForInjection( | 45 static scoped_ptr<FakeServerEntity> CreateForInjection( |
| 46 syncer::ModelType model_type, | |
| 47 const std::string& name, | 46 const std::string& name, |
| 48 const sync_pb::EntitySpecifics& entity_specifics); | 47 const sync_pb::EntitySpecifics& entity_specifics); |
| 49 | 48 |
| 50 // Derives an ID from a unique client tagged entity. | 49 // Derives an ID from a unique client tagged entity. |
| 51 static std::string EffectiveIdForClientTaggedEntity( | 50 static std::string EffectiveIdForClientTaggedEntity( |
| 52 const sync_pb::SyncEntity& entity); | 51 const sync_pb::SyncEntity& entity); |
| 53 | 52 |
| 54 // FakeServerEntity implementation. | 53 // FakeServerEntity implementation. |
| 55 std::string GetParentId() const override; | 54 std::string GetParentId() const override; |
| 56 void SerializeAsProto(sync_pb::SyncEntity* proto) override; | 55 void SerializeAsProto(sync_pb::SyncEntity* proto) override; |
| 57 bool IsDeleted() const override; | 56 bool IsDeleted() const override; |
| 58 bool IsFolder() const override; | 57 bool IsFolder() const override; |
| 59 | 58 |
| 60 private: | 59 private: |
| 61 // These member values have equivalent fields in SyncEntity. | 60 // These member values have equivalent fields in SyncEntity. |
| 62 std::string client_defined_unique_tag_; | 61 std::string client_defined_unique_tag_; |
| 63 sync_pb::EntitySpecifics specifics_; | 62 sync_pb::EntitySpecifics specifics_; |
| 64 int64 creation_time_; | 63 int64 creation_time_; |
| 65 int64 last_modified_time_; | 64 int64 last_modified_time_; |
| 66 }; | 65 }; |
| 67 | 66 |
| 68 } // namespace fake_server | 67 } // namespace fake_server |
| 69 | 68 |
| 70 #endif // SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_ | 69 #endif // SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_ |
| OLD | NEW |