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

Unified Diff: chrome/browser/chromeos/login/reauth_stats.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
Index: chrome/browser/chromeos/login/reauth_stats.cc
diff --git a/chrome/browser/chromeos/login/reauth_stats.cc b/chrome/browser/chromeos/login/reauth_stats.cc
index 4920f874bf98b568d058f920e3838d94bfd1033c..cca3ef8a65b9f52a3e7cdd05d87323454688d277 100644
--- a/chrome/browser/chromeos/login/reauth_stats.cc
+++ b/chrome/browser/chromeos/login/reauth_stats.cc
@@ -22,9 +22,12 @@ void RecordReauthReason(const AccountId& account_id, ReauthReason reason) {
}
void SendReauthReason(const AccountId& account_id) {
- int reauth_reason;
- if (user_manager::known_user::FindReauthReason(account_id, &reauth_reason) &&
- static_cast<ReauthReason>(reauth_reason) != ReauthReason::NONE) {
+ int reauth_reason_int;
+ if (!user_manager::known_user::FindReauthReason(account_id,
+ &reauth_reason_int))
+ return;
+ ReauthReason reauth_reason = static_cast<ReauthReason>(reauth_reason_int);
+ if (reauth_reason != ReauthReason::NONE) {
UMA_HISTOGRAM_ENUMERATION("Login.ReauthReason", reauth_reason,
NUM_REAUTH_FLOW_REASONS);
user_manager::known_user::UpdateReauthReason(
« no previous file with comments | « chrome/browser/chromeos/app_mode/kiosk_app_launch_error.cc ('k') | chrome/browser/chromeos/login/screens/reset_screen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698