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

Unified Diff: components/browser_sync/profile_sync_service.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/browser_sync/profile_sync_service.h ('k') | components/sync/base/data_type_histogram.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/browser_sync/profile_sync_service.cc
diff --git a/components/browser_sync/profile_sync_service.cc b/components/browser_sync/profile_sync_service.cc
index 82d560c33d237c1a082f53269b8445e3ac31e7a9..d92d68e3ccd16ba26a46d8b91a0a39937039b448 100644
--- a/components/browser_sync/profile_sync_service.cc
+++ b/components/browser_sync/profile_sync_service.cc
@@ -1301,6 +1301,8 @@ void ProfileSyncService::OnConfigureDone(
return;
}
+ RecordMemoryUsageHistograms();
+
StartSyncingWithServer();
}
@@ -2393,6 +2395,16 @@ void ProfileSyncService::ReportPreviousSessionMemoryWarningCount() {
sync_prefs_.SetCleanShutdown(false);
}
+void ProfileSyncService::RecordMemoryUsageHistograms() {
+ ModelTypeSet active_types = GetActiveDataTypes();
+ for (ModelTypeSet::Iterator type_it = active_types.First(); type_it.Good();
+ type_it.Inc()) {
+ auto dtc_it = data_type_controllers_.find(type_it.Get());
+ if (dtc_it != data_type_controllers_.end())
+ dtc_it->second->RecordMemoryUsageHistogram();
+ }
+}
+
const GURL& ProfileSyncService::sync_service_url() const {
DCHECK(thread_checker_.CalledOnValidThread());
return sync_service_url_;
« no previous file with comments | « components/browser_sync/profile_sync_service.h ('k') | components/sync/base/data_type_histogram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698