Chromium Code Reviews| Index: base/prefs/pref_filter.h |
| diff --git a/base/prefs/pref_filter.h b/base/prefs/pref_filter.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..aa560871744b1885c9a1e5b45d5ad38dd8c82631 |
| --- /dev/null |
| +++ b/base/prefs/pref_filter.h |
| @@ -0,0 +1,31 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BASE_PREFS_PREF_FILTER_H_ |
| +#define BASE_PREFS_PREF_FILTER_H_ |
| + |
| +#include <string> |
| +#include "base/prefs/base_prefs_export.h" |
| + |
| +class PersistentPrefStore; |
| + |
| +// Filters preferences as they are loaded from disk or updated at runtime. |
| +// Currently supported only by JsonPrefStore. |
| +class BASE_PREFS_EXPORT PrefFilter { |
| + public: |
| + virtual ~PrefFilter() {} |
| + |
| + // Receives notification when the pref store data has been loaded but before |
| + // any other clients are notified. |
|
Bernhard Bauer
2013/12/10 16:52:07
Description nit: There are no clients of a JsonPre
erikwright (departed)
2013/12/12 15:53:30
Done.
|
| + // Changes made by a PrefFilter during FilterOnLoad do not result in |
| + // notifications to |PrefStore::Observer|s. |
| + virtual void FilterOnLoad(PersistentPrefStore* pref_store) = 0; |
|
Bernhard Bauer
2013/12/10 16:52:07
I think it would be somewhat more intuitive if thi
erikwright (departed)
2013/12/10 18:57:29
I agree, with a couple caveats:
(1) It requires th
Bernhard Bauer
2013/12/10 23:31:43
Well, it's only used by the JsonPrefStore anyway ;
erikwright (departed)
2013/12/11 14:33:06
The theory is that FilterUpdate might reject an up
|
| + |
| + // Receives notification when a pref store value is changed, before any other |
| + // clients are notified. |
|
Bernhard Bauer
2013/12/10 16:52:07
Same comment about clients as above; also: is it r
erikwright (departed)
2013/12/10 18:57:29
For consistency with FilterOnLoad, I think so. For
Bernhard Bauer
2013/12/10 23:31:43
Urr, can we just say that modifying the pref store
erikwright (departed)
2013/12/11 14:33:06
Sure, because we know how all of this is tied toge
|
| + virtual void FilterUpdate(PersistentPrefStore* pref_store, |
| + const std::string& path) = 0; |
| +}; |
| + |
| +#endif // BASE_PREFS_PREF_FILTER_H_ |