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

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: Rebased and added important_file_writer CL as dependent patchset Created 4 years, 3 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 9dd313438ca3a7affa50ac5ec9504b6cc621d746..970c78e6602df804b0b92850f9880e0c452d6920 100644
--- a/components/prefs/json_pref_store.cc
+++ b/components/prefs/json_pref_store.cc
@@ -330,6 +330,13 @@ void JsonPrefStore::RegisterOnNextSuccessfulWriteReply(
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() {
NOTIMPLEMENTED();
}
@@ -401,8 +408,12 @@ bool JsonPrefStore::SerializeData(std::string* output) {
write_count_histogram_.RecordWriteOccured();
- if (pref_filter_)
- pref_filter_->FilterSerializeData(prefs_.get());
+ if (pref_filter_) {
+ base::Callback<void(bool)> pref_filter_post_write_callback =
+ pref_filter_->FilterSerializeData(prefs_.get());
+ if (!pref_filter_post_write_callback.is_null())
+ RegisterOnNextWriteSynchronousCallback(pref_filter_post_write_callback);
+ }
JSONStringValueSerializer serializer(output);
// Not pretty-printing prefs shrinks pref file size by ~30%. To obtain

Powered by Google App Engine
This is Rietveld 408576698