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

Unified Diff: third_party/crashpad/crashpad/util/misc/metrics.cc

Issue 2478633002: Update Crashpad to b47bf6c250c6b825dee1c5fbad9152c2c962e828 (Closed)
Patch Set: mac comment 2 Created 4 years, 1 month 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: third_party/crashpad/crashpad/util/misc/metrics.cc
diff --git a/third_party/crashpad/crashpad/util/misc/metrics.cc b/third_party/crashpad/crashpad/util/misc/metrics.cc
index f5ab07b642642312451e559693ec6e54b6be5191..48be7ecd7aed785a9822331b51c961ff19184443 100644
--- a/third_party/crashpad/crashpad/util/misc/metrics.cc
+++ b/third_party/crashpad/crashpad/util/misc/metrics.cc
@@ -18,6 +18,16 @@
#include "base/metrics/sparse_histogram.h"
#include "build/build_config.h"
+#if defined(OS_MACOSX)
+#define METRICS_OS_NAME "Mac"
+#elif defined(OS_WIN)
+#define METRICS_OS_NAME "Win"
+#elif defined(OS_ANDROID)
+#define METRICS_OS_NAME "Android"
+#elif defined(OS_LINUX)
+#define METRICS_OS_NAME "Linux"
+#endif
+
namespace crashpad {
namespace {
@@ -79,12 +89,7 @@ void Metrics::ExceptionCaptureResult(CaptureResult result) {
// static
void Metrics::ExceptionCode(uint32_t exception_code) {
-#if defined(OS_WIN)
- static const char kExceptionCodeString[] = "Crashpad.ExceptionCode.Win";
-#elif defined(OS_MACOSX)
- static const char kExceptionCodeString[] = "Crashpad.ExceptionCode.Mac";
-#endif
- UMA_HISTOGRAM_SPARSE_SLOWLY(kExceptionCodeString,
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Crashpad.ExceptionCode." METRICS_OS_NAME,
static_cast<int32_t>(exception_code));
}
@@ -94,15 +99,9 @@ void Metrics::ExceptionEncountered() {
}
void Metrics::HandlerCrashed(uint32_t exception_code) {
-#if defined(OS_WIN)
- static const char kExceptionCodeString[] =
- "Crashpad.HandlerCrash.ExceptionCode.Win";
-#elif defined(OS_MACOSX)
- static const char kExceptionCodeString[] =
- "Crashpad.HandlerCrash.ExceptionCode.Mac";
-#endif
- UMA_HISTOGRAM_SPARSE_SLOWLY(kExceptionCodeString,
- static_cast<int32_t>(exception_code));
+ UMA_HISTOGRAM_SPARSE_SLOWLY(
+ "Crashpad.HandlerCrash.ExceptionCode." METRICS_OS_NAME,
+ static_cast<int32_t>(exception_code));
}
} // namespace crashpad
« no previous file with comments | « third_party/crashpad/crashpad/util/misc/clock_test.cc ('k') | third_party/crashpad/crashpad/util/misc/uuid.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698