Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 6 |
| 7 //------------------------------------------------------------------------------ | 7 //------------------------------------------------------------------------------ |
| 8 // Description of the life cycle of a instance of MetricsService. | 8 // Description of the life cycle of a instance of MetricsService. |
| 9 // | 9 // |
| 10 // OVERVIEW | 10 // OVERVIEW |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 393 local_state->RegisterIntegerPref(prefs::kStabilityExtensionRendererCrashCount, | 393 local_state->RegisterIntegerPref(prefs::kStabilityExtensionRendererCrashCount, |
| 394 0); | 394 0); |
| 395 local_state->RegisterIntegerPref(prefs::kStabilityRendererHangCount, 0); | 395 local_state->RegisterIntegerPref(prefs::kStabilityRendererHangCount, 0); |
| 396 local_state->RegisterIntegerPref(prefs::kStabilityChildProcessCrashCount, 0); | 396 local_state->RegisterIntegerPref(prefs::kStabilityChildProcessCrashCount, 0); |
| 397 local_state->RegisterIntegerPref(prefs::kStabilityBreakpadRegistrationFail, | 397 local_state->RegisterIntegerPref(prefs::kStabilityBreakpadRegistrationFail, |
| 398 0); | 398 0); |
| 399 local_state->RegisterIntegerPref(prefs::kStabilityBreakpadRegistrationSuccess, | 399 local_state->RegisterIntegerPref(prefs::kStabilityBreakpadRegistrationSuccess, |
| 400 0); | 400 0); |
| 401 local_state->RegisterIntegerPref(prefs::kStabilityDebuggerPresent, 0); | 401 local_state->RegisterIntegerPref(prefs::kStabilityDebuggerPresent, 0); |
| 402 local_state->RegisterIntegerPref(prefs::kStabilityDebuggerNotPresent, 0); | 402 local_state->RegisterIntegerPref(prefs::kStabilityDebuggerNotPresent, 0); |
| 403 #if defined(OS_CHROMEOS) | |
| 404 local_state->RegisterIntegerPref(prefs::kStabilityOtherUserCrashCount, 0); | |
| 405 local_state->RegisterIntegerPref(prefs::kStabilityKernelCrashCount, 0); | |
| 406 local_state->RegisterIntegerPref(prefs::kStabilitySystemUncleanShutdownCount, | |
| 407 0); | |
| 408 #endif // OS_CHROMEOS | |
| 403 | 409 |
| 404 local_state->RegisterDictionaryPref(prefs::kProfileMetrics); | 410 local_state->RegisterDictionaryPref(prefs::kProfileMetrics); |
| 405 local_state->RegisterIntegerPref(prefs::kNumBookmarksOnBookmarkBar, 0); | 411 local_state->RegisterIntegerPref(prefs::kNumBookmarksOnBookmarkBar, 0); |
| 406 local_state->RegisterIntegerPref(prefs::kNumFoldersOnBookmarkBar, 0); | 412 local_state->RegisterIntegerPref(prefs::kNumFoldersOnBookmarkBar, 0); |
| 407 local_state->RegisterIntegerPref(prefs::kNumBookmarksInOtherBookmarkFolder, | 413 local_state->RegisterIntegerPref(prefs::kNumBookmarksInOtherBookmarkFolder, |
| 408 0); | 414 0); |
| 409 local_state->RegisterIntegerPref(prefs::kNumFoldersInOtherBookmarkFolder, 0); | 415 local_state->RegisterIntegerPref(prefs::kNumFoldersInOtherBookmarkFolder, 0); |
| 410 local_state->RegisterIntegerPref(prefs::kNumKeywords, 0); | 416 local_state->RegisterIntegerPref(prefs::kNumKeywords, 0); |
| 411 local_state->RegisterListPref(prefs::kMetricsInitialLogs); | 417 local_state->RegisterListPref(prefs::kMetricsInitialLogs); |
| 412 local_state->RegisterListPref(prefs::kMetricsOngoingLogs); | 418 local_state->RegisterListPref(prefs::kMetricsOngoingLogs); |
| (...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1708 } | 1714 } |
| 1709 | 1715 |
| 1710 void MetricsService::LogExtensionRendererCrash() { | 1716 void MetricsService::LogExtensionRendererCrash() { |
| 1711 IncrementPrefValue(prefs::kStabilityExtensionRendererCrashCount); | 1717 IncrementPrefValue(prefs::kStabilityExtensionRendererCrashCount); |
| 1712 } | 1718 } |
| 1713 | 1719 |
| 1714 void MetricsService::LogRendererHang() { | 1720 void MetricsService::LogRendererHang() { |
| 1715 IncrementPrefValue(prefs::kStabilityRendererHangCount); | 1721 IncrementPrefValue(prefs::kStabilityRendererHangCount); |
| 1716 } | 1722 } |
| 1717 | 1723 |
| 1724 #if defined(OS_CHROMEOS) | |
| 1725 void MetricsService::LogChromeOSCrash(const std::string &crash_type) { | |
| 1726 if (crash_type == "user") | |
| 1727 IncrementPrefValue(prefs::kStabilityOtherUserCrashCount); | |
| 1728 else if (crash_type == "kernel") | |
| 1729 IncrementPrefValue(prefs::kStabilityKernelCrashCount); | |
| 1730 else if (crash_type == "uncleanshutdown") | |
| 1731 IncrementPrefValue(prefs::kStabilitySystemUncleanShutdownCount); | |
| 1732 else | |
| 1733 NOTREACHED() << "Unexpected Chrome OS crash type " << crash_type; | |
| 1734 HandleIdleSinceLastTransmission(false); | |
|
petkov
2011/01/06 18:50:36
what does this do?
kmixter1
2011/01/14 00:07:02
Fair question - see new comment.
| |
| 1735 } | |
| 1736 #endif // OS_CHROMEOS | |
| 1737 | |
| 1718 void MetricsService::LogChildProcessChange( | 1738 void MetricsService::LogChildProcessChange( |
| 1719 NotificationType type, | 1739 NotificationType type, |
| 1720 const NotificationSource& source, | 1740 const NotificationSource& source, |
| 1721 const NotificationDetails& details) { | 1741 const NotificationDetails& details) { |
| 1722 Details<ChildProcessInfo> child_details(details); | 1742 Details<ChildProcessInfo> child_details(details); |
| 1723 const std::wstring& child_name = child_details->name(); | 1743 const std::wstring& child_name = child_details->name(); |
| 1724 | 1744 |
| 1725 if (child_process_stats_buffer_.find(child_name) == | 1745 if (child_process_stats_buffer_.find(child_name) == |
| 1726 child_process_stats_buffer_.end()) { | 1746 child_process_stats_buffer_.end()) { |
| 1727 child_process_stats_buffer_[child_name] = | 1747 child_process_stats_buffer_[child_name] = |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1908 thread_id = PlatformThread::CurrentId(); | 1928 thread_id = PlatformThread::CurrentId(); |
| 1909 return PlatformThread::CurrentId() == thread_id; | 1929 return PlatformThread::CurrentId() == thread_id; |
| 1910 } | 1930 } |
| 1911 | 1931 |
| 1912 #if defined(OS_CHROMEOS) | 1932 #if defined(OS_CHROMEOS) |
| 1913 void MetricsService::StartExternalMetrics() { | 1933 void MetricsService::StartExternalMetrics() { |
| 1914 external_metrics_ = new chromeos::ExternalMetrics; | 1934 external_metrics_ = new chromeos::ExternalMetrics; |
| 1915 external_metrics_->Start(); | 1935 external_metrics_->Start(); |
| 1916 } | 1936 } |
| 1917 #endif | 1937 #endif |
| OLD | NEW |