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

Unified Diff: content/browser/gpu/gpu_process_host.cc

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: simplify type checking Created 3 years, 5 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
« no previous file with comments | « content/browser/download/download_stats.cc ('k') | content/renderer/input/render_widget_input_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_process_host.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 8c1824b1f030e79183ade9855087769b2197ac41..ab0ad6a8e8d2a36d049fef9ee46b7d8638c74a6a 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -546,7 +546,7 @@ GpuProcessHost::~GpuProcessHost() {
// Windows always returns PROCESS_CRASHED on abnormal termination, as it
// doesn't have a way to distinguish the two.
UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessExitCode",
- exit_code,
+ static_cast<ResultCode>(exit_code),
RESULT_CODE_LAST_CODE);
}
@@ -1132,9 +1132,10 @@ void GpuProcessHost::RecordProcessCrash() {
// options).
if (process_launched_ && kind_ == GPU_PROCESS_KIND_SANDBOXED) {
if (swiftshader_rendering_) {
- UMA_HISTOGRAM_ENUMERATION("GPU.SwiftShaderLifetimeEvents",
- DIED_FIRST_TIME + swiftshader_crash_count_,
- GPU_PROCESS_LIFETIME_EVENT_MAX);
+ UMA_HISTOGRAM_EXACT_LINEAR(
+ "GPU.SwiftShaderLifetimeEvents",
+ DIED_FIRST_TIME + swiftshader_crash_count_,
+ static_cast<int>(GPU_PROCESS_LIFETIME_EVENT_MAX));
if (++swiftshader_crash_count_ >= kGpuMaxCrashCount &&
!disable_crash_limit) {
@@ -1143,10 +1144,11 @@ void GpuProcessHost::RecordProcessCrash() {
}
} else {
++gpu_crash_count_;
- UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessLifetimeEvents",
- std::min(DIED_FIRST_TIME + gpu_crash_count_,
- GPU_PROCESS_LIFETIME_EVENT_MAX - 1),
- GPU_PROCESS_LIFETIME_EVENT_MAX);
+ UMA_HISTOGRAM_EXACT_LINEAR(
+ "GPU.GPUProcessLifetimeEvents",
+ std::min(DIED_FIRST_TIME + gpu_crash_count_,
+ GPU_PROCESS_LIFETIME_EVENT_MAX - 1),
+ static_cast<int>(GPU_PROCESS_LIFETIME_EVENT_MAX));
// Allow about 1 GPU crash per hour to be removed from the crash count,
// so very occasional crashes won't eventually add up and prevent the
« no previous file with comments | « content/browser/download/download_stats.cc ('k') | content/renderer/input/render_widget_input_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698