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

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

Issue 2396443002: Revert of Integrate registry_hash_store_contents with the rest of tracked prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_atomic_preference.cc
diff --git a/components/user_prefs/tracked/tracked_atomic_preference.cc b/components/user_prefs/tracked/tracked_atomic_preference.cc
index 2415d7f844a909a3ebbdcbd70741b05c8dff52ae..fe49826dc45f0016ede4e32b495ddb4cc4584ce3 100644
--- a/components/user_prefs/tracked/tracked_atomic_preference.cc
+++ b/components/user_prefs/tracked/tracked_atomic_preference.cc
@@ -24,10 +24,6 @@
delegate_(delegate) {
}
-TrackedPreferenceType TrackedAtomicPreference::GetType() const {
- return TrackedPreferenceType::ATOMIC;
-}
-
void TrackedAtomicPreference::OnNewValue(
const base::Value* value,
PrefHashStoreTransaction* transaction) const {
@@ -36,32 +32,20 @@
bool TrackedAtomicPreference::EnforceAndReport(
base::DictionaryValue* pref_store_contents,
- PrefHashStoreTransaction* transaction,
- PrefHashStoreTransaction* external_validation_transaction) const {
+ PrefHashStoreTransaction* transaction) const {
const base::Value* value = NULL;
pref_store_contents->Get(pref_path_, &value);
PrefHashStoreTransaction::ValueState value_state =
transaction->CheckValue(pref_path_, value);
+
helper_.ReportValidationResult(value_state, transaction->GetStoreUMASuffix());
- PrefHashStoreTransaction::ValueState external_validation_value_state =
- PrefHashStoreTransaction::UNCHANGED;
- if (external_validation_transaction) {
- external_validation_value_state =
- external_validation_transaction->CheckValue(pref_path_, value);
- helper_.ReportValidationResult(
- external_validation_value_state,
- external_validation_transaction->GetStoreUMASuffix());
-
- // TODO(proberge): Call delegate_->OnAtomicPreferenceValidation.
- }
-
+ TrackedPreferenceHelper::ResetAction reset_action =
+ helper_.GetAction(value_state);
if (delegate_) {
delegate_->OnAtomicPreferenceValidation(pref_path_, value, value_state,
helper_.IsPersonal());
}
- TrackedPreferenceHelper::ResetAction reset_action =
- helper_.GetAction(value_state);
helper_.ReportAction(reset_action);
bool was_reset = false;
@@ -77,16 +61,5 @@
transaction->StoreHash(pref_path_, new_value);
}
- // Update MACs in the external store if there is one and there either was a
- // reset or external validation failed.
- if (external_validation_transaction &&
- (was_reset ||
- external_validation_value_state !=
- PrefHashStoreTransaction::UNCHANGED)) {
- const base::Value* new_value = nullptr;
- pref_store_contents->Get(pref_path_, &new_value);
- external_validation_transaction->StoreHash(pref_path_, new_value);
- }
-
return was_reset;
}
« no previous file with comments | « components/user_prefs/tracked/tracked_atomic_preference.h ('k') | components/user_prefs/tracked/tracked_preference.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698