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

Unified Diff: trunk/src/chrome/browser/prefs/pref_hash_filter.h

Issue 273243002: Revert 269415 "Introduce a new framework for back-and-forth trac..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 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: trunk/src/chrome/browser/prefs/pref_hash_filter.h
===================================================================
--- trunk/src/chrome/browser/prefs/pref_hash_filter.h (revision 269437)
+++ trunk/src/chrome/browser/prefs/pref_hash_filter.h (working copy)
@@ -7,15 +7,18 @@
#include <map>
#include <set>
+#include <string>
#include <vector>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/containers/scoped_ptr_hash_map.h"
-#include "chrome/browser/prefs/interceptable_pref_filter.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/prefs/pref_filter.h"
#include "chrome/browser/prefs/pref_hash_store.h"
#include "chrome/browser/prefs/tracked/tracked_preference.h"
+class PersistentPrefStore;
class PrefService;
class PrefStore;
@@ -32,7 +35,7 @@
// Intercepts preference values as they are loaded from disk and verifies them
// using a PrefHashStore. Keeps the PrefHashStore contents up to date as values
// are changed.
-class PrefHashFilter : public InterceptablePrefFilter {
+class PrefHashFilter : public PrefFilter {
public:
enum EnforcementLevel {
NO_ENFORCEMENT,
@@ -81,23 +84,23 @@
// |pref_store|.
void Initialize(const PrefStore& pref_store);
- // PrefFilter remaining implementation.
+ // Migrates protected values from |source| to |destination|. Values are
+ // migrated if they are protected according to this filter's configuration,
+ // the corresponding key has no value in |destination|, and the value in
+ // |source| is trusted according to this filter's PrefHashStore. Regardless of
+ // the state of |destination| or the trust status, the protected values will
+ // be removed from |source|.
+ void MigrateValues(PersistentPrefStore* source,
+ PersistentPrefStore* destination);
+
+ // PrefFilter implementation.
+ virtual bool FilterOnLoad(base::DictionaryValue* pref_store_contents)
+ OVERRIDE;
virtual void FilterUpdate(const std::string& path) OVERRIDE;
virtual void FilterSerializeData(
const base::DictionaryValue* pref_store_contents) OVERRIDE;
private:
- // InterceptablePrefFilter implementation.
- virtual void FinalizeFilterOnLoad(
- const PostFilterOnLoadCallback& post_filter_on_load_callback,
- scoped_ptr<base::DictionaryValue> pref_store_contents,
- bool prefs_altered) OVERRIDE;
-
- // Callback to be invoked only once (and subsequently reset) on the next
- // FilterOnLoad event. It will be allowed to modify the |prefs| handed to
- // FilterOnLoad before handing them back to this PrefHashFilter.
- FilterOnLoadInterceptor filter_on_load_interceptor_;
-
// A map of paths to TrackedPreferences; this map owns this individual
// TrackedPreference objects.
typedef base::ScopedPtrHashMap<std::string, TrackedPreference>
« no previous file with comments | « trunk/src/chrome/browser/prefs/interceptable_pref_filter.cc ('k') | trunk/src/chrome/browser/prefs/pref_hash_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698