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

Unified Diff: components/sync/engine_impl/net/loopback_server/permanent_entity.h

Issue 2106743002: WIP: Local sync only... (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix after rebase. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: components/sync/engine_impl/net/loopback_server/permanent_entity.h
diff --git a/components/sync/test/fake_server/permanent_entity.h b/components/sync/engine_impl/net/loopback_server/permanent_entity.h
similarity index 69%
copy from components/sync/test/fake_server/permanent_entity.h
copy to components/sync/engine_impl/net/loopback_server/permanent_entity.h
index feedb29581d27a6ba0a2e8ac1f08a9d1ae2d270a..75cd72215c79036b4634052d5f51f16ff5c46cf3 100644
--- a/components/sync/test/fake_server/permanent_entity.h
+++ b/components/sync/engine_impl/net/loopback_server/permanent_entity.h
@@ -2,25 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef COMPONENTS_SYNC_TEST_FAKE_SERVER_PERMANENT_ENTITY_H_
-#define COMPONENTS_SYNC_TEST_FAKE_SERVER_PERMANENT_ENTITY_H_
+#ifndef COMPONENTS_SYNC_ENGINE_IMPL_NET_LOOPBACK_SERVER_PERMANENT_ENTITY_H_
+#define COMPONENTS_SYNC_ENGINE_IMPL_NET_LOOPBACK_SERVER_PERMANENT_ENTITY_H_
+#include <memory>
#include <string>
#include "components/sync/base/model_type.h"
+#include "components/sync/engine_impl/net/loopback_server/loopback_server_entity.h"
#include "components/sync/protocol/sync.pb.h"
-#include "components/sync/test/fake_server/fake_server_entity.h"
-namespace fake_server {
+namespace syncer {
// A server-created, permanent entity.
-class PermanentEntity : public FakeServerEntity {
+class PermanentEntity : public LoopbackServerEntity {
public:
+ PermanentEntity(const std::string& id,
+ int64_t version,
+ const syncer::ModelType& model_type,
+ const std::string& name,
+ const std::string& parent_id,
+ const std::string& server_defined_unique_tag,
+ const sync_pb::EntitySpecifics& entity_specifics);
+
~PermanentEntity() override;
// Factory function for PermanentEntity. |server_tag| should be a globally
// unique identifier.
- static std::unique_ptr<FakeServerEntity> Create(
+ static std::unique_ptr<LoopbackServerEntity> Create(
const syncer::ModelType& model_type,
const std::string& server_tag,
const std::string& name,
@@ -28,16 +37,16 @@ class PermanentEntity : public FakeServerEntity {
// Factory function for a top level PermanentEntity. Top level means that the
// entity's parent is the root entity (no PermanentEntity exists for root).
- static std::unique_ptr<FakeServerEntity> CreateTopLevel(
+ static std::unique_ptr<LoopbackServerEntity> CreateTopLevel(
const syncer::ModelType& model_type);
// Factory function for creating an updated version of a PermanentEntity.
// This function should only be called for the Nigori entity.
- static std::unique_ptr<FakeServerEntity> CreateUpdatedNigoriEntity(
+ static std::unique_ptr<LoopbackServerEntity> CreateUpdatedNigoriEntity(
const sync_pb::SyncEntity& client_entity,
- const FakeServerEntity& current_server_entity);
+ const LoopbackServerEntity& current_server_entity);
- // FakeServerEntity implementation.
+ // LoopbackServerEntity implementation.
bool RequiresParentId() const override;
std::string GetParentId() const override;
void SerializeAsProto(sync_pb::SyncEntity* proto) const override;
@@ -45,18 +54,11 @@ class PermanentEntity : public FakeServerEntity {
bool IsPermanent() const override;
private:
- PermanentEntity(const std::string& id,
- const syncer::ModelType& model_type,
- const std::string& name,
- const std::string& parent_id,
- const std::string& server_defined_unique_tag,
- const sync_pb::EntitySpecifics& entity_specifics);
-
// All member values have equivalent fields in SyncEntity.
std::string server_defined_unique_tag_;
std::string parent_id_;
};
-} // namespace fake_server
+} // namespace syncer
-#endif // COMPONENTS_SYNC_TEST_FAKE_SERVER_PERMANENT_ENTITY_H_
+#endif // COMPONENTS_SYNC_ENGINE_IMPL_NET_LOOPBACK_SERVER_PERMANENT_ENTITY_H_

Powered by Google App Engine
This is Rietveld 408576698