| 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 void PersistentPrefStoreClient::SchedulePendingLossyWrites() { | 260 void PersistentPrefStoreClient::SchedulePendingLossyWrites() { |
| 261 DCHECK(pref_store_); | 261 DCHECK(pref_store_); |
| 262 return pref_store_->SchedulePendingLossyWrites(); | 262 return pref_store_->SchedulePendingLossyWrites(); |
| 263 } | 263 } |
| 264 | 264 |
| 265 void PersistentPrefStoreClient::ClearMutableValues() { | 265 void PersistentPrefStoreClient::ClearMutableValues() { |
| 266 DCHECK(pref_store_); | 266 DCHECK(pref_store_); |
| 267 return pref_store_->ClearMutableValues(); | 267 return pref_store_->ClearMutableValues(); |
| 268 } | 268 } |
| 269 | 269 |
| 270 void PersistentPrefStoreClient::OnStoreDeletionFromDisk() { |
| 271 DCHECK(pref_store_); |
| 272 return pref_store_->OnStoreDeletionFromDisk(); |
| 273 } |
| 274 |
| 270 PersistentPrefStoreClient::~PersistentPrefStoreClient() { | 275 PersistentPrefStoreClient::~PersistentPrefStoreClient() { |
| 271 if (!pref_store_) | 276 if (!pref_store_) |
| 272 return; | 277 return; |
| 273 | 278 |
| 274 CommitPendingWrite(base::OnceClosure()); | 279 CommitPendingWrite(base::OnceClosure()); |
| 275 } | 280 } |
| 276 | 281 |
| 277 void PersistentPrefStoreClient::OnConnect( | 282 void PersistentPrefStoreClient::OnConnect( |
| 278 mojom::PersistentPrefStoreConnectionPtr connection, | 283 mojom::PersistentPrefStoreConnectionPtr connection, |
| 279 mojom::PersistentPrefStoreConnectionPtr incognito_connection, | 284 mojom::PersistentPrefStoreConnectionPtr incognito_connection, |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 auto decision = it->second.Lookup(path.begin(), path.end()); | 419 auto decision = it->second.Lookup(path.begin(), path.end()); |
| 415 if (decision == InFlightWriteTrie::Decision::kAllow) { | 420 if (decision == InFlightWriteTrie::Decision::kAllow) { |
| 416 return false; | 421 return false; |
| 417 } | 422 } |
| 418 if (decision == InFlightWriteTrie::Decision::kResolve) | 423 if (decision == InFlightWriteTrie::Decision::kResolve) |
| 419 pref_store_->RequestValue(key, path); | 424 pref_store_->RequestValue(key, path); |
| 420 return true; | 425 return true; |
| 421 } | 426 } |
| 422 | 427 |
| 423 } // namespace prefs | 428 } // namespace prefs |
| OLD | NEW |