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

Unified Diff: chrome/browser/metrics/metrics_log.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/metrics/metrics_log.cc
===================================================================
--- chrome/browser/metrics/metrics_log.cc (revision 71358)
+++ chrome/browser/metrics/metrics_log.cc (working copy)
@@ -109,10 +109,9 @@
}
}
-void MetricsLog::WriteStabilityElement() {
+void MetricsLog::WriteStabilityElement(PrefService* pref) {
jar (doing other things) 2011/01/14 02:31:47 Why did you decide to pass this in? Does this fac
kmixter1 2011/01/15 22:21:07 Exactly. So I can unit test what this function ou
DCHECK(!locked_);
- PrefService* pref = g_browser_process->local_state();
DCHECK(pref);
// Get stability attributes out of Local State, zeroing out stored values.
@@ -232,6 +231,38 @@
pref->SetInteger(prefs::kStabilityChildProcessCrashCount, 0);
}
+#if defined(OS_CHROMEOS)
+ count = pref->GetInteger(prefs::kStabilityOtherUserCrashCount);
+ if (count) {
+ // TODO(kmixter): Write attribute once log server supports it
+ // and remove warning log.
+ // WriteIntAttribute("otherusercrashcount", count);
+ LOG(WARNING) << "Not yet able to send otherusercrashcount="
+ << count;
+ pref->SetInteger(prefs::kStabilityOtherUserCrashCount, 0);
+ }
+
+ count = pref->GetInteger(prefs::kStabilityKernelCrashCount);
+ if (count) {
+ // TODO(kmixter): Write attribute once log server supports it
+ // and remove warning log.
+ // WriteIntAttribute("kernelcrashcount", count);
+ LOG(WARNING) << "Not yet able to send kernelcrashcount="
+ << count;
+ pref->SetInteger(prefs::kStabilityKernelCrashCount, 0);
+ }
+
+ count = pref->GetInteger(prefs::kStabilitySystemUncleanShutdownCount);
+ if (count) {
+ // TODO(kmixter): Write attribute once log server supports it
+ // and remove warning log.
+ // WriteIntAttribute("systemuncleanshutdowns", count);
+ LOG(WARNING) << "Not yet able to send systemuncleanshutdowns="
+ << count;
+ pref->SetInteger(prefs::kStabilitySystemUncleanShutdownCount, 0);
+ }
+#endif // OS_CHROMEOS
+
int64 recent_duration = GetIncrementalUptime(pref);
if (recent_duration)
WriteInt64Attribute("uptimesec", recent_duration);
@@ -277,7 +308,7 @@
WritePluginList(plugin_list);
- WriteStabilityElement();
+ WriteStabilityElement(pref);
{
OPEN_ELEMENT_FOR_SCOPE("cpu");

Powered by Google App Engine
This is Rietveld 408576698