Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1466)

Unified Diff: services/preferences/public/cpp/pref_store_impl.cc

Issue 2812863002: Pref service: Add a ScopedDictionaryPrefUpdate to track value changes. (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/preferences/public/cpp/pref_store_impl.cc
diff --git a/services/preferences/public/cpp/pref_store_impl.cc b/services/preferences/public/cpp/pref_store_impl.cc
index c2289621e7e639db648661299ff750a2a5d96d83..914d1dd97cd5a9040062469d2a1abf94140fb3ce 100644
--- a/services/preferences/public/cpp/pref_store_impl.cc
+++ b/services/preferences/public/cpp/pref_store_impl.cc
@@ -6,6 +6,7 @@
#include <memory>
#include <unordered_set>
+#include <utility>
#include "base/stl_util.h"
#include "base/values.h"
@@ -27,7 +28,9 @@ class PrefStoreImpl::Observer {
return;
std::vector<mojom::PrefUpdatePtr> updates;
- updates.push_back(mojom::PrefUpdate::New(key, value.CreateDeepCopy(), 0));
+ updates.push_back(mojom::PrefUpdate::New(
+ key, mojom::PrefUpdateValue::NewAtomicUpdate(value.CreateDeepCopy()),
+ 0));
observer_->OnPrefsChanged(std::move(updates));
}
@@ -36,7 +39,8 @@ class PrefStoreImpl::Observer {
return;
std::vector<mojom::PrefUpdatePtr> updates;
- updates.push_back(mojom::PrefUpdate::New(key, nullptr, 0));
+ updates.push_back(mojom::PrefUpdate::New(
+ key, mojom::PrefUpdateValue::NewAtomicUpdate(nullptr), 0));
observer_->OnPrefsChanged(std::move(updates));
}
« no previous file with comments | « services/preferences/public/cpp/pref_store_impl.h ('k') | services/preferences/public/cpp/scoped_pref_update.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698