| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 registry->RegisterStringPref(prefs::kStabilityStatsVersion, std::string()); | 293 registry->RegisterStringPref(prefs::kStabilityStatsVersion, std::string()); |
| 294 registry->RegisterInt64Pref(prefs::kStabilityStatsBuildTime, 0); | 294 registry->RegisterInt64Pref(prefs::kStabilityStatsBuildTime, 0); |
| 295 registry->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); | 295 registry->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); |
| 296 registry->RegisterIntegerPref(prefs::kStabilityExecutionPhase, | 296 registry->RegisterIntegerPref(prefs::kStabilityExecutionPhase, |
| 297 UNINITIALIZED_PHASE); | 297 UNINITIALIZED_PHASE); |
| 298 registry->RegisterBooleanPref(prefs::kStabilitySessionEndCompleted, true); | 298 registry->RegisterBooleanPref(prefs::kStabilitySessionEndCompleted, true); |
| 299 registry->RegisterIntegerPref(metrics::prefs::kMetricsSessionID, -1); | 299 registry->RegisterIntegerPref(metrics::prefs::kMetricsSessionID, -1); |
| 300 | 300 |
| 301 registry->RegisterListPref(metrics::prefs::kMetricsInitialLogs); | 301 registry->RegisterListPref(metrics::prefs::kMetricsInitialLogs); |
| 302 registry->RegisterListPref(metrics::prefs::kMetricsOngoingLogs); | 302 registry->RegisterListPref(metrics::prefs::kMetricsOngoingLogs); |
| 303 registry->RegisterListPref(metrics::prefs::kMetricsInitialLogsOld); |
| 304 registry->RegisterListPref(metrics::prefs::kMetricsOngoingLogsOld); |
| 303 | 305 |
| 304 registry->RegisterInt64Pref(prefs::kInstallDate, 0); | 306 registry->RegisterInt64Pref(prefs::kInstallDate, 0); |
| 305 registry->RegisterInt64Pref(prefs::kUninstallLaunchCount, 0); | 307 registry->RegisterInt64Pref(prefs::kUninstallLaunchCount, 0); |
| 306 registry->RegisterInt64Pref(prefs::kUninstallMetricsUptimeSec, 0); | 308 registry->RegisterInt64Pref(prefs::kUninstallMetricsUptimeSec, 0); |
| 307 registry->RegisterInt64Pref(prefs::kUninstallLastLaunchTimeSec, 0); | 309 registry->RegisterInt64Pref(prefs::kUninstallLastLaunchTimeSec, 0); |
| 308 registry->RegisterInt64Pref(prefs::kUninstallLastObservedRunTimeSec, 0); | 310 registry->RegisterInt64Pref(prefs::kUninstallLastObservedRunTimeSec, 0); |
| 309 } | 311 } |
| 310 | 312 |
| 311 MetricsService::MetricsService(metrics::MetricsStateManager* state_manager, | 313 MetricsService::MetricsService(metrics::MetricsStateManager* state_manager, |
| 312 metrics::MetricsServiceClient* client, | 314 metrics::MetricsServiceClient* client, |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1193 local_state_->SetBoolean(path, value); | 1195 local_state_->SetBoolean(path, value); |
| 1194 RecordCurrentState(local_state_); | 1196 RecordCurrentState(local_state_); |
| 1195 } | 1197 } |
| 1196 | 1198 |
| 1197 void MetricsService::RecordCurrentState(PrefService* pref) { | 1199 void MetricsService::RecordCurrentState(PrefService* pref) { |
| 1198 pref->SetInt64(prefs::kStabilityLastTimestampSec, Time::Now().ToTimeT()); | 1200 pref->SetInt64(prefs::kStabilityLastTimestampSec, Time::Now().ToTimeT()); |
| 1199 | 1201 |
| 1200 for (size_t i = 0; i < metrics_providers_.size(); ++i) | 1202 for (size_t i = 0; i < metrics_providers_.size(); ++i) |
| 1201 metrics_providers_[i]->RecordCurrentState(); | 1203 metrics_providers_[i]->RecordCurrentState(); |
| 1202 } | 1204 } |
| OLD | NEW |