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

Side by Side Diff: components/metrics/metrics_service.cc

Issue 2770853002: Create Ukm ReportingService implementation. (Closed)
Patch Set: Incorporate comments Created 3 years, 9 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 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 //------------------------------------------------------------------------------ 5 //------------------------------------------------------------------------------
6 // Description of the life cycle of a instance of MetricsService. 6 // Description of the life cycle of a instance of MetricsService.
7 // 7 //
8 // OVERVIEW 8 // OVERVIEW
9 // 9 //
10 // A MetricsService instance is typically created at application startup. It is 10 // A MetricsService instance is typically created at application startup. It is
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 // static 197 // static
198 MetricsService::ShutdownCleanliness MetricsService::clean_shutdown_status_ = 198 MetricsService::ShutdownCleanliness MetricsService::clean_shutdown_status_ =
199 MetricsService::CLEANLY_SHUTDOWN; 199 MetricsService::CLEANLY_SHUTDOWN;
200 200
201 // static 201 // static
202 void MetricsService::RegisterPrefs(PrefRegistrySimple* registry) { 202 void MetricsService::RegisterPrefs(PrefRegistrySimple* registry) {
203 CleanExitBeacon::RegisterPrefs(registry); 203 CleanExitBeacon::RegisterPrefs(registry);
204 MetricsStateManager::RegisterPrefs(registry); 204 MetricsStateManager::RegisterPrefs(registry);
205 MetricsLog::RegisterPrefs(registry); 205 MetricsLog::RegisterPrefs(registry);
206 StabilityMetricsProvider::RegisterPrefs(registry); 206 StabilityMetricsProvider::RegisterPrefs(registry);
207 DataUseTracker::RegisterPrefs(registry);
208 ExecutionPhaseManager::RegisterPrefs(registry); 207 ExecutionPhaseManager::RegisterPrefs(registry);
208 MetricsReportingService::RegisterPrefs(registry);
209 209
210 registry->RegisterInt64Pref(prefs::kInstallDate, 0); 210 registry->RegisterInt64Pref(prefs::kInstallDate, 0);
211 211
212 registry->RegisterIntegerPref(prefs::kMetricsSessionID, -1); 212 registry->RegisterIntegerPref(prefs::kMetricsSessionID, -1);
213 213
214 registry->RegisterListPref(prefs::kMetricsInitialLogs);
215 registry->RegisterListPref(prefs::kMetricsOngoingLogs);
216
217 registry->RegisterInt64Pref(prefs::kUninstallLaunchCount, 0); 214 registry->RegisterInt64Pref(prefs::kUninstallLaunchCount, 0);
218 registry->RegisterInt64Pref(prefs::kUninstallMetricsUptimeSec, 0); 215 registry->RegisterInt64Pref(prefs::kUninstallMetricsUptimeSec, 0);
219 } 216 }
220 217
221 MetricsService::MetricsService(MetricsStateManager* state_manager, 218 MetricsService::MetricsService(MetricsStateManager* state_manager,
222 MetricsServiceClient* client, 219 MetricsServiceClient* client,
223 PrefService* local_state) 220 PrefService* local_state)
224 : reporting_service_(client, local_state), 221 : reporting_service_(client, local_state),
225 histogram_snapshot_manager_(this), 222 histogram_snapshot_manager_(this),
226 state_manager_(state_manager), 223 state_manager_(state_manager),
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 // Redundant setting to assure that we always reset this value at shutdown 995 // Redundant setting to assure that we always reset this value at shutdown
999 // (and that we don't use some alternate path, and not call LogCleanShutdown). 996 // (and that we don't use some alternate path, and not call LogCleanShutdown).
1000 clean_shutdown_status_ = CLEANLY_SHUTDOWN; 997 clean_shutdown_status_ = CLEANLY_SHUTDOWN;
1001 client_->OnLogCleanShutdown(); 998 client_->OnLogCleanShutdown();
1002 clean_exit_beacon_.WriteBeaconValue(true); 999 clean_exit_beacon_.WriteBeaconValue(true);
1003 SetExecutionPhase(ExecutionPhase::SHUTDOWN_COMPLETE, local_state_); 1000 SetExecutionPhase(ExecutionPhase::SHUTDOWN_COMPLETE, local_state_);
1004 StabilityMetricsProvider(local_state_).MarkSessionEndCompleted(end_completed); 1001 StabilityMetricsProvider(local_state_).MarkSessionEndCompleted(end_completed);
1005 } 1002 }
1006 1003
1007 } // namespace metrics 1004 } // namespace metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698