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

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: Experiment with giving two transactions to EnforceAndReport 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..9df4f3ac87243055d12d530f5d96313e8d087b31 100644
--- a/components/prefs/json_pref_store.cc
+++ b/components/prefs/json_pref_store.cc
@@ -330,6 +330,14 @@ void JsonPrefStore::RegisterOnNextSuccessfulWriteCallback(
writer_.RegisterOnNextSuccessfulWriteCallback(on_next_successful_write);
}
+void JsonPrefStore::RegisterOnNextSuccessfulWriteBlockingCallback(
+ const base::Closure& on_next_successful_write) {
+ DCHECK(CalledOnValidThread());
+
+ writer_.RegisterOnNextSuccessfulWriteBlockingCallback(
+ on_next_successful_write);
+}
+
void JsonPrefStore::ClearMutableValues() {
NOTIMPLEMENTED();
}
@@ -401,8 +409,11 @@ bool JsonPrefStore::SerializeData(std::string* output) {
write_count_histogram_.RecordWriteOccured();
- if (pref_filter_)
+ if (pref_filter_) {
+ RegisterOnNextSuccessfulWriteBlockingCallback(
+ pref_filter_->GetPostSerializeCallback(prefs_.get()));
pref_filter_->FilterSerializeData(prefs_.get());
+ }
JSONStringValueSerializer serializer(output);
// Not pretty-printing prefs shrinks pref file size by ~30%. To obtain

Powered by Google App Engine
This is Rietveld 408576698