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

Side by Side Diff: components/user_prefs/tracked/pref_hash_filter.h

Issue 2752533002: Convert PrefHashFilter enums to enum class. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « components/user_prefs/tracked/mock_validation_delegate.cc ('k') | components/user_prefs/tracked/pref_hash_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698