Index: chrome/browser/prefs/pref_hash_filter.h |
diff --git a/chrome/browser/prefs/pref_hash_filter.h b/chrome/browser/prefs/pref_hash_filter.h |
index 5dea96839cb2e8dd87ddd7790f32db74276d191f..a71f97bd446b563b347669c68988c832ef136b93 100644 |
--- a/chrome/browser/prefs/pref_hash_filter.h |
+++ b/chrome/browser/prefs/pref_hash_filter.h |
@@ -5,14 +5,15 @@ |
#ifndef CHROME_BROWSER_PREFS_PREF_HASH_FILTER_H_ |
#define CHROME_BROWSER_PREFS_PREF_HASH_FILTER_H_ |
-#include <map> |
#include <string> |
#include "base/basictypes.h" |
#include "base/compiler_specific.h" |
+#include "base/containers/scoped_ptr_hash_map.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/prefs/pref_filter.h" |
#include "chrome/browser/prefs/pref_hash_store.h" |
+#include "chrome/browser/prefs/tracked/tracked_preference.h" |
namespace base { |
class DictionaryValue; |
@@ -33,16 +34,26 @@ class PrefHashFilter : public PrefFilter { |
ENFORCE_NO_SEEDING_NO_MIGRATION, |
// ENFORCE_ALL must always remain last; it is meant to be used when the |
// desired level is underdetermined and the caller wants to enforce the |
- // strongest setting to be safe. |
+ // strongest level to be safe. |
ENFORCE_ALL |
}; |
- struct TrackedPreference { |
+ enum PrefTrackingStrategy { |
+ // Atomic preferences are tracked as a whole. |
+ TRACKING_STRATEGY_ATOMIC, |
+ // Split preferences are dictionaries for which each top-level entry is |
+ // tracked independently. Note: preferences using this strategy must be kept |
+ // in sync with TrackedSplitPreferences in histograms.xml. |
+ TRACKING_STRATEGY_SPLIT, |
+ }; |
+ |
+ struct TrackedPreferenceMetadata { |
size_t reporting_id; |
const char* name; |
// Whether to actually reset this specific preference when everything else |
// indicates that it should be. |
bool allow_enforcement; |
+ PrefTrackingStrategy strategy; |
}; |
// Constructs a PrefHashFilter tracking the specified |tracked_preferences| |
@@ -52,7 +63,7 @@ class PrefHashFilter : public PrefFilter { |
// filter will enforce factory defaults upon detecting an untrusted preference |
// value. |
PrefHashFilter(scoped_ptr<PrefHashStore> pref_hash_store, |
- const TrackedPreference tracked_preferences[], |
+ const TrackedPreferenceMetadata tracked_preferences[], |
size_t tracked_preferences_size, |
size_t reporting_ids_count, |
EnforcementLevel enforcement_level); |
@@ -66,20 +77,12 @@ class PrefHashFilter : public PrefFilter { |
const base::Value* value) OVERRIDE; |
private: |
- typedef std::map<std::string, const TrackedPreference> TrackedPreferencesMap; |
+ typedef base::ScopedPtrHashMap<std::string, TrackedPreference> |
+ TrackedPreferencesMap; |
scoped_ptr<PrefHashStore> pref_hash_store_; |
TrackedPreferencesMap tracked_paths_; |
- size_t reporting_ids_count_; |
- |
- // Prevent setting changes. |
- bool enforce_; |
- // Do not seed unknown values. |
- bool no_seeding_; |
- // Do not migrate values validated by the old MAC algorithm. |
- bool no_migration_; |
- |
DISALLOW_COPY_AND_ASSIGN(PrefHashFilter); |
}; |