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

Side by Side Diff: sync/test/fake_server/unique_client_entity.h

Issue 414953002: Make client tag IDs consistent in sync fake server (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
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 #ifndef SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_ 5 #ifndef SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_
6 #define SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_ 6 #define SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 10 matching lines...) Expand all
21 21
22 // Factory function for UniqueClientEntity. 22 // Factory function for UniqueClientEntity.
23 static FakeServerEntity* CreateNew(const sync_pb::SyncEntity& client_entity); 23 static FakeServerEntity* CreateNew(const sync_pb::SyncEntity& client_entity);
24 24
25 // Factory function for creating a new version of an existing 25 // Factory function for creating a new version of an existing
26 // UniqueClientEntity. 26 // UniqueClientEntity.
27 static FakeServerEntity* CreateUpdatedVersion( 27 static FakeServerEntity* CreateUpdatedVersion(
28 const sync_pb::SyncEntity& client_entity, 28 const sync_pb::SyncEntity& client_entity,
29 FakeServerEntity* current_server_entity); 29 FakeServerEntity* current_server_entity);
30 30
31 // Derives an ID from a unique client tagged entity.
32 static std::string EffectiveIdForClientTaggedEntity(
33 const sync_pb::SyncEntity& entity);
34
31 // FakeServerEntity implementation. 35 // FakeServerEntity implementation.
32 virtual std::string GetParentId() const OVERRIDE; 36 virtual std::string GetParentId() const OVERRIDE;
33 virtual sync_pb::SyncEntity* SerializeAsProto() OVERRIDE; 37 virtual sync_pb::SyncEntity* SerializeAsProto() OVERRIDE;
34 virtual bool IsDeleted() const OVERRIDE; 38 virtual bool IsDeleted() const OVERRIDE;
35 virtual bool IsFolder() const OVERRIDE; 39 virtual bool IsFolder() const OVERRIDE;
36 40
37 private: 41 private:
38 UniqueClientEntity(const std::string& id, 42 UniqueClientEntity(const std::string& id,
39 const syncer::ModelType& model_type, 43 const syncer::ModelType& model_type,
40 int64 version, 44 int64 version,
41 const std::string& name, 45 const std::string& name,
42 const std::string& client_defined_unique_tag, 46 const std::string& client_defined_unique_tag,
43 const sync_pb::EntitySpecifics& specifics, 47 const sync_pb::EntitySpecifics& specifics,
44 int64 creation_time, 48 int64 creation_time,
45 int64 last_modified_time); 49 int64 last_modified_time);
46 50
47 // These member values have equivalent fields in SyncEntity. 51 // These member values have equivalent fields in SyncEntity.
48 std::string client_defined_unique_tag_; 52 std::string client_defined_unique_tag_;
49 sync_pb::EntitySpecifics specifics_; 53 sync_pb::EntitySpecifics specifics_;
50 int64 creation_time_; 54 int64 creation_time_;
51 int64 last_modified_time_; 55 int64 last_modified_time_;
52 }; 56 };
53 57
54 } // namespace fake_server 58 } // namespace fake_server
55 59
56 #endif // SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_ 60 #endif // SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698