| 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 // Update storage_key_. | 103 // Update storage_key_. Allows setting storage key for datatypes that don't |
| 104 // This function should only be called by | 104 // generate storage key from syncer::EntityData. Should only be called for |
| 105 // ModelTypeChangeProcessor::UpdateStorageKey for the data type which does not | 105 // tracker initialized with empty storage key. |
| 106 // create storage key based on syncer::EntityData. | 106 void SetStorageKey(const std::string& storage_key); |
| 107 void SetStorageKey(const std::string& new_key); | |
| 108 | 107 |
| 109 // Takes the passed commit data updates its fields with values from metadata | 108 // Takes the passed commit data updates its fields with values from metadata |
| 110 // and caches it in the instance. The data is swapped from the input struct | 109 // and caches it in the instance. The data is swapped from the input struct |
| 111 // without copying. | 110 // without copying. |
| 112 void SetCommitData(EntityData* data); | 111 void SetCommitData(EntityData* data); |
| 113 | 112 |
| 114 // Caches the a copy of |data_ptr|, which doesn't copy the data itself. | 113 // Caches the a copy of |data_ptr|, which doesn't copy the data itself. |
| 115 void CacheCommitData(const EntityDataPtr& data_ptr); | 114 void CacheCommitData(const EntityDataPtr& data_ptr); |
| 116 | 115 |
| 117 // Check if the instance has cached commit data. | 116 // Check if the instance has cached commit data. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 // The data is reset once commit confirmation is received. | 153 // The data is reset once commit confirmation is received. |
| 155 EntityDataPtr commit_data_; | 154 EntityDataPtr commit_data_; |
| 156 | 155 |
| 157 // The sequence number of the last item sent to the sync thread. | 156 // The sequence number of the last item sent to the sync thread. |
| 158 int64_t commit_requested_sequence_number_; | 157 int64_t commit_requested_sequence_number_; |
| 159 }; | 158 }; |
| 160 | 159 |
| 161 } // namespace syncer | 160 } // namespace syncer |
| 162 | 161 |
| 163 #endif // COMPONENTS_SYNC_MODEL_IMPL_PROCESSOR_ENTITY_TRACKER_H_ | 162 #endif // COMPONENTS_SYNC_MODEL_IMPL_PROCESSOR_ENTITY_TRACKER_H_ |
| OLD | NEW |