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

Unified Diff: chrome/browser/prefs/tracked/pref_hash_store_impl.cc

Issue 617183005: Split the NullInitialized signal out of TrustedInitialized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@c1_move_to_tracked
Patch Set: fix PrefHashBrowserTest Created 6 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: chrome/browser/prefs/tracked/pref_hash_store_impl.cc
diff --git a/chrome/browser/prefs/tracked/pref_hash_store_impl.cc b/chrome/browser/prefs/tracked/pref_hash_store_impl.cc
index 7a1641fc53d5336b28534fbd754cb58335ba0e3c..e7862b8aab5c93a7a51e13aa5fc9844d11d633c2 100644
--- a/chrome/browser/prefs/tracked/pref_hash_store_impl.cc
+++ b/chrome/browser/prefs/tracked/pref_hash_store_impl.cc
@@ -133,8 +133,12 @@ PrefHashStoreImpl::PrefHashStoreTransactionImpl::CheckValue(
if (last_hash.empty()) {
// In the absence of a hash for this pref, always trust a NULL value, but
// only trust an existing value if the initial hashes dictionary is trusted.
- return (!initial_value || super_mac_valid_) ? TRUSTED_UNKNOWN_VALUE
- : UNTRUSTED_UNKNOWN_VALUE;
+ if (!initial_value)
+ return TRUSTED_NULL_VALUE;
+ else if (super_mac_valid_)
+ return TRUSTED_UNKNOWN_VALUE;
+ else
+ return UNTRUSTED_UNKNOWN_VALUE;
}
PrefHashCalculator::ValidationResult validation_result =
@@ -171,10 +175,9 @@ PrefHashStoreImpl::PrefHashStoreTransactionImpl::CheckSplitValue(
std::map<std::string, std::string> split_macs;
const bool has_hashes = GetSplitMacs(path, &split_macs);
- // Treat NULL and empty the same; otherwise we would need to store a hash
- // for the entire dictionary (or some other special beacon) to
- // differentiate these two cases which are really the same for
- // dictionaries.
+ // Treat NULL and empty the same; otherwise we would need to store a hash for
+ // the entire dictionary (or some other special beacon) to differentiate these
+ // two cases which are really the same for dictionaries.
if (!initial_split_value || initial_split_value->empty())
return has_hashes ? CLEARED : UNCHANGED;

Powered by Google App Engine
This is Rietveld 408576698