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

Unified Diff: chrome/browser/prefs/tracked_preference.h

Issue 114223002: Multi-strategy based tracking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use base::ScopedPtrHashMap Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698