Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Side by Side Diff: components/sync/model/model_type_debug_info.h

Issue 2949923004: Reland: [Sync] Record sync memory usage in histogram broken by datatypes (Closed)
Patch Set: Fix linker error Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « components/sync/driver/proxy_data_type_controller.cc ('k') | components/sync/model/model_type_debug_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698