| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 registry->RegisterStringPref(prefs::kStabilityStatsVersion, std::string()); | 313 registry->RegisterStringPref(prefs::kStabilityStatsVersion, std::string()); |
| 314 registry->RegisterInt64Pref(prefs::kStabilityStatsBuildTime, 0); | 314 registry->RegisterInt64Pref(prefs::kStabilityStatsBuildTime, 0); |
| 315 registry->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); | 315 registry->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); |
| 316 registry->RegisterIntegerPref(prefs::kStabilityExecutionPhase, | 316 registry->RegisterIntegerPref(prefs::kStabilityExecutionPhase, |
| 317 UNINITIALIZED_PHASE); | 317 UNINITIALIZED_PHASE); |
| 318 registry->RegisterBooleanPref(prefs::kStabilitySessionEndCompleted, true); | 318 registry->RegisterBooleanPref(prefs::kStabilitySessionEndCompleted, true); |
| 319 registry->RegisterIntegerPref(metrics::prefs::kMetricsSessionID, -1); | 319 registry->RegisterIntegerPref(metrics::prefs::kMetricsSessionID, -1); |
| 320 | 320 |
| 321 registry->RegisterListPref(metrics::prefs::kMetricsInitialLogs); | 321 registry->RegisterListPref(metrics::prefs::kMetricsInitialLogs); |
| 322 registry->RegisterListPref(metrics::prefs::kMetricsOngoingLogs); | 322 registry->RegisterListPref(metrics::prefs::kMetricsOngoingLogs); |
| 323 registry->RegisterListPref(metrics::prefs::kMetricsInitialLogsOld); |
| 324 registry->RegisterListPref(metrics::prefs::kMetricsOngoingLogsOld); |
| 323 | 325 |
| 324 registry->RegisterInt64Pref(prefs::kInstallDate, 0); | 326 registry->RegisterInt64Pref(prefs::kInstallDate, 0); |
| 325 registry->RegisterInt64Pref(prefs::kUninstallLaunchCount, 0); | 327 registry->RegisterInt64Pref(prefs::kUninstallLaunchCount, 0); |
| 326 registry->RegisterInt64Pref(prefs::kUninstallMetricsUptimeSec, 0); | 328 registry->RegisterInt64Pref(prefs::kUninstallMetricsUptimeSec, 0); |
| 327 registry->RegisterInt64Pref(prefs::kUninstallLastLaunchTimeSec, 0); | 329 registry->RegisterInt64Pref(prefs::kUninstallLastLaunchTimeSec, 0); |
| 328 registry->RegisterInt64Pref(prefs::kUninstallLastObservedRunTimeSec, 0); | 330 registry->RegisterInt64Pref(prefs::kUninstallLastObservedRunTimeSec, 0); |
| 329 | 331 |
| 330 // TODO(asvitkine): Move this out of here. | 332 // TODO(asvitkine): Move this out of here. |
| 331 ChromeStabilityMetricsProvider::RegisterPrefs(registry); | 333 ChromeStabilityMetricsProvider::RegisterPrefs(registry); |
| 332 | 334 |
| (...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1312 local_state_->SetBoolean(path, value); | 1314 local_state_->SetBoolean(path, value); |
| 1313 RecordCurrentState(local_state_); | 1315 RecordCurrentState(local_state_); |
| 1314 } | 1316 } |
| 1315 | 1317 |
| 1316 void MetricsService::RecordCurrentState(PrefService* pref) { | 1318 void MetricsService::RecordCurrentState(PrefService* pref) { |
| 1317 pref->SetInt64(prefs::kStabilityLastTimestampSec, Time::Now().ToTimeT()); | 1319 pref->SetInt64(prefs::kStabilityLastTimestampSec, Time::Now().ToTimeT()); |
| 1318 | 1320 |
| 1319 for (size_t i = 0; i < metrics_providers_.size(); ++i) | 1321 for (size_t i = 0; i < metrics_providers_.size(); ++i) |
| 1320 metrics_providers_[i]->RecordCurrentState(); | 1322 metrics_providers_[i]->RecordCurrentState(); |
| 1321 } | 1323 } |
| OLD | NEW |