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_SHARED_MODEL_TYPE_PROCESSOR_H_ | 5 #ifndef COMPONENTS_SYNC_MODEL_IMPL_SHARED_MODEL_TYPE_PROCESSOR_H_ |
6 #define COMPONENTS_SYNC_MODEL_IMPL_SHARED_MODEL_TYPE_PROCESSOR_H_ | 6 #define COMPONENTS_SYNC_MODEL_IMPL_SHARED_MODEL_TYPE_PROCESSOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 const std::string& message) override; | 67 const std::string& message) override; |
68 | 68 |
69 // ModelTypeProcessor implementation. | 69 // ModelTypeProcessor implementation. |
70 void ConnectSync(std::unique_ptr<CommitQueue> worker) override; | 70 void ConnectSync(std::unique_ptr<CommitQueue> worker) override; |
71 void DisconnectSync() override; | 71 void DisconnectSync() override; |
72 void OnCommitCompleted(const sync_pb::ModelTypeState& type_state, | 72 void OnCommitCompleted(const sync_pb::ModelTypeState& type_state, |
73 const CommitResponseDataList& response_list) override; | 73 const CommitResponseDataList& response_list) override; |
74 void OnUpdateReceived(const sync_pb::ModelTypeState& type_state, | 74 void OnUpdateReceived(const sync_pb::ModelTypeState& type_state, |
75 const UpdateResponseDataList& updates) override; | 75 const UpdateResponseDataList& updates) override; |
76 | 76 |
| 77 // Returns the estimate of dynamically allocated memory in bytes. |
| 78 size_t EstimateMemoryUsage() const; |
| 79 |
77 private: | 80 private: |
78 friend class ModelTypeDebugInfo; | 81 friend class ModelTypeDebugInfo; |
79 friend class SharedModelTypeProcessorTest; | 82 friend class SharedModelTypeProcessorTest; |
80 | 83 |
81 // Returns true if the model is ready or encountered an error. | 84 // Returns true if the model is ready or encountered an error. |
82 bool IsModelReadyOrError() const; | 85 bool IsModelReadyOrError() const; |
83 | 86 |
84 // If preconditions are met, inform sync that we are ready to connect. | 87 // If preconditions are met, inform sync that we are ready to connect. |
85 void ConnectIfReady(); | 88 void ConnectIfReady(); |
86 | 89 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 210 |
208 // WeakPtrFactory for this processor which will be sent to sync thread. | 211 // WeakPtrFactory for this processor which will be sent to sync thread. |
209 base::WeakPtrFactory<SharedModelTypeProcessor> weak_ptr_factory_; | 212 base::WeakPtrFactory<SharedModelTypeProcessor> weak_ptr_factory_; |
210 | 213 |
211 DISALLOW_COPY_AND_ASSIGN(SharedModelTypeProcessor); | 214 DISALLOW_COPY_AND_ASSIGN(SharedModelTypeProcessor); |
212 }; | 215 }; |
213 | 216 |
214 } // namespace syncer | 217 } // namespace syncer |
215 | 218 |
216 #endif // COMPONENTS_SYNC_MODEL_IMPL_SHARED_MODEL_TYPE_PROCESSOR_H_ | 219 #endif // COMPONENTS_SYNC_MODEL_IMPL_SHARED_MODEL_TYPE_PROCESSOR_H_ |
OLD | NEW |