| Index: services/preferences/persistent_pref_store_impl.cc
|
| diff --git a/services/preferences/persistent_pref_store_impl.cc b/services/preferences/persistent_pref_store_impl.cc
|
| index 95930387654f5c875d845330787287e8bbb2b662..24272a9d1599c8745da4b0590a0596c1e0587b7d 100644
|
| --- a/services/preferences/persistent_pref_store_impl.cc
|
| +++ b/services/preferences/persistent_pref_store_impl.cc
|
| @@ -42,8 +42,7 @@ class PersistentPrefStoreImpl::Connection : public mojom::PersistentPrefStore {
|
| for (const auto& update : updates) {
|
| if (base::ContainsKey(observed_keys_, update->key)) {
|
| filtered_updates.push_back(mojom::PrefUpdate::New(
|
| - update->key,
|
| - update->value ? update->value->CreateDeepCopy() : nullptr, 0));
|
| + update->key, update->value ? update->value : base::nullopt, 0));
|
| }
|
| }
|
| if (!filtered_updates.empty())
|
| @@ -112,8 +111,9 @@ PersistentPrefStoreImpl::CreateConnection(ObservedPrefs observed_prefs) {
|
| auto* connection_ptr = connection.get();
|
| connections_.insert(std::make_pair(connection_ptr, std::move(connection)));
|
| return mojom::PersistentPrefStoreConnection::New(
|
| - mojom::PrefStoreConnection::New(std::move(observer_request),
|
| - backing_pref_store_->GetValues(), true),
|
| + mojom::PrefStoreConnection::New(
|
| + std::move(observer_request),
|
| + std::move(*backing_pref_store_->GetValues()), true),
|
| std::move(pref_store_ptr), backing_pref_store_->GetReadError(),
|
| backing_pref_store_->ReadOnly());
|
| }
|
| @@ -134,8 +134,8 @@ void PersistentPrefStoreImpl::SetValues(
|
|
|
| for (auto& update : updates) {
|
| if (update->value) {
|
| - backing_pref_store_->SetValue(update->key, std::move(update->value),
|
| - update->flags);
|
| + backing_pref_store_->SetValue(
|
| + update->key, update->value->CreateDeepCopy(), update->flags);
|
| } else {
|
| backing_pref_store_->RemoveValue(update->key, update->flags);
|
| }
|
|
|