Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef BASE_PREFS_PREF_FILTER_H_ | |
| 6 #define BASE_PREFS_PREF_FILTER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include "base/prefs/base_prefs_export.h" | |
| 10 | |
| 11 class PersistentPrefStore; | |
| 12 | |
| 13 // Filters preferences as they are loaded from disk or updated at runtime. | |
| 14 // Currently supported only by JsonPrefStore. | |
| 15 class BASE_PREFS_EXPORT PrefFilter { | |
| 16 public: | |
| 17 virtual ~PrefFilter() {} | |
| 18 | |
| 19 // Receives notification when the pref store data has been loaded but before | |
| 20 // 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.
| |
| 21 // Changes made by a PrefFilter during FilterOnLoad do not result in | |
| 22 // notifications to |PrefStore::Observer|s. | |
| 23 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
| |
| 24 | |
| 25 // Receives notification when a pref store value is changed, before any other | |
| 26 // 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
| |
| 27 virtual void FilterUpdate(PersistentPrefStore* pref_store, | |
| 28 const std::string& path) = 0; | |
| 29 }; | |
| 30 | |
| 31 #endif // BASE_PREFS_PREF_FILTER_H_ | |
| OLD | NEW |