| 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_FAKE_SERVER_ENTITY_H_ | 5 #ifndef SYNC_TEST_FAKE_SERVER_FAKE_SERVER_ENTITY_H_ |
| 6 #define SYNC_TEST_FAKE_SERVER_FAKE_SERVER_ENTITY_H_ | 6 #define SYNC_TEST_FAKE_SERVER_FAKE_SERVER_ENTITY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 // Returns the ID string of the top level node for the specified type. | 29 // Returns the ID string of the top level node for the specified type. |
| 30 static std::string GetTopLevelId(const syncer::ModelType& model_type); | 30 static std::string GetTopLevelId(const syncer::ModelType& model_type); |
| 31 | 31 |
| 32 virtual ~FakeServerEntity(); | 32 virtual ~FakeServerEntity(); |
| 33 const std::string& GetId() const; | 33 const std::string& GetId() const; |
| 34 syncer::ModelType GetModelType() const; | 34 syncer::ModelType GetModelType() const; |
| 35 int64 GetVersion() const; | 35 int64 GetVersion() const; |
| 36 void SetVersion(int64 version); | 36 void SetVersion(int64 version); |
| 37 const std::string& GetName() const; | 37 const std::string& GetName() const; |
| 38 void SetName(std::string name); | 38 void SetName(const std::string& name); |
| 39 | 39 |
| 40 // Replaces |specifics_| with |updated_specifics|. This method is meant to be | 40 // Replaces |specifics_| with |updated_specifics|. This method is meant to be |
| 41 // used to mimic a client commit. | 41 // used to mimic a client commit. |
| 42 void SetSpecifics(const sync_pb::EntitySpecifics& updated_specifics); | 42 void SetSpecifics(const sync_pb::EntitySpecifics& updated_specifics); |
| 43 | 43 |
| 44 // Common data items needed by server | 44 // Common data items needed by server |
| 45 virtual std::string GetParentId() const = 0; | 45 virtual std::string GetParentId() const = 0; |
| 46 virtual void SerializeAsProto(sync_pb::SyncEntity* proto) const = 0; | 46 virtual void SerializeAsProto(sync_pb::SyncEntity* proto) const = 0; |
| 47 virtual bool IsDeleted() const; | 47 virtual bool IsDeleted() const; |
| 48 virtual bool IsFolder() const; | 48 virtual bool IsFolder() const; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 73 // The name of the entity. | 73 // The name of the entity. |
| 74 std::string name_; | 74 std::string name_; |
| 75 | 75 |
| 76 // The EntitySpecifics for the entity. | 76 // The EntitySpecifics for the entity. |
| 77 sync_pb::EntitySpecifics specifics_; | 77 sync_pb::EntitySpecifics specifics_; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace fake_server | 80 } // namespace fake_server |
| 81 | 81 |
| 82 #endif // SYNC_TEST_FAKE_SERVER_FAKE_SERVER_ENTITY_H_ | 82 #endif // SYNC_TEST_FAKE_SERVER_FAKE_SERVER_ENTITY_H_ |
| OLD | NEW |