Index: chrome/browser/prefs/tracked_preference.h |
diff --git a/chrome/browser/prefs/tracked_preference.h b/chrome/browser/prefs/tracked_preference.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..397dd9fa9f709764923f798f1efb60ef3535ce7c |
--- /dev/null |
+++ b/chrome/browser/prefs/tracked_preference.h |
@@ -0,0 +1,34 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
erikwright (departed)
2014/01/17 20:23:01
Update this in all your new files. It's 2014, baby
gab
2014/01/17 21:32:01
Done.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_PREFS_TRACKED_PREFERENCE_H_ |
+#define CHROME_BROWSER_PREFS_TRACKED_PREFERENCE_H_ |
+ |
+class PrefHashStore; |
+ |
+namespace base { |
+class DictionaryValue; |
+class Value; |
+} |
+ |
+// A TrackedPreference is a pure-virtual class whose subclasses are responsible |
erikwright (departed)
2014/01/17 20:23:01
I think it's atypical to describe a class's OO cha
gab
2014/01/17 21:32:01
Done.
|
+// for handling hash storage and pref enforcement with the help of decisions |
+// made via queries to TrackedPreferenceHelper. |
+class TrackedPreference { |
+ public: |
+ virtual ~TrackedPreference() {} |
+ |
+ // Stores a new hash in |pref_hash_store| for this preference's |value|. |
erikwright (departed)
2014/01/17 20:23:01
The method name and comment are somewhat misleadin
gab
2014/01/17 21:32:01
Done.
|
+ virtual void StoreHash(const base::Value* value, |
+ PrefHashStore* pref_hash_store) const = 0; |
+ |
+ // Enforces that the value of this tracked preference in |pref_store_contents| |
erikwright (departed)
2014/01/17 20:23:01
Enforces -> Verifies...
// ... Responds to verifi
gab
2014/01/17 21:32:01
Done.
|
+ // is valid according to |pref_hash_store|; otherwise discarding the value in |
+ // |pref_store_contents|. Reports on its findings via UMA. |
+ virtual void EnforceAndReport( |
+ PrefHashStore* pref_hash_store, |
+ base::DictionaryValue* pref_store_contents) const = 0; |
+}; |
+ |
+#endif // CHROME_BROWSER_PREFS_TRACKED_PREFERENCE_H_ |