| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "services/preferences/tracked/segregated_pref_store.h" | 5 #include "services/preferences/tracked/segregated_pref_store.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 void SegregatedPrefStore::SchedulePendingLossyWrites() { | 168 void SegregatedPrefStore::SchedulePendingLossyWrites() { |
| 169 default_pref_store_->SchedulePendingLossyWrites(); | 169 default_pref_store_->SchedulePendingLossyWrites(); |
| 170 selected_pref_store_->SchedulePendingLossyWrites(); | 170 selected_pref_store_->SchedulePendingLossyWrites(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void SegregatedPrefStore::ClearMutableValues() { | 173 void SegregatedPrefStore::ClearMutableValues() { |
| 174 NOTIMPLEMENTED(); | 174 NOTIMPLEMENTED(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void SegregatedPrefStore::CleanupForProfileDeletion() { |
| 178 default_pref_store_->CleanupForProfileDeletion(); |
| 179 selected_pref_store_->CleanupForProfileDeletion(); |
| 180 } |
| 181 |
| 177 SegregatedPrefStore::~SegregatedPrefStore() { | 182 SegregatedPrefStore::~SegregatedPrefStore() { |
| 178 default_pref_store_->RemoveObserver(&aggregating_observer_); | 183 default_pref_store_->RemoveObserver(&aggregating_observer_); |
| 179 selected_pref_store_->RemoveObserver(&aggregating_observer_); | 184 selected_pref_store_->RemoveObserver(&aggregating_observer_); |
| 180 } | 185 } |
| 181 | 186 |
| 182 PersistentPrefStore* SegregatedPrefStore::StoreForKey(const std::string& key) { | 187 PersistentPrefStore* SegregatedPrefStore::StoreForKey(const std::string& key) { |
| 183 return (base::ContainsKey(selected_preference_names_, key) | 188 return (base::ContainsKey(selected_preference_names_, key) |
| 184 ? selected_pref_store_ | 189 ? selected_pref_store_ |
| 185 : default_pref_store_) | 190 : default_pref_store_) |
| 186 .get(); | 191 .get(); |
| 187 } | 192 } |
| 188 | 193 |
| 189 const PersistentPrefStore* SegregatedPrefStore::StoreForKey( | 194 const PersistentPrefStore* SegregatedPrefStore::StoreForKey( |
| 190 const std::string& key) const { | 195 const std::string& key) const { |
| 191 return (base::ContainsKey(selected_preference_names_, key) | 196 return (base::ContainsKey(selected_preference_names_, key) |
| 192 ? selected_pref_store_ | 197 ? selected_pref_store_ |
| 193 : default_pref_store_) | 198 : default_pref_store_) |
| 194 .get(); | 199 .get(); |
| 195 } | 200 } |
| OLD | NEW |