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

Unified Diff: components/user_prefs/tracked/tracked_preference_helper.cc

Issue 2384213002: Send a TrackedPreference incident when registry pref validation fails. (Closed)
Patch Set: Handle UNSUPPORTED in another switch Created 4 years, 2 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: components/user_prefs/tracked/tracked_preference_helper.cc
diff --git a/components/user_prefs/tracked/tracked_preference_helper.cc b/components/user_prefs/tracked/tracked_preference_helper.cc
index 2d39749cf53c27f70741bdbe308e5c0ecfb9a20b..cab44ad5642e3129702d6639c77c945ba9001f49 100644
--- a/components/user_prefs/tracked/tracked_preference_helper.cc
+++ b/components/user_prefs/tracked/tracked_preference_helper.cc
@@ -38,6 +38,10 @@ TrackedPreferenceHelper::ResetAction TrackedPreferenceHelper::GetAction(
case PrefHashStoreTransaction::SECURE_LEGACY:
// Accept secure legacy device ID based hashes.
return DONT_RESET;
+ case PrefHashStoreTransaction::UNSUPPORTED:
+ NOTREACHED()
+ << "GetAction should not be called with an UNSUPPORTED value state";
+ return DONT_RESET;
case PrefHashStoreTransaction::UNTRUSTED_UNKNOWN_VALUE: // Falls through.
case PrefHashStoreTransaction::CHANGED:
return enforce_ ? DO_RESET : WANTED_RESET;
@@ -80,6 +84,8 @@ void TrackedPreferenceHelper::ReportValidationResult(
histogram_name =
user_prefs::tracked::kTrackedPrefHistogramNullInitialized;
break;
+ case PrefHashStoreTransaction::UNSUPPORTED:
+ return;
gab 2016/10/03 21:03:58 This should be NOTREACHED() as well
proberge 2016/10/05 15:36:40 Done.
default:
gab 2016/10/03 21:03:58 And while you're here if you don't mind: remove de
proberge 2016/10/05 15:36:40 I think default:foo is slightly cleaner than addin
gab 2016/10/05 17:23:21 No, the presence of the default prevents clang fro
proberge 2016/10/05 17:53:26 Done, but can't use empty() on a char*. Initialize
NOTREACHED() << "Unexpected PrefHashStoreTransaction::ValueState: "
<< value_state;

Powered by Google App Engine
This is Rietveld 408576698