Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: chrome/browser/metrics/metrics_service.cc

Issue 6077013: Add support for collecting non-Chrome crash stats in Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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);
jar (doing other things) 2011/01/14 02:31:47 Is this all on the UI thread?
kmixter1 2011/01/15 22:21:07 In external_metrics I only call this when on the U
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 // Wake up metrics logs sending if necessary now that new
1735 // log data is available.
1736 HandleIdleSinceLastTransmission(false);
1737 }
1738 #endif // OS_CHROMEOS
1739
1718 void MetricsService::LogChildProcessChange( 1740 void MetricsService::LogChildProcessChange(
1719 NotificationType type, 1741 NotificationType type,
1720 const NotificationSource& source, 1742 const NotificationSource& source,
1721 const NotificationDetails& details) { 1743 const NotificationDetails& details) {
1722 Details<ChildProcessInfo> child_details(details); 1744 Details<ChildProcessInfo> child_details(details);
1723 const std::wstring& child_name = child_details->name(); 1745 const std::wstring& child_name = child_details->name();
1724 1746
1725 if (child_process_stats_buffer_.find(child_name) == 1747 if (child_process_stats_buffer_.find(child_name) ==
1726 child_process_stats_buffer_.end()) { 1748 child_process_stats_buffer_.end()) {
1727 child_process_stats_buffer_[child_name] = 1749 child_process_stats_buffer_[child_name] =
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1908 thread_id = base::PlatformThread::CurrentId(); 1930 thread_id = base::PlatformThread::CurrentId();
1909 return base::PlatformThread::CurrentId() == thread_id; 1931 return base::PlatformThread::CurrentId() == thread_id;
1910 } 1932 }
1911 1933
1912 #if defined(OS_CHROMEOS) 1934 #if defined(OS_CHROMEOS)
1913 void MetricsService::StartExternalMetrics() { 1935 void MetricsService::StartExternalMetrics() {
1914 external_metrics_ = new chromeos::ExternalMetrics; 1936 external_metrics_ = new chromeos::ExternalMetrics;
1915 external_metrics_->Start(); 1937 external_metrics_->Start();
1916 } 1938 }
1917 #endif 1939 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698