| 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 "sync/test/fake_server/unique_client_entity.h" | 5 #include "sync/test/fake_server/unique_client_entity.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/guid.h" | 10 #include "base/guid.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 client_entity.ctime(), | 67 client_entity.ctime(), |
| 68 client_entity.mtime()); | 68 client_entity.mtime()); |
| 69 } | 69 } |
| 70 | 70 |
| 71 // static | 71 // static |
| 72 scoped_ptr<FakeServerEntity> UniqueClientEntity::CreateForInjection( | 72 scoped_ptr<FakeServerEntity> UniqueClientEntity::CreateForInjection( |
| 73 ModelType model_type, | 73 ModelType model_type, |
| 74 const string& name, | 74 const string& name, |
| 75 const sync_pb::EntitySpecifics& entity_specifics) { | 75 const sync_pb::EntitySpecifics& entity_specifics) { |
| 76 string client_defined_unique_tag = GenerateSyncableHash(model_type, name); | 76 string client_defined_unique_tag = GenerateSyncableHash(model_type, name); |
| 77 string id = FakeServerEntity::CreateId(model_type, base::GenerateGUID()); | 77 string id = FakeServerEntity::CreateId(model_type, client_defined_unique_tag); |
| 78 return scoped_ptr<FakeServerEntity>( | 78 return scoped_ptr<FakeServerEntity>( |
| 79 new UniqueClientEntity(id, | 79 new UniqueClientEntity(id, |
| 80 model_type, | 80 model_type, |
| 81 kUnusedVersion, | 81 kUnusedVersion, |
| 82 name, | 82 name, |
| 83 client_defined_unique_tag, | 83 client_defined_unique_tag, |
| 84 entity_specifics, | 84 entity_specifics, |
| 85 kDefaultTime, | 85 kDefaultTime, |
| 86 kDefaultTime)); | 86 kDefaultTime)); |
| 87 } | 87 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 114 | 114 |
| 115 bool UniqueClientEntity::IsDeleted() const { | 115 bool UniqueClientEntity::IsDeleted() const { |
| 116 return false; | 116 return false; |
| 117 } | 117 } |
| 118 | 118 |
| 119 bool UniqueClientEntity::IsFolder() const { | 119 bool UniqueClientEntity::IsFolder() const { |
| 120 return false; | 120 return false; |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace fake_server | 123 } // namespace fake_server |
| OLD | NEW |