| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 void PersistentPrefStoreClient::SchedulePendingLossyWrites() { | 174 void PersistentPrefStoreClient::SchedulePendingLossyWrites() { |
| 175 DCHECK(pref_store_); | 175 DCHECK(pref_store_); |
| 176 return pref_store_->SchedulePendingLossyWrites(); | 176 return pref_store_->SchedulePendingLossyWrites(); |
| 177 } | 177 } |
| 178 | 178 |
| 179 void PersistentPrefStoreClient::ClearMutableValues() { | 179 void PersistentPrefStoreClient::ClearMutableValues() { |
| 180 DCHECK(pref_store_); | 180 DCHECK(pref_store_); |
| 181 return pref_store_->ClearMutableValues(); | 181 return pref_store_->ClearMutableValues(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void PersistentPrefStoreClient::OnStoreDeletionFromDisk() { |
| 185 DCHECK(pref_store_); |
| 186 return pref_store_->OnStoreDeletionFromDisk(); |
| 187 } |
| 188 |
| 184 PersistentPrefStoreClient::~PersistentPrefStoreClient() { | 189 PersistentPrefStoreClient::~PersistentPrefStoreClient() { |
| 185 if (!pref_store_) | 190 if (!pref_store_) |
| 186 return; | 191 return; |
| 187 | 192 |
| 188 CommitPendingWrite(); | 193 CommitPendingWrite(); |
| 189 } | 194 } |
| 190 | 195 |
| 191 void PersistentPrefStoreClient::OnConnect( | 196 void PersistentPrefStoreClient::OnConnect( |
| 192 mojom::PersistentPrefStoreConnectionPtr connection, | 197 mojom::PersistentPrefStoreConnectionPtr connection, |
| 193 mojom::PersistentPrefStoreConnectionPtr incognito_connection, | 198 mojom::PersistentPrefStoreConnectionPtr incognito_connection, |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 update_value->set_atomic_update(nullptr); | 266 update_value->set_atomic_update(nullptr); |
| 262 } | 267 } |
| 263 updates.emplace_back(base::in_place, pref.first, std::move(update_value), | 268 updates.emplace_back(base::in_place, pref.first, std::move(update_value), |
| 264 pref.second.second); | 269 pref.second.second); |
| 265 } | 270 } |
| 266 pref_store_->SetValues(std::move(updates)); | 271 pref_store_->SetValues(std::move(updates)); |
| 267 pending_writes_.clear(); | 272 pending_writes_.clear(); |
| 268 } | 273 } |
| 269 | 274 |
| 270 } // namespace prefs | 275 } // namespace prefs |
| OLD | NEW |