OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_USER_PREFS_TRACKED_PREF_HASH_FILTER_H_ | 5 #ifndef COMPONENTS_USER_PREFS_TRACKED_PREF_HASH_FILTER_H_ |
6 #define COMPONENTS_USER_PREFS_TRACKED_PREF_HASH_FILTER_H_ | 6 #define COMPONENTS_USER_PREFS_TRACKED_PREF_HASH_FILTER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 namespace user_prefs { | 39 namespace user_prefs { |
40 class PrefRegistrySyncable; | 40 class PrefRegistrySyncable; |
41 } // namespace user_prefs | 41 } // namespace user_prefs |
42 | 42 |
43 // Intercepts preference values as they are loaded from disk and verifies them | 43 // Intercepts preference values as they are loaded from disk and verifies them |
44 // using a PrefHashStore. Keeps the PrefHashStore contents up to date as values | 44 // using a PrefHashStore. Keeps the PrefHashStore contents up to date as values |
45 // are changed. | 45 // are changed. |
46 class PrefHashFilter : public InterceptablePrefFilter { | 46 class PrefHashFilter : public InterceptablePrefFilter { |
47 public: | 47 public: |
48 enum EnforcementLevel { NO_ENFORCEMENT, ENFORCE_ON_LOAD }; | 48 enum class EnforcementLevel { NO_ENFORCEMENT, ENFORCE_ON_LOAD }; |
49 | 49 |
50 enum PrefTrackingStrategy { | 50 enum class PrefTrackingStrategy { |
51 // Atomic preferences are tracked as a whole. | 51 // Atomic preferences are tracked as a whole. |
52 TRACKING_STRATEGY_ATOMIC, | 52 ATOMIC, |
53 // Split preferences are dictionaries for which each top-level entry is | 53 // Split preferences are dictionaries for which each top-level entry is |
54 // tracked independently. Note: preferences using this strategy must be kept | 54 // tracked independently. Note: preferences using this strategy must be kept |
55 // in sync with TrackedSplitPreferences in histograms.xml. | 55 // in sync with TrackedSplitPreferences in histograms.xml. |
56 TRACKING_STRATEGY_SPLIT, | 56 SPLIT, |
57 }; | 57 }; |
58 | 58 |
59 enum ValueType { | 59 enum class ValueType { |
60 VALUE_IMPERSONAL, | 60 IMPERSONAL, |
61 // The preference value may contain personal information. | 61 // The preference value may contain personal information. |
62 VALUE_PERSONAL, | 62 PERSONAL, |
63 }; | 63 }; |
64 | 64 |
65 struct TrackedPreferenceMetadata { | 65 struct TrackedPreferenceMetadata { |
66 size_t reporting_id; | 66 size_t reporting_id; |
67 const char* name; | 67 const char* name; |
68 EnforcementLevel enforcement_level; | 68 EnforcementLevel enforcement_level; |
69 PrefTrackingStrategy strategy; | 69 PrefTrackingStrategy strategy; |
70 ValueType value_type; | 70 ValueType value_type; |
71 }; | 71 }; |
72 | 72 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 // FilterSerializeData. | 172 // FilterSerializeData. |
173 ChangedPathsMap changed_paths_; | 173 ChangedPathsMap changed_paths_; |
174 | 174 |
175 // Whether to report the validity of the super MAC at load time (via UMA). | 175 // Whether to report the validity of the super MAC at load time (via UMA). |
176 bool report_super_mac_validity_; | 176 bool report_super_mac_validity_; |
177 | 177 |
178 DISALLOW_COPY_AND_ASSIGN(PrefHashFilter); | 178 DISALLOW_COPY_AND_ASSIGN(PrefHashFilter); |
179 }; | 179 }; |
180 | 180 |
181 #endif // COMPONENTS_PREFS_TRACKED_PREF_HASH_FILTER_H_ | 181 #endif // COMPONENTS_PREFS_TRACKED_PREF_HASH_FILTER_H_ |
OLD | NEW |