#include "util/misc/metrics.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/numerics/safe_conversions.h"
#include "build/build_config.h"
#if BUILDFLAG(IS_APPLE)
#define METRICS_OS_NAME …
#elif BUILDFLAG(IS_WIN)
#define METRICS_OS_NAME …
#elif BUILDFLAG(IS_ANDROID)
#define METRICS_OS_NAME …
#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#define METRICS_OS_NAME …
#elif BUILDFLAG(IS_FUCHSIA)
#define METRICS_OS_NAME …
#endif
namespace crashpad {
namespace {
enum class ExceptionProcessingState { … };
void ExceptionProcessing(ExceptionProcessingState state) { … }
}
void Metrics::CrashReportPending(PendingReportReason reason) { … }
void Metrics::CrashReportSize(FileOffset size) { … }
void Metrics::CrashUploadAttempted(bool successful) { … }
#if BUILDFLAG(IS_APPLE)
void Metrics::CrashUploadErrorCode(int error_code) {
base::UmaHistogramSparse("Crashpad.CrashUpload.ErrorCode", error_code);
}
#endif
void Metrics::CrashUploadSkipped(CrashSkippedReason reason) { … }
void Metrics::ExceptionCaptureResult(CaptureResult result) { … }
void Metrics::ExceptionCode(uint32_t exception_code) { … }
void Metrics::ExceptionEncountered() { … }
void Metrics::HandlerLifetimeMilestone(LifetimeMilestone milestone) { … }
void Metrics::HandlerCrashed(uint32_t exception_code) { … }
#if BUILDFLAG(IS_IOS)
void Metrics::MissingIntermediateDumpKey(
const internal::IntermediateDumpKey& key) {
base::UmaHistogramSparse("Crashpad.IntermediateDump.Reader.MissingKey",
static_cast<uint16_t>(key));
}
void Metrics::InvalidIntermediateDumpKeySize(
const internal::IntermediateDumpKey& key) {
base::UmaHistogramSparse("Crashpad.IntermediateDump.Reader.InvalidKeySize",
static_cast<uint16_t>(key));
}
#endif
}