| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |