| 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_MODEL_IMPL_PROCESSOR_ENTITY_TRACKER_H_ | 5 #ifndef COMPONENTS_SYNC_MODEL_IMPL_PROCESSOR_ENTITY_TRACKER_H_ |
| 6 #define COMPONENTS_SYNC_MODEL_IMPL_PROCESSOR_ENTITY_TRACKER_H_ | 6 #define COMPONENTS_SYNC_MODEL_IMPL_PROCESSOR_ENTITY_TRACKER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // | 93 // |
| 94 // Note that the receipt of a successful commit response does not necessarily | 94 // Note that the receipt of a successful commit response does not necessarily |
| 95 // unset IsUnsynced(). If many local changes occur in quick succession, it's | 95 // unset IsUnsynced(). If many local changes occur in quick succession, it's |
| 96 // possible that the committed item was already out of date by the time it | 96 // possible that the committed item was already out of date by the time it |
| 97 // reached the server. | 97 // reached the server. |
| 98 void ReceiveCommitResponse(const CommitResponseData& data); | 98 void ReceiveCommitResponse(const CommitResponseData& data); |
| 99 | 99 |
| 100 // Clears any in-memory sync state associated with outstanding commits. | 100 // Clears any in-memory sync state associated with outstanding commits. |
| 101 void ClearTransientSyncState(); | 101 void ClearTransientSyncState(); |
| 102 | 102 |
| 103 // Takes the passed commit data and caches it in the instance. | 103 // Takes the passed commit data updates its fields with values from metadata |
| 104 // The data is swapped from the input struct without copying. | 104 // and caches it in the instance. The data is swapped from the input struct |
| 105 void CacheCommitData(EntityData* data); | 105 // without copying. |
| 106 void SetCommitData(EntityData* data); |
| 106 | 107 |
| 107 // Caches the a copy of |data_ptr|, which doesn't copy the data itself. | 108 // Caches the a copy of |data_ptr|, which doesn't copy the data itself. |
| 108 void CacheCommitData(const EntityDataPtr& data_ptr); | 109 void CacheCommitData(const EntityDataPtr& data_ptr); |
| 109 | 110 |
| 110 // Check if the instance has cached commit data. | 111 // Check if the instance has cached commit data. |
| 111 bool HasCommitData() const; | 112 bool HasCommitData() const; |
| 112 | 113 |
| 113 // Check whether |data| matches the stored specifics hash. | 114 // Check whether |data| matches the stored specifics hash. |
| 114 bool MatchesData(const EntityData& data) const; | 115 bool MatchesData(const EntityData& data) const; |
| 115 | 116 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 144 // The data is reset once commit confirmation is received. | 145 // The data is reset once commit confirmation is received. |
| 145 EntityDataPtr commit_data_; | 146 EntityDataPtr commit_data_; |
| 146 | 147 |
| 147 // The sequence number of the last item sent to the sync thread. | 148 // The sequence number of the last item sent to the sync thread. |
| 148 int64_t commit_requested_sequence_number_; | 149 int64_t commit_requested_sequence_number_; |
| 149 }; | 150 }; |
| 150 | 151 |
| 151 } // namespace syncer | 152 } // namespace syncer |
| 152 | 153 |
| 153 #endif // COMPONENTS_SYNC_MODEL_IMPL_PROCESSOR_ENTITY_TRACKER_H_ | 154 #endif // COMPONENTS_SYNC_MODEL_IMPL_PROCESSOR_ENTITY_TRACKER_H_ |
| OLD | NEW |