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

Side by Side Diff: components/sync/engine_impl/worker_entity_tracker.h

Issue 2611123005: [Sync] ModelTypeWorker should delete tracker for entity deleted on the server (Closed)
Patch Set: Address comment Created 3 years, 11 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 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_WORKER_ENTITY_TRACKER_H_ 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_WORKER_ENTITY_TRACKER_H_
6 #define COMPONENTS_SYNC_ENGINE_IMPL_WORKER_ENTITY_TRACKER_H_ 6 #define COMPONENTS_SYNC_ENGINE_IMPL_WORKER_ENTITY_TRACKER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 22 matching lines...) Expand all
33 public: 33 public:
34 // Initializes the entity tracker's main fields. Does not initialize state 34 // Initializes the entity tracker's main fields. Does not initialize state
35 // related to a pending commit. 35 // related to a pending commit.
36 explicit WorkerEntityTracker(const std::string& client_tag_hash); 36 explicit WorkerEntityTracker(const std::string& client_tag_hash);
37 37
38 ~WorkerEntityTracker(); 38 ~WorkerEntityTracker();
39 39
40 // Returns true if this entity should be commited to the server. 40 // Returns true if this entity should be commited to the server.
41 bool HasPendingCommit() const; 41 bool HasPendingCommit() const;
42 42
43 // Returns true if pending commit contains deleted entity.
44 bool PendingCommitIsDeletion() const;
45
43 // Populates a sync_pb::SyncEntity for a commit. 46 // Populates a sync_pb::SyncEntity for a commit.
44 void PopulateCommitProto(sync_pb::SyncEntity* commit_entity) const; 47 void PopulateCommitProto(sync_pb::SyncEntity* commit_entity) const;
45 48
46 // Updates this entity with data from the latest version that the 49 // Updates this entity with data from the latest version that the
47 // model asked us to commit. May clobber state related to the 50 // model asked us to commit. May clobber state related to the
48 // model's previous commit attempt(s). 51 // model's previous commit attempt(s).
49 void RequestCommit(const CommitRequestData& data); 52 void RequestCommit(const CommitRequestData& data);
50 53
51 // Tracks the receipt of a commit response and fills in some local-only data 54 // Tracks the receipt of a commit response and fills in some local-only data
52 // on it to be passed back to the processor. 55 // on it to be passed back to the processor.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // of an pending update prevents commits. As of this writing, the only 121 // of an pending update prevents commits. As of this writing, the only
119 // source of pending updates is updates that can't currently be decrypted. 122 // source of pending updates is updates that can't currently be decrypted.
120 std::unique_ptr<UpdateResponseData> encrypted_update_; 123 std::unique_ptr<UpdateResponseData> encrypted_update_;
121 124
122 DISALLOW_COPY_AND_ASSIGN(WorkerEntityTracker); 125 DISALLOW_COPY_AND_ASSIGN(WorkerEntityTracker);
123 }; 126 };
124 127
125 } // namespace syncer 128 } // namespace syncer
126 129
127 #endif // COMPONENTS_SYNC_ENGINE_IMPL_WORKER_ENTITY_TRACKER_H_ 130 #endif // COMPONENTS_SYNC_ENGINE_IMPL_WORKER_ENTITY_TRACKER_H_
OLDNEW
« no previous file with comments | « components/sync/engine_impl/model_type_worker_unittest.cc ('k') | components/sync/engine_impl/worker_entity_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698