| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/public/cpp/persistent_pref_store_client.h" | 5 #include "services/preferences/public/cpp/persistent_pref_store_client.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "components/prefs/pref_registry.h" | 8 #include "components/prefs/pref_registry.h" |
| 9 #include "mojo/common/values.mojom.h" | 9 #include "mojo/common/values.mojom.h" |
| 10 #include "mojo/common/values_struct_traits.h" | 10 #include "mojo/common/values_struct_traits.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 void PersistentPrefStoreClient::SchedulePendingLossyWrites() { | 172 void PersistentPrefStoreClient::SchedulePendingLossyWrites() { |
| 173 DCHECK(pref_store_); | 173 DCHECK(pref_store_); |
| 174 return pref_store_->SchedulePendingLossyWrites(); | 174 return pref_store_->SchedulePendingLossyWrites(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void PersistentPrefStoreClient::ClearMutableValues() { | 177 void PersistentPrefStoreClient::ClearMutableValues() { |
| 178 DCHECK(pref_store_); | 178 DCHECK(pref_store_); |
| 179 return pref_store_->ClearMutableValues(); | 179 return pref_store_->ClearMutableValues(); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void PersistentPrefStoreClient::CleanupForProfileDeletion() { |
| 183 DCHECK(pref_store_); |
| 184 return pref_store_->CleanupForProfileDeletion(); |
| 185 } |
| 186 |
| 182 PersistentPrefStoreClient::~PersistentPrefStoreClient() { | 187 PersistentPrefStoreClient::~PersistentPrefStoreClient() { |
| 183 if (!pref_store_) | 188 if (!pref_store_) |
| 184 return; | 189 return; |
| 185 | 190 |
| 186 CommitPendingWrite(); | 191 CommitPendingWrite(); |
| 187 } | 192 } |
| 188 | 193 |
| 189 void PersistentPrefStoreClient::OnConnect( | 194 void PersistentPrefStoreClient::OnConnect( |
| 190 mojom::PersistentPrefStoreConnectionPtr connection, | 195 mojom::PersistentPrefStoreConnectionPtr connection, |
| 191 std::unordered_map<PrefValueStore::PrefStoreType, | 196 std::unordered_map<PrefValueStore::PrefStoreType, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 update_value->set_atomic_update(nullptr); | 263 update_value->set_atomic_update(nullptr); |
| 259 } | 264 } |
| 260 updates.emplace_back(base::in_place, pref.first, std::move(update_value), | 265 updates.emplace_back(base::in_place, pref.first, std::move(update_value), |
| 261 pref.second.second); | 266 pref.second.second); |
| 262 } | 267 } |
| 263 pref_store_->SetValues(std::move(updates)); | 268 pref_store_->SetValues(std::move(updates)); |
| 264 pending_writes_.clear(); | 269 pending_writes_.clear(); |
| 265 } | 270 } |
| 266 | 271 |
| 267 } // namespace prefs | 272 } // namespace prefs |
| OLD | NEW |