| 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 SYNC_INTERNAL_API_PUBLIC_PROCESSOR_ENTITY_TRACKER_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_PROCESSOR_ENTITY_TRACKER_H_ |
| 6 #define SYNC_INTERNAL_API_PUBLIC_PROCESSOR_ENTITY_TRACKER_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_PROCESSOR_ENTITY_TRACKER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // Clears any in-memory sync state associated with outstanding commits. | 109 // Clears any in-memory sync state associated with outstanding commits. |
| 110 void ClearTransientSyncState(); | 110 void ClearTransientSyncState(); |
| 111 | 111 |
| 112 // Takes the passed commit data and caches it in the instance. | 112 // Takes the passed commit data and caches it in the instance. |
| 113 // The data is swapped from the input struct without copying. | 113 // The data is swapped from the input struct without copying. |
| 114 void CacheCommitData(EntityData* data); | 114 void CacheCommitData(EntityData* data); |
| 115 | 115 |
| 116 // Check if the instance has cached commit data. | 116 // Check if the instance has cached commit data. |
| 117 bool HasCommitData() const; | 117 bool HasCommitData() const; |
| 118 | 118 |
| 119 // Check whether |specifics| matches the stored specifics_hash. |
| 120 bool MatchesSpecificsHash(const sync_pb::EntitySpecifics& specifics) const; |
| 121 |
| 119 private: | 122 private: |
| 120 friend class ProcessorEntityTrackerTest; | 123 friend class ProcessorEntityTrackerTest; |
| 121 | 124 |
| 122 // The constructor swaps the data from the passed metadata. | 125 // The constructor swaps the data from the passed metadata. |
| 123 ProcessorEntityTracker(const std::string& client_tag, | 126 ProcessorEntityTracker(const std::string& client_tag, |
| 124 sync_pb::EntityMetadata* metadata); | 127 sync_pb::EntityMetadata* metadata); |
| 125 | 128 |
| 126 // Whether knowledge of this entity has never gone past the processor. This | 129 // Whether knowledge of this entity has never gone past the processor. This |
| 127 // means that no commits have been queued and it did not originate at the | 130 // means that no commits have been queued and it did not originate at the |
| 128 // server. This is used to determine whether it is safe to delete the tracker | 131 // server. This is used to determine whether it is safe to delete the tracker |
| (...skipping 21 matching lines...) Expand all Loading... |
| 150 | 153 |
| 151 // TODO(stanisc): this should be removed. | 154 // TODO(stanisc): this should be removed. |
| 152 // The name of the encryption key used to encrypt this item on the server. | 155 // The name of the encryption key used to encrypt this item on the server. |
| 153 // Empty when no encryption is in use. | 156 // Empty when no encryption is in use. |
| 154 std::string encryption_key_name_; | 157 std::string encryption_key_name_; |
| 155 }; | 158 }; |
| 156 | 159 |
| 157 } // namespace syncer_v2 | 160 } // namespace syncer_v2 |
| 158 | 161 |
| 159 #endif // SYNC_INTERNAL_API_PUBLIC_PROCESSOR_ENTITY_TRACKER_H_ | 162 #endif // SYNC_INTERNAL_API_PUBLIC_PROCESSOR_ENTITY_TRACKER_H_ |
| OLD | NEW |