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 //------------------------------------------------------------------------------ | 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 Loading... |
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 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 // Redundant setting to assure that we always reset this value at shutdown | 993 // Redundant setting to assure that we always reset this value at shutdown |
997 // (and that we don't use some alternate path, and not call LogCleanShutdown). | 994 // (and that we don't use some alternate path, and not call LogCleanShutdown). |
998 clean_shutdown_status_ = CLEANLY_SHUTDOWN; | 995 clean_shutdown_status_ = CLEANLY_SHUTDOWN; |
999 client_->OnLogCleanShutdown(); | 996 client_->OnLogCleanShutdown(); |
1000 clean_exit_beacon_.WriteBeaconValue(true); | 997 clean_exit_beacon_.WriteBeaconValue(true); |
1001 SetExecutionPhase(ExecutionPhase::SHUTDOWN_COMPLETE, local_state_); | 998 SetExecutionPhase(ExecutionPhase::SHUTDOWN_COMPLETE, local_state_); |
1002 StabilityMetricsProvider(local_state_).MarkSessionEndCompleted(end_completed); | 999 StabilityMetricsProvider(local_state_).MarkSessionEndCompleted(end_completed); |
1003 } | 1000 } |
1004 | 1001 |
1005 } // namespace metrics | 1002 } // namespace metrics |
OLD | NEW |