| Index: components/sync/engine_impl/net/loopback_server/bookmark_entity.h
|
| diff --git a/components/sync/test/fake_server/bookmark_entity.h b/components/sync/engine_impl/net/loopback_server/bookmark_entity.h
|
| similarity index 69%
|
| copy from components/sync/test/fake_server/bookmark_entity.h
|
| copy to components/sync/engine_impl/net/loopback_server/bookmark_entity.h
|
| index 7b7143faf16864c8926dabe13cbf43b904b31816..71ecf038c5964b541f7a6577ab60ee75a06a955f 100644
|
| --- a/components/sync/test/fake_server/bookmark_entity.h
|
| +++ b/components/sync/engine_impl/net/loopback_server/bookmark_entity.h
|
| @@ -2,29 +2,30 @@
|
| // 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_BOOKMARK_ENTITY_H_
|
| -#define COMPONENTS_SYNC_TEST_FAKE_SERVER_BOOKMARK_ENTITY_H_
|
| +#ifndef COMPONENTS_SYNC_ENGINE_IMPL_NET_LOOPBACK_SERVER_BOOKMARK_ENTITY_H_
|
| +#define COMPONENTS_SYNC_ENGINE_IMPL_NET_LOOPBACK_SERVER_BOOKMARK_ENTITY_H_
|
|
|
| #include <stdint.h>
|
|
|
| #include <map>
|
| +#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 bookmark version of FakeServerEntity. This type represents entities that
|
| -// are non-deleted, client-created, and not unique per client account.
|
| -class BookmarkEntity : public FakeServerEntity {
|
| +// A bookmark version of LoopbackServerEntity. This type represents entities
|
| +// that are non-deleted, client-created, and not unique per client account.
|
| +class BookmarkEntity : public LoopbackServerEntity {
|
| public:
|
| ~BookmarkEntity() override;
|
|
|
| // Factory function for BookmarkEntity. This factory should be used only for
|
| // the first time that a specific bookmark is seen by the server.
|
| - static std::unique_ptr<FakeServerEntity> CreateNew(
|
| + static std::unique_ptr<LoopbackServerEntity> CreateNew(
|
| const sync_pb::SyncEntity& client_entity,
|
| const std::string& parent_id,
|
| const std::string& client_guid);
|
| @@ -33,11 +34,14 @@ class BookmarkEntity : public FakeServerEntity {
|
| // ID, |current_server_entity|, is passed here because the client does not
|
| // always send the complete entity over the wire. This requires copying of
|
| // some of the existing entity when creating a new entity.
|
| - static std::unique_ptr<FakeServerEntity> CreateUpdatedVersion(
|
| + static std::unique_ptr<LoopbackServerEntity> CreateUpdatedVersion(
|
| const sync_pb::SyncEntity& client_entity,
|
| - const FakeServerEntity& current_server_entity,
|
| + const LoopbackServerEntity& current_server_entity,
|
| const std::string& parent_id);
|
|
|
| + static std::unique_ptr<LoopbackServerEntity> BookmarkEntity::CreateFromEntity(
|
| + const sync_pb::SyncEntity& client_entity);
|
| +
|
| BookmarkEntity(const std::string& id,
|
| int64_t version,
|
| const std::string& name,
|
| @@ -52,7 +56,7 @@ class BookmarkEntity : public FakeServerEntity {
|
|
|
| void SetParentId(const std::string& parent_id);
|
|
|
| - // FakeServerEntity implementation.
|
| + // LoopbackServerEntity implementation.
|
| bool RequiresParentId() const override;
|
| std::string GetParentId() const override;
|
| void SerializeAsProto(sync_pb::SyncEntity* proto) const override;
|
| @@ -69,6 +73,6 @@ class BookmarkEntity : public FakeServerEntity {
|
| int64_t last_modified_time_;
|
| };
|
|
|
| -} // namespace fake_server
|
| +} // namespace syncer
|
|
|
| -#endif // COMPONENTS_SYNC_TEST_FAKE_SERVER_BOOKMARK_ENTITY_H_
|
| +#endif // COMPONENTS_SYNC_ENGINE_IMPL_NET_LOOPBACK_SERVER_BOOKMARK_ENTITY_H_
|
|
|