| 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/permanent_entity.h" | 5 #include "components/sync/test/fake_server/permanent_entity.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "sync/internal_api/public/base/model_type.h" | 11 #include "components/sync/base/model_type.h" |
| 12 #include "sync/protocol/sync.pb.h" | 12 #include "components/sync/protocol/sync.pb.h" |
| 13 #include "sync/test/fake_server/fake_server_entity.h" | 13 #include "components/sync/test/fake_server/fake_server_entity.h" |
| 14 | 14 |
| 15 using std::string; | 15 using std::string; |
| 16 | 16 |
| 17 using syncer::ModelType; | 17 using syncer::ModelType; |
| 18 | 18 |
| 19 // The parent tag for children of the root entity. Entities with this parent are | 19 // The parent tag for children of the root entity. Entities with this parent are |
| 20 // referred to as top level enities. | 20 // referred to as top level enities. |
| 21 static const char kRootParentTag[] = "0"; | 21 static const char kRootParentTag[] = "0"; |
| 22 | 22 |
| 23 namespace fake_server { | 23 namespace fake_server { |
| 24 | 24 |
| 25 PermanentEntity::~PermanentEntity() { } | 25 PermanentEntity::~PermanentEntity() {} |
| 26 | 26 |
| 27 // static | 27 // static |
| 28 std::unique_ptr<FakeServerEntity> PermanentEntity::Create( | 28 std::unique_ptr<FakeServerEntity> PermanentEntity::Create( |
| 29 const ModelType& model_type, | 29 const ModelType& model_type, |
| 30 const string& server_tag, | 30 const string& server_tag, |
| 31 const string& name, | 31 const string& name, |
| 32 const string& parent_server_tag) { | 32 const string& parent_server_tag) { |
| 33 CHECK(model_type != syncer::UNSPECIFIED) << "The entity's ModelType is " | 33 CHECK(model_type != syncer::UNSPECIFIED) << "The entity's ModelType is " |
| 34 << "invalid."; | 34 << "invalid."; |
| 35 CHECK(!server_tag.empty()) << "A PermanentEntity must have a server tag."; | 35 CHECK(!server_tag.empty()) << "A PermanentEntity must have a server tag."; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 bool PermanentEntity::IsFolder() const { | 103 bool PermanentEntity::IsFolder() const { |
| 104 return true; | 104 return true; |
| 105 } | 105 } |
| 106 | 106 |
| 107 bool PermanentEntity::IsPermanent() const { | 107 bool PermanentEntity::IsPermanent() const { |
| 108 return true; | 108 return true; |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace fake_server | 111 } // namespace fake_server |
| OLD | NEW |