| 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 | 10 // A MetricsService instance is typically created at application startup. It |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 private: | 384 private: |
| 385 virtual ~MetricsMemoryDetails() {} | 385 virtual ~MetricsMemoryDetails() {} |
| 386 | 386 |
| 387 base::Closure callback_; | 387 base::Closure callback_; |
| 388 DISALLOW_COPY_AND_ASSIGN(MetricsMemoryDetails); | 388 DISALLOW_COPY_AND_ASSIGN(MetricsMemoryDetails); |
| 389 }; | 389 }; |
| 390 | 390 |
| 391 // static | 391 // static |
| 392 void MetricsService::RegisterPrefs(PrefRegistrySimple* registry) { | 392 void MetricsService::RegisterPrefs(PrefRegistrySimple* registry) { |
| 393 DCHECK(IsSingleThreaded()); | 393 DCHECK(IsSingleThreaded()); |
| 394 registry->RegisterStringPref(prefs::kMetricsClientID, ""); | 394 registry->RegisterStringPref(prefs::kMetricsClientID, std::string()); |
| 395 registry->RegisterIntegerPref(prefs::kMetricsLowEntropySource, | 395 registry->RegisterIntegerPref(prefs::kMetricsLowEntropySource, |
| 396 kLowEntropySourceNotSet); | 396 kLowEntropySourceNotSet); |
| 397 registry->RegisterInt64Pref(prefs::kMetricsClientIDTimestamp, 0); | 397 registry->RegisterInt64Pref(prefs::kMetricsClientIDTimestamp, 0); |
| 398 registry->RegisterInt64Pref(prefs::kStabilityLaunchTimeSec, 0); | 398 registry->RegisterInt64Pref(prefs::kStabilityLaunchTimeSec, 0); |
| 399 registry->RegisterInt64Pref(prefs::kStabilityLastTimestampSec, 0); | 399 registry->RegisterInt64Pref(prefs::kStabilityLastTimestampSec, 0); |
| 400 registry->RegisterStringPref(prefs::kStabilityStatsVersion, ""); | 400 registry->RegisterStringPref(prefs::kStabilityStatsVersion, std::string()); |
| 401 registry->RegisterInt64Pref(prefs::kStabilityStatsBuildTime, 0); | 401 registry->RegisterInt64Pref(prefs::kStabilityStatsBuildTime, 0); |
| 402 registry->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); | 402 registry->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); |
| 403 registry->RegisterBooleanPref(prefs::kStabilitySessionEndCompleted, true); | 403 registry->RegisterBooleanPref(prefs::kStabilitySessionEndCompleted, true); |
| 404 registry->RegisterIntegerPref(prefs::kMetricsSessionID, -1); | 404 registry->RegisterIntegerPref(prefs::kMetricsSessionID, -1); |
| 405 registry->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0); | 405 registry->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0); |
| 406 registry->RegisterIntegerPref(prefs::kStabilityCrashCount, 0); | 406 registry->RegisterIntegerPref(prefs::kStabilityCrashCount, 0); |
| 407 registry->RegisterIntegerPref(prefs::kStabilityIncompleteSessionEndCount, 0); | 407 registry->RegisterIntegerPref(prefs::kStabilityIncompleteSessionEndCount, 0); |
| 408 registry->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0); | 408 registry->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0); |
| 409 registry->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); | 409 registry->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); |
| 410 registry->RegisterIntegerPref(prefs::kStabilityExtensionRendererCrashCount, | 410 registry->RegisterIntegerPref(prefs::kStabilityExtensionRendererCrashCount, |
| (...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1870 if (local_state) { | 1870 if (local_state) { |
| 1871 const PrefService::Preference* uma_pref = | 1871 const PrefService::Preference* uma_pref = |
| 1872 local_state->FindPreference(prefs::kMetricsReportingEnabled); | 1872 local_state->FindPreference(prefs::kMetricsReportingEnabled); |
| 1873 if (uma_pref) { | 1873 if (uma_pref) { |
| 1874 bool success = uma_pref->GetValue()->GetAsBoolean(&result); | 1874 bool success = uma_pref->GetValue()->GetAsBoolean(&result); |
| 1875 DCHECK(success); | 1875 DCHECK(success); |
| 1876 } | 1876 } |
| 1877 } | 1877 } |
| 1878 return result; | 1878 return result; |
| 1879 } | 1879 } |
| OLD | NEW |