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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // is out of date. | 68 // is out of date. |
69 bool ReceiveEncryptedUpdate(const UpdateResponseData& data); | 69 bool ReceiveEncryptedUpdate(const UpdateResponseData& data); |
70 | 70 |
71 // Functions to fetch the latest encrypted update. | 71 // Functions to fetch the latest encrypted update. |
72 bool HasEncryptedUpdate() const; | 72 bool HasEncryptedUpdate() const; |
73 UpdateResponseData GetEncryptedUpdate() const; | 73 UpdateResponseData GetEncryptedUpdate() const; |
74 | 74 |
75 // Clears the encrypted update. Allows us to resume regular commit behavior. | 75 // Clears the encrypted update. Allows us to resume regular commit behavior. |
76 void ClearEncryptedUpdate(); | 76 void ClearEncryptedUpdate(); |
77 | 77 |
| 78 // Returns the estimate of dynamically allocated memory in bytes. |
| 79 size_t EstimateMemoryUsage() const; |
| 80 |
78 const std::string& id() const { return id_; } | 81 const std::string& id() const { return id_; } |
79 const std::string& client_tag_hash() const { return client_tag_hash_; } | 82 const std::string& client_tag_hash() const { return client_tag_hash_; } |
80 | 83 |
81 private: | 84 private: |
82 // Checks if the current state indicates a conflict. | 85 // Checks if the current state indicates a conflict. |
83 // | 86 // |
84 // This can be true only while a call to this object is in progress. | 87 // This can be true only while a call to this object is in progress. |
85 // Conflicts are always cleared before the method call ends. | 88 // Conflicts are always cleared before the method call ends. |
86 bool IsInConflict() const; | 89 bool IsInConflict() const; |
87 | 90 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // of an pending update prevents commits. As of this writing, the only | 124 // of an pending update prevents commits. As of this writing, the only |
122 // source of pending updates is updates that can't currently be decrypted. | 125 // source of pending updates is updates that can't currently be decrypted. |
123 std::unique_ptr<UpdateResponseData> encrypted_update_; | 126 std::unique_ptr<UpdateResponseData> encrypted_update_; |
124 | 127 |
125 DISALLOW_COPY_AND_ASSIGN(WorkerEntityTracker); | 128 DISALLOW_COPY_AND_ASSIGN(WorkerEntityTracker); |
126 }; | 129 }; |
127 | 130 |
128 } // namespace syncer | 131 } // namespace syncer |
129 | 132 |
130 #endif // COMPONENTS_SYNC_ENGINE_IMPL_WORKER_ENTITY_TRACKER_H_ | 133 #endif // COMPONENTS_SYNC_ENGINE_IMPL_WORKER_ENTITY_TRACKER_H_ |
OLD | NEW |