| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 bool MatchesData(const EntityData& data) const; | 115 bool MatchesData(const EntityData& data) const; |
| 116 | 116 |
| 117 // Check whether |data| matches the stored base (shared between client and | 117 // Check whether |data| matches the stored base (shared between client and |
| 118 // server) specifics hash. | 118 // server) specifics hash. |
| 119 bool MatchesBaseData(const EntityData& data) const; | 119 bool MatchesBaseData(const EntityData& data) const; |
| 120 | 120 |
| 121 // Increment sequence number in the metadata. This will also update the | 121 // Increment sequence number in the metadata. This will also update the |
| 122 // base_specifics_hash if the entity was not already unsynced. | 122 // base_specifics_hash if the entity was not already unsynced. |
| 123 void IncrementSequenceNumber(); | 123 void IncrementSequenceNumber(); |
| 124 | 124 |
| 125 // Returns the estimate of dynamically allocated memory in bytes. |
| 126 size_t EstimateMemoryUsage() const; |
| 127 |
| 125 private: | 128 private: |
| 126 friend class ProcessorEntityTrackerTest; | 129 friend class ProcessorEntityTrackerTest; |
| 127 | 130 |
| 128 // The constructor swaps the data from the passed metadata. | 131 // The constructor swaps the data from the passed metadata. |
| 129 ProcessorEntityTracker(const std::string& storage_key, | 132 ProcessorEntityTracker(const std::string& storage_key, |
| 130 sync_pb::EntityMetadata* metadata); | 133 sync_pb::EntityMetadata* metadata); |
| 131 | 134 |
| 132 // Check whether |specifics| matches the stored specifics_hash. | 135 // Check whether |specifics| matches the stored specifics_hash. |
| 133 bool MatchesSpecificsHash(const sync_pb::EntitySpecifics& specifics) const; | 136 bool MatchesSpecificsHash(const sync_pb::EntitySpecifics& specifics) const; |
| 134 | 137 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 145 // The data is reset once commit confirmation is received. | 148 // The data is reset once commit confirmation is received. |
| 146 EntityDataPtr commit_data_; | 149 EntityDataPtr commit_data_; |
| 147 | 150 |
| 148 // The sequence number of the last item sent to the sync thread. | 151 // The sequence number of the last item sent to the sync thread. |
| 149 int64_t commit_requested_sequence_number_; | 152 int64_t commit_requested_sequence_number_; |
| 150 }; | 153 }; |
| 151 | 154 |
| 152 } // namespace syncer | 155 } // namespace syncer |
| 153 | 156 |
| 154 #endif // COMPONENTS_SYNC_MODEL_IMPL_PROCESSOR_ENTITY_TRACKER_H_ | 157 #endif // COMPONENTS_SYNC_MODEL_IMPL_PROCESSOR_ENTITY_TRACKER_H_ |
| OLD | NEW |