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

Unified Diff: components/user_prefs/tracked/pref_hash_filter.cc

Issue 2372663003: Allow ImportantFileWriter to take in a pre-write callback. (Closed)
Patch Set: Add a WaitableEvent to fix a race condition in CallbackRunsOnWriterThread 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/user_prefs/tracked/pref_hash_filter.cc
diff --git a/components/user_prefs/tracked/pref_hash_filter.cc b/components/user_prefs/tracked/pref_hash_filter.cc
index 42ce04accebcd9d121d14909dbbb4693b6325b5b..d72a5c6b9e99062e5f305d80208d7144770fbe70 100644
--- a/components/user_prefs/tracked/pref_hash_filter.cc
+++ b/components/user_prefs/tracked/pref_hash_filter.cc
@@ -156,7 +156,7 @@ void PrefHashFilter::FilterUpdate(const std::string& path) {
// Updates the stored hashes for |changed_paths_| before serializing data to
// disk. This is required as storing the hash everytime a pref's value changes
// is too expensive (see perf regression @ http://crbug.com/331273).
-void PrefHashFilter::FilterSerializeData(
+PrefFilter::OnWriteCallbackPair PrefHashFilter::FilterSerializeData(
base::DictionaryValue* pref_store_contents) {
if (!changed_paths_.empty()) {
base::TimeTicks checkpoint = base::TimeTicks::Now();
@@ -180,6 +180,9 @@ void PrefHashFilter::FilterSerializeData(
UMA_HISTOGRAM_TIMES("Settings.FilterSerializeDataTime",
base::TimeTicks::Now() - checkpoint);
}
+
+ // TODO(proberge): return callbacks if external validation is enabled.
+ return std::make_pair(base::Closure(), base::Callback<void(bool success)>());
}
void PrefHashFilter::FinalizeFilterOnLoad(

Powered by Google App Engine
This is Rietveld 408576698