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_DRIVER_DATA_TYPE_CONTROLLER_H__ | 5 #ifndef COMPONENTS_SYNC_DRIVER_DATA_TYPE_CONTROLLER_H__ |
6 #define COMPONENTS_SYNC_DRIVER_DATA_TYPE_CONTROLLER_H__ | 6 #define COMPONENTS_SYNC_DRIVER_DATA_TYPE_CONTROLLER_H__ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // Returns a ListValue representing all nodes for this data type through | 155 // Returns a ListValue representing all nodes for this data type through |
156 // |callback| on this thread. | 156 // |callback| on this thread. |
157 // Used for populating nodes in Sync Node Browser of chrome://sync-internals. | 157 // Used for populating nodes in Sync Node Browser of chrome://sync-internals. |
158 virtual void GetAllNodes(const AllNodesCallback& callback) = 0; | 158 virtual void GetAllNodes(const AllNodesCallback& callback) = 0; |
159 | 159 |
160 // Collects StatusCounters for this datatype and passes them to |callback|, | 160 // Collects StatusCounters for this datatype and passes them to |callback|, |
161 // which should be wrapped with syncer::BindToCurrentThread already. | 161 // which should be wrapped with syncer::BindToCurrentThread already. |
162 // Used to display entity counts in chrome://sync-internals. | 162 // Used to display entity counts in chrome://sync-internals. |
163 virtual void GetStatusCounters(const StatusCountersCallback& callback) = 0; | 163 virtual void GetStatusCounters(const StatusCountersCallback& callback) = 0; |
164 | 164 |
| 165 // Estimates memory usage of type and records it into histogram. |
| 166 virtual void RecordMemoryUsageHistogram() = 0; |
| 167 |
165 protected: | 168 protected: |
166 explicit DataTypeController(ModelType type); | 169 explicit DataTypeController(ModelType type); |
167 | 170 |
168 // Allows subclasses to DCHECK that they're on the correct thread. | 171 // Allows subclasses to DCHECK that they're on the correct thread. |
169 bool CalledOnValidThread() const; | 172 bool CalledOnValidThread() const; |
170 | 173 |
171 private: | 174 private: |
172 // The type this object is responsible for controlling. | 175 // The type this object is responsible for controlling. |
173 const ModelType type_; | 176 const ModelType type_; |
174 | 177 |
175 // Used to check that functions are called on the correct thread. | 178 // Used to check that functions are called on the correct thread. |
176 base::ThreadChecker thread_checker_; | 179 base::ThreadChecker thread_checker_; |
177 }; | 180 }; |
178 | 181 |
179 } // namespace syncer | 182 } // namespace syncer |
180 | 183 |
181 #endif // COMPONENTS_SYNC_DRIVER_DATA_TYPE_CONTROLLER_H__ | 184 #endif // COMPONENTS_SYNC_DRIVER_DATA_TYPE_CONTROLLER_H__ |
OLD | NEW |