OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1473 | 1473 |
1474 void MetricsService::LogExtensionRendererCrash() { | 1474 void MetricsService::LogExtensionRendererCrash() { |
1475 IncrementPrefValue(prefs::kStabilityExtensionRendererCrashCount); | 1475 IncrementPrefValue(prefs::kStabilityExtensionRendererCrashCount); |
1476 } | 1476 } |
1477 | 1477 |
1478 void MetricsService::LogRendererHang() { | 1478 void MetricsService::LogRendererHang() { |
1479 IncrementPrefValue(prefs::kStabilityRendererHangCount); | 1479 IncrementPrefValue(prefs::kStabilityRendererHangCount); |
1480 } | 1480 } |
1481 | 1481 |
1482 void MetricsService::LogCleanShutdown() { | 1482 void MetricsService::LogCleanShutdown() { |
1483 // Redundant hack to write pref ASAP. | |
wtc
2011/09/06 17:44:22
Would be nice to say why you want to write pref AS
| |
1484 PrefService* pref = g_browser_process->local_state(); | |
1485 pref->SetBoolean(prefs::kStabilityExitedCleanly, true); | |
1486 pref->SavePersistentPrefs(); | |
1487 // End of redundant hack. | |
1488 | |
1483 RecordBooleanPrefValue(prefs::kStabilityExitedCleanly, true); | 1489 RecordBooleanPrefValue(prefs::kStabilityExitedCleanly, true); |
1484 } | 1490 } |
1485 | 1491 |
1486 #if defined(OS_CHROMEOS) | 1492 #if defined(OS_CHROMEOS) |
1487 void MetricsService::LogChromeOSCrash(const std::string &crash_type) { | 1493 void MetricsService::LogChromeOSCrash(const std::string &crash_type) { |
1488 if (crash_type == "user") | 1494 if (crash_type == "user") |
1489 IncrementPrefValue(prefs::kStabilityOtherUserCrashCount); | 1495 IncrementPrefValue(prefs::kStabilityOtherUserCrashCount); |
1490 else if (crash_type == "kernel") | 1496 else if (crash_type == "kernel") |
1491 IncrementPrefValue(prefs::kStabilityKernelCrashCount); | 1497 IncrementPrefValue(prefs::kStabilityKernelCrashCount); |
1492 else if (crash_type == "uncleanshutdown") | 1498 else if (crash_type == "uncleanshutdown") |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1709 if (local_state) { | 1715 if (local_state) { |
1710 const PrefService::Preference* uma_pref = | 1716 const PrefService::Preference* uma_pref = |
1711 local_state->FindPreference(prefs::kMetricsReportingEnabled); | 1717 local_state->FindPreference(prefs::kMetricsReportingEnabled); |
1712 if (uma_pref) { | 1718 if (uma_pref) { |
1713 bool success = uma_pref->GetValue()->GetAsBoolean(&result); | 1719 bool success = uma_pref->GetValue()->GetAsBoolean(&result); |
1714 DCHECK(success); | 1720 DCHECK(success); |
1715 } | 1721 } |
1716 } | 1722 } |
1717 return result; | 1723 return result; |
1718 } | 1724 } |
OLD | NEW |