metrics: Send ability to notify chrome of system crashes
Change-Id: I11df903c020141a8123055620f9ad23fedc06c7d
BUG=9352
TEST=
1) UserCrash
2) Crash random process and verify Chrome indicates "other user" crashes
occurred in its stability UMA data.
Review URL: http://codereview.chromium.org/6211001
diff --git a/metrics/metrics_library.cc b/metrics/metrics_library.cc
index 05e63ac..f2046a3 100644
--- a/metrics/metrics_library.cc
+++ b/metrics/metrics_library.cc
@@ -255,3 +255,17 @@
// Send the message.
return SendMessageToChrome(message_length, message);
}
+
+bool MetricsLibrary::SendCrashToUMA(const char *crash_kind) {
+ // Format the message.
+ char message[kBufferSize];
+ int32_t message_length =
+ FormatChromeMessage(kBufferSize, message,
+ "crash%c%s", '\0', crash_kind);
+
+ if (message_length < 0)
+ return false;
+
+ // Send the message.
+ return SendMessageToChrome(message_length, message);
+}