OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_PREFS_OVERLAY_USER_PREF_STORE_H_ | 5 #ifndef BASE_PREFS_OVERLAY_USER_PREF_STORE_H_ |
6 #define BASE_PREFS_OVERLAY_USER_PREF_STORE_H_ | 6 #define BASE_PREFS_OVERLAY_USER_PREF_STORE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 #include "base/prefs/base_prefs_export.h" | 16 #include "components/prefs/base_prefs_export.h" |
17 #include "base/prefs/persistent_pref_store.h" | 17 #include "components/prefs/persistent_pref_store.h" |
18 #include "base/prefs/pref_value_map.h" | 18 #include "components/prefs/pref_value_map.h" |
19 | 19 |
20 // PersistentPrefStore that directs all write operations into an in-memory | 20 // PersistentPrefStore that directs all write operations into an in-memory |
21 // PrefValueMap. Read operations are first answered by the PrefValueMap. | 21 // PrefValueMap. Read operations are first answered by the PrefValueMap. |
22 // If the PrefValueMap does not contain a value for the requested key, | 22 // If the PrefValueMap does not contain a value for the requested key, |
23 // the look-up is passed on to an underlying PersistentPrefStore |underlay_|. | 23 // the look-up is passed on to an underlying PersistentPrefStore |underlay_|. |
24 class BASE_PREFS_EXPORT OverlayUserPrefStore : public PersistentPrefStore, | 24 class BASE_PREFS_EXPORT OverlayUserPrefStore : public PersistentPrefStore, |
25 public PrefStore::Observer { | 25 public PrefStore::Observer { |
26 public: | 26 public: |
27 explicit OverlayUserPrefStore(PersistentPrefStore* underlay); | 27 explicit OverlayUserPrefStore(PersistentPrefStore* underlay); |
28 | 28 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 base::ObserverList<PrefStore::Observer, true> observers_; | 80 base::ObserverList<PrefStore::Observer, true> observers_; |
81 PrefValueMap overlay_; | 81 PrefValueMap overlay_; |
82 scoped_refptr<PersistentPrefStore> underlay_; | 82 scoped_refptr<PersistentPrefStore> underlay_; |
83 NamesMap overlay_to_underlay_names_map_; | 83 NamesMap overlay_to_underlay_names_map_; |
84 NamesMap underlay_to_overlay_names_map_; | 84 NamesMap underlay_to_overlay_names_map_; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(OverlayUserPrefStore); | 86 DISALLOW_COPY_AND_ASSIGN(OverlayUserPrefStore); |
87 }; | 87 }; |
88 | 88 |
89 #endif // BASE_PREFS_OVERLAY_USER_PREF_STORE_H_ | 89 #endif // BASE_PREFS_OVERLAY_USER_PREF_STORE_H_ |
OLD | NEW |