OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_MODEL_TYPE_DEBUG_INFO_H_ | 5 #ifndef COMPONENTS_SYNC_MODEL_MODEL_TYPE_DEBUG_INFO_H_ |
6 #define COMPONENTS_SYNC_MODEL_MODEL_TYPE_DEBUG_INFO_H_ | 6 #define COMPONENTS_SYNC_MODEL_MODEL_TYPE_DEBUG_INFO_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 std::unique_ptr<base::ListValue>)>& callback, | 28 std::unique_ptr<base::ListValue>)>& callback, |
29 ModelTypeSyncBridge* bridge); | 29 ModelTypeSyncBridge* bridge); |
30 | 30 |
31 // Returns StatusCounters for the type to |callback|. | 31 // Returns StatusCounters for the type to |callback|. |
32 // Used for updating data type counters in chrome://sync-internals. | 32 // Used for updating data type counters in chrome://sync-internals. |
33 static void GetStatusCounters( | 33 static void GetStatusCounters( |
34 const base::Callback<void(const ModelType, const StatusCounters&)>& | 34 const base::Callback<void(const ModelType, const StatusCounters&)>& |
35 callback, | 35 callback, |
36 ModelTypeSyncBridge* bridge); | 36 ModelTypeSyncBridge* bridge); |
37 | 37 |
| 38 // Queries |bridge| for estimate of memory usage and records it in a |
| 39 // histogram. |
| 40 static void RecordMemoryUsageHistogram(ModelTypeSyncBridge* bridge); |
| 41 |
38 private: | 42 private: |
39 ModelTypeDebugInfo(); | 43 ModelTypeDebugInfo(); |
40 | 44 |
41 // This is callback function for ModelTypeSyncBridge::GetAllData. This | 45 // This is callback function for ModelTypeSyncBridge::GetAllData. This |
42 // function will merge real data from |batch| with metadata extracted from | 46 // function will merge real data from |batch| with metadata extracted from |
43 // the |processor|, then pass it all to |callback|. | 47 // the |processor|, then pass it all to |callback|. |
44 static void MergeDataWithMetadata( | 48 static void MergeDataWithMetadata( |
45 SharedModelTypeProcessor* processor, | 49 SharedModelTypeProcessor* processor, |
46 const base::Callback<void(const ModelType, | 50 const base::Callback<void(const ModelType, |
47 std::unique_ptr<base::ListValue>)>& callback, | 51 std::unique_ptr<base::ListValue>)>& callback, |
48 std::unique_ptr<DataBatch> batch); | 52 std::unique_ptr<DataBatch> batch); |
49 }; | 53 }; |
50 | 54 |
51 } // namespace syncer | 55 } // namespace syncer |
52 | 56 |
53 #endif // COMPONENTS_SYNC_MODEL_MODEL_TYPE_DEBUG_INFO_H_ | 57 #endif // COMPONENTS_SYNC_MODEL_MODEL_TYPE_DEBUG_INFO_H_ |
OLD | NEW |