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

Unified Diff: components/prefs/json_pref_store.cc

Issue 2204943002: Integrate registry_hash_store_contents with the rest of tracked prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove a lost include statement Created 4 years, 4 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: components/prefs/json_pref_store.cc
diff --git a/components/prefs/json_pref_store.cc b/components/prefs/json_pref_store.cc
index 779c2009730366aba4d8fae689d340b2fb81ad71..db8d659be08b71b6d1888ea23d9d63330a2976db 100644
--- a/components/prefs/json_pref_store.cc
+++ b/components/prefs/json_pref_store.cc
@@ -323,11 +323,18 @@ void JsonPrefStore::ReportValueChanged(const std::string& key, uint32_t flags) {
ScheduleWrite(flags);
}
-void JsonPrefStore::RegisterOnNextSuccessfulWriteCallback(
- const base::Closure& on_next_successful_write) {
+void JsonPrefStore::RegisterOnNextSuccessfulWriteReply(
+ const base::Closure& on_next_successful_write_reply) {
DCHECK(CalledOnValidThread());
- writer_.RegisterOnNextSuccessfulWriteCallback(on_next_successful_write);
+ writer_.RegisterOnNextSuccessfulWriteReply(on_next_successful_write_reply);
+}
+
+void JsonPrefStore::RegisterOnNextWriteSynchronousCallback(
+ const base::Callback<void(bool success)>& on_next_write_callback) {
+ DCHECK(CalledOnValidThread());
+
+ writer_.RegisterOnNextWriteSynchronousCallback(on_next_write_callback);
}
void JsonPrefStore::ClearMutableValues() {
@@ -401,8 +408,10 @@ bool JsonPrefStore::SerializeData(std::string* output) {
write_count_histogram_.RecordWriteOccured();
- if (pref_filter_)
- pref_filter_->FilterSerializeData(prefs_.get());
+ if (pref_filter_) {
+ RegisterOnNextWriteSynchronousCallback(
+ pref_filter_->FilterSerializeData(prefs_.get()));
gab 2016/08/08 04:37:45 Save the return value in a var and only register i
proberge 2016/08/31 17:30:16 Done.
+ }
JSONStringValueSerializer serializer(output);
// Not pretty-printing prefs shrinks pref file size by ~30%. To obtain

Powered by Google App Engine
This is Rietveld 408576698