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

Unified Diff: services/preferences/tracked/pref_hash_store_transaction.h

Issue 2782803002: Move tracked prefs into services/preferences/tracked. (Closed)
Patch Set: rebase Created 3 years, 9 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: services/preferences/tracked/pref_hash_store_transaction.h
diff --git a/components/user_prefs/tracked/pref_hash_store_transaction.h b/services/preferences/tracked/pref_hash_store_transaction.h
similarity index 65%
rename from components/user_prefs/tracked/pref_hash_store_transaction.h
rename to services/preferences/tracked/pref_hash_store_transaction.h
index 55d99d2d03fc6b04f4e9eb4724a69de779416704..2e888859ee82cb41a052076f332ed13037adf13d 100644
--- a/components/user_prefs/tracked/pref_hash_store_transaction.h
+++ b/services/preferences/tracked/pref_hash_store_transaction.h
@@ -2,13 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef COMPONENTS_USER_PREFS_TRACKED_PREF_HASH_STORE_TRANSACTION_H_
-#define COMPONENTS_USER_PREFS_TRACKED_PREF_HASH_STORE_TRANSACTION_H_
+#ifndef SERVICES_PREFERENCES_TRACKED_PREF_HASH_STORE_TRANSACTION_H_
+#define SERVICES_PREFERENCES_TRACKED_PREF_HASH_STORE_TRANSACTION_H_
#include <string>
#include <vector>
#include "base/strings/string_piece.h"
+#include "services/preferences/public/interfaces/tracked_preference_validation_delegate.mojom.h"
namespace base {
class DictionaryValue;
@@ -18,30 +19,6 @@ class Value;
// Used to perform a series of checks/transformations on a PrefHashStore.
class PrefHashStoreTransaction {
public:
- enum ValueState {
- // The preference value corresponds to its stored hash.
- UNCHANGED,
- // The preference has been cleared since the last hash.
- CLEARED,
- // The preference value corresponds to its stored hash, but the hash was
- // calculated using a deprecated hash algorithm which is just as safe as
- // the current one.
- SECURE_LEGACY,
- // The preference value has been changed since the last hash.
- CHANGED,
- // No stored hash exists for the preference value.
- UNTRUSTED_UNKNOWN_VALUE,
- // No stored hash exists for the preference value, but the current set of
- // hashes stored is trusted and thus this value can safely be seeded. This
- // happens when all hashes are already properly seeded and a newly
- // tracked value needs to be seeded).
- TRUSTED_UNKNOWN_VALUE,
- // NULL values are inherently trusted.
- TRUSTED_NULL_VALUE,
- // This transaction's store type is not supported.
- UNSUPPORTED,
- };
-
// Finalizes any remaining work after the transaction has been performed.
virtual ~PrefHashStoreTransaction() {}
@@ -50,8 +27,9 @@ class PrefHashStoreTransaction {
virtual base::StringPiece GetStoreUMASuffix() const = 0;
// Checks |initial_value| against the existing stored value hash.
- virtual ValueState CheckValue(const std::string& path,
- const base::Value* initial_value) const = 0;
+ virtual prefs::mojom::TrackedPreferenceValidationDelegate::ValueState
+ CheckValue(const std::string& path,
+ const base::Value* initial_value) const = 0;
// Stores a hash of the current |value| of the preference at |path|.
virtual void StoreHash(const std::string& path, const base::Value* value) = 0;
@@ -62,10 +40,10 @@ class PrefHashStoreTransaction {
// will not be modified unless the return value is CHANGED, in which case it
// will be filled with the keys that are considered invalid (unknown or
// changed).
- virtual ValueState CheckSplitValue(
- const std::string& path,
- const base::DictionaryValue* initial_split_value,
- std::vector<std::string>* invalid_keys) const = 0;
+ virtual prefs::mojom::TrackedPreferenceValidationDelegate::ValueState
+ CheckSplitValue(const std::string& path,
+ const base::DictionaryValue* initial_split_value,
+ std::vector<std::string>* invalid_keys) const = 0;
// Stores hashes for the |value| of the split preference at |path|.
// |split_value| being an empty dictionary or NULL is equivalent.
@@ -99,4 +77,4 @@ class PrefHashStoreTransaction {
virtual bool StampSuperMac() = 0;
};
-#endif // COMPONENTS_USER_PREFS_TRACKED_PREF_HASH_STORE_TRANSACTION_H_
+#endif // SERVICES_PREFERENCES_TRACKED_PREF_HASH_STORE_TRANSACTION_H_

Powered by Google App Engine
This is Rietveld 408576698