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