Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Side by Side Diff: components/sync/engine_impl/loopback_server/persistent_permanent_entity.cc

Issue 2969643002: Reland - Replace FakeServer's implementation with LoopbackServer invocations. (Closed)
Patch Set: Rebased on master. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/sync/engine_impl/loopback_server/persistent_permanent_entit y.h" 5 #include "components/sync/engine_impl/loopback_server/persistent_permanent_entit y.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 9
10 using std::string; 10 using std::string;
11 11
12 using syncer::ModelType; 12 using syncer::ModelType;
13 13
14 namespace { 14 namespace {
15 // The parent tag for children of the root entity. Entities with this parent are 15 // The parent tag for children of the root entity. Entities with this parent are
16 // referred to as top level enities. 16 // referred to as top level enities.
17 static const char kRootParentTag[] = "0"; 17 static const char kRootParentTag[] = "0";
18 } // namespace 18 } // namespace
19 19
20 namespace syncer { 20 namespace syncer {
21 21
22 PersistentPermanentEntity::~PersistentPermanentEntity() {} 22 PersistentPermanentEntity::~PersistentPermanentEntity() {}
23 23
24 // static 24 // static
25 std::unique_ptr<LoopbackServerEntity> PersistentPermanentEntity::Create( 25 std::unique_ptr<LoopbackServerEntity> PersistentPermanentEntity::CreateNew(
26 const ModelType& model_type, 26 const ModelType& model_type,
27 const string& server_tag, 27 const string& server_tag,
28 const string& name, 28 const string& name,
29 const string& parent_server_tag) { 29 const string& parent_server_tag) {
30 CHECK(model_type != syncer::UNSPECIFIED) << "The entity's ModelType is " 30 CHECK(model_type != syncer::UNSPECIFIED) << "The entity's ModelType is "
31 << "invalid."; 31 << "invalid.";
32 CHECK(!server_tag.empty()) 32 CHECK(!server_tag.empty())
33 << "A PersistentPermanentEntity must have a server tag."; 33 << "A PersistentPermanentEntity must have a server tag.";
34 CHECK(!name.empty()) << "The entity must have a non-empty name."; 34 CHECK(!name.empty()) << "The entity must have a non-empty name.";
35 CHECK(!parent_server_tag.empty()) 35 CHECK(!parent_server_tag.empty())
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 bool PersistentPermanentEntity::IsPermanent() const { 112 bool PersistentPermanentEntity::IsPermanent() const {
113 return true; 113 return true;
114 } 114 }
115 115
116 sync_pb::LoopbackServerEntity_Type 116 sync_pb::LoopbackServerEntity_Type
117 PersistentPermanentEntity::GetLoopbackServerEntityType() const { 117 PersistentPermanentEntity::GetLoopbackServerEntityType() const {
118 return sync_pb::LoopbackServerEntity_Type_PERMANENT; 118 return sync_pb::LoopbackServerEntity_Type_PERMANENT;
119 } 119 }
120 120
121 } // namespace syncer 121 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698