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 CHROME_BROWSER_PREFS_TRACKED_PREF_HASH_FILTER_H_ | 5 #ifndef COMPONENTS_USER_PREFS_TRACKED_PREF_HASH_FILTER_H_ |
6 #define CHROME_BROWSER_PREFS_TRACKED_PREF_HASH_FILTER_H_ | 6 #define COMPONENTS_USER_PREFS_TRACKED_PREF_HASH_FILTER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/containers/scoped_ptr_hash_map.h" | 15 #include "base/containers/scoped_ptr_hash_map.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "chrome/browser/prefs/tracked/interceptable_pref_filter.h" | 17 #include "components/user_prefs/tracked/interceptable_pref_filter.h" |
18 #include "chrome/browser/prefs/tracked/tracked_preference.h" | 18 #include "components/user_prefs/tracked/tracked_preference.h" |
19 | 19 |
20 class PrefHashStore; | 20 class PrefHashStore; |
21 class PrefService; | 21 class PrefService; |
22 class PrefStore; | 22 class PrefStore; |
23 class TrackedPreferenceValidationDelegate; | 23 class TrackedPreferenceValidationDelegate; |
24 | 24 |
25 namespace base { | 25 namespace base { |
26 class DictionaryValue; | 26 class DictionaryValue; |
27 class Time; | 27 class Time; |
28 class Value; | 28 class Value; |
29 } // namespace base | 29 } // namespace base |
30 | 30 |
31 namespace user_prefs { | 31 namespace user_prefs { |
32 class PrefRegistrySyncable; | 32 class PrefRegistrySyncable; |
33 } // namespace user_prefs | 33 } // namespace user_prefs |
34 | 34 |
35 // Intercepts preference values as they are loaded from disk and verifies them | 35 // Intercepts preference values as they are loaded from disk and verifies them |
36 // using a PrefHashStore. Keeps the PrefHashStore contents up to date as values | 36 // using a PrefHashStore. Keeps the PrefHashStore contents up to date as values |
37 // are changed. | 37 // are changed. |
38 class PrefHashFilter : public InterceptablePrefFilter { | 38 class PrefHashFilter : public InterceptablePrefFilter { |
39 public: | 39 public: |
40 enum EnforcementLevel { | 40 enum EnforcementLevel { NO_ENFORCEMENT, ENFORCE_ON_LOAD }; |
41 NO_ENFORCEMENT, | |
42 ENFORCE_ON_LOAD | |
43 }; | |
44 | 41 |
45 enum PrefTrackingStrategy { | 42 enum PrefTrackingStrategy { |
46 // Atomic preferences are tracked as a whole. | 43 // Atomic preferences are tracked as a whole. |
47 TRACKING_STRATEGY_ATOMIC, | 44 TRACKING_STRATEGY_ATOMIC, |
48 // Split preferences are dictionaries for which each top-level entry is | 45 // Split preferences are dictionaries for which each top-level entry is |
49 // tracked independently. Note: preferences using this strategy must be kept | 46 // tracked independently. Note: preferences using this strategy must be kept |
50 // in sync with TrackedSplitPreferences in histograms.xml. | 47 // in sync with TrackedSplitPreferences in histograms.xml. |
51 TRACKING_STRATEGY_SPLIT, | 48 TRACKING_STRATEGY_SPLIT, |
52 }; | 49 }; |
53 | 50 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // The set of all paths whose value has changed since the last call to | 131 // The set of all paths whose value has changed since the last call to |
135 // FilterSerializeData. | 132 // FilterSerializeData. |
136 ChangedPathsMap changed_paths_; | 133 ChangedPathsMap changed_paths_; |
137 | 134 |
138 // Whether to report the validity of the super MAC at load time (via UMA). | 135 // Whether to report the validity of the super MAC at load time (via UMA). |
139 bool report_super_mac_validity_; | 136 bool report_super_mac_validity_; |
140 | 137 |
141 DISALLOW_COPY_AND_ASSIGN(PrefHashFilter); | 138 DISALLOW_COPY_AND_ASSIGN(PrefHashFilter); |
142 }; | 139 }; |
143 | 140 |
144 #endif // CHROME_BROWSER_PREFS_TRACKED_PREF_HASH_FILTER_H_ | 141 #endif // COMPONENTS_PREFS_TRACKED_PREF_HASH_FILTER_H_ |
OLD | NEW |